|  |
Molssi Driver Interface Library
|
28 #define DllExport __declspec( dllexport )
37 typedef int MDI_Datatype;
39 typedef int (*MDI_Driver_node_callback_t)(
void*, int,
void*);
40 typedef int (*MDI_Driver_node_callback_f90_t)(
void*);
60 DllExport
extern const int MDI_INT;
75 DllExport
extern const int MDI_TCP;
76 DllExport
extern const int MDI_MPI;
86 DllExport
int MDI_Init(
int* argc,
char ***argv);
90 DllExport
int MDI_Send(
const void* buf,
int count, MDI_Datatype datatype, MDI_Comm comm);
91 DllExport
int MDI_Recv(
void* buf,
int count, MDI_Datatype datatype, MDI_Comm comm);
102 DllExport
int MDI_String_to_atomic_number(
const char* element_symbol,
int* atomic_number);
111 DllExport
int MDI_Get_Node(
int index, MDI_Comm comm,
char* name);
112 DllExport
int MDI_Get_node(
int index, MDI_Comm comm,
char* name);
117 DllExport
int MDI_Get_NCommands(
const char* node_name, MDI_Comm comm,
int* ncommands);
118 DllExport
int MDI_Get_ncommands(
const char* node_name, MDI_Comm comm,
int* ncommands);
119 DllExport
int MDI_Get_Command(
const char* node_name,
int index, MDI_Comm comm,
char* name);
120 DllExport
int MDI_Get_command(
const char* node_name,
int index, MDI_Comm comm,
char* name);
125 DllExport
int MDI_Get_NCallbacks(
const char* node_name, MDI_Comm comm,
int* ncallbacks);
126 DllExport
int MDI_Get_ncallbacks(
const char* node_name, MDI_Comm comm,
int* ncallbacks);
127 DllExport
int MDI_Get_Callback(
const char* node_name,
int index, MDI_Comm comm,
char* name);
128 DllExport
int MDI_Get_callback(
const char* node_name,
int index, MDI_Comm comm,
char* name);
135 DllExport
int MDI_Launch_plugin(
const char* plugin_name,
const char* options,
void* mpi_comm_ptr,
136 MDI_Driver_node_callback_t driver_node_callback,
137 void* driver_callback_object);
138 DllExport
int MDI_Open_plugin(
const char* plugin_name,
const char* options,
void* mpi_comm_ptr, MDI_Comm* mdi_comm_ptr);
142 DllExport
int MDI_Set_plugin_state(
void* state);
164 DllExport
void mdi_error(
const char* message);
int MDI_Set_plugin_language(int language, void *plugin_state)
Set the language of an MDI plugin.
Definition: mdi.c:2608
int MDI_Check_callback_exists(const char *node_name, const char *callback_name, MDI_Comm comm, int *flag)
Check whether a callback exists on specified node on a specified engine.
Definition: mdi.c:1749
int MDI_Check_Node_Exists(const char *node_name, MDI_Comm comm, int *flag)
Check whether a node is supported on a specified engine.
Definition: mdi.c:1148
int MDI_MPI_get_world_comm(void *world_comm)
Obtain the MPI communicator that spans the single code corresponding to the calling rank.
Definition: mdi.c:2010
int MDI_Get_Current_Code()
Get the current code.
Definition: mdi.c:2306
int MDI_Get_node(int index, MDI_Comm comm, char *name)
Get the name of a node on a specified engine.
Definition: mdi.c:1303
const int MDI_INT8_T
int8_t data type
Definition: mdi.c:62
int MDI_Get_Role(int *role)
Get the role of the code.
Definition: mdi.c:946
int MDI_Initialized(int *flag)
Indicates whether MDI_Init has been called.
Definition: mdi.c:265
int MDI_Set_plugin_state_internal(void *state)
Set the language-based callback for when a code is destroyed.
Definition: mdi.c:2279
const MDI_Comm MDI_COMM_NULL
value of a null communicator
Definition: mdi.c:56
const int MDI_UINT32_T
uint32_t data type
Definition: mdi.c:74
int MDI_Set_Launch_Plugin_Callback(int(*launch_plugin)(void *, void *, void *, int))
Set the callback MDI uses for MDI_Plugin_init when the driver is in Python.
Definition: mdi.c:2587
int MDI_Send(const void *buf, int count, MDI_Datatype datatype, MDI_Comm comm)
Send data through the MDI connection.
Definition: mdi.c:326
const int MDI_LABEL_LENGTH
length of an MDI label in characters
Definition: mdi.c:53
int MDI_Get_NNodes(MDI_Comm comm, int *nnodes)
Get the number of nodes on a specified engine.
Definition: mdi.c:1225
int MDI_Register_Command(const char *node_name, const char *command_name)
Register a command on a specified node.
Definition: mdi.c:1353
int MDI_Get_python_plugin_mpi_world_ptr(void **python_plugin_mpi_world_ptr_ptr, void *state_in)
Get the Python plugin MPI communicator.
Definition: mdi.c:2406
const int MDI_INT64_T
int64_t data type
Definition: mdi.c:68
int MDI_Get_ncallbacks(const char *node_name, MDI_Comm comm, int *ncallbacks)
Get the number of callbacks on a specified node on a specified engine.
Definition: mdi.c:1854
int MDI_Set_Mpi4py_Size_Callback(int(*mpi4py_size)(int))
Set the callback MDI uses for MPI_Comm_size when using mpi4py.
Definition: mdi.c:2545
int MDI_Get_method(int *method, MDI_Comm comm)
Get the communication method of a communicator.
Definition: mdi.c:997
const int MDI_DOUBLE
double precision float data type
Definition: mdi.c:78
int MDI_Plugin_get_args(char **args_ptr)
Get plugin_unedited_options.
Definition: mdi.c:2356
int MDI_Set_Mpi4py_Send_Callback(int(*mpi4py_send)(void *, int, int, int, MDI_Comm))
Set the callback MDI uses for MPI_Send when using mpi4py.
Definition: mdi.c:2441
int MDI_Plugin_get_argc(int *argc_ptr)
Get plugin_argc.
Definition: mdi.c:2314
int MDI_Set_Mpi4py_Allgather_Callback(int(*mpi4py_allgather)(void *, void *))
Set the callback MDI uses for gathering MDI versions when using mpi4py.
Definition: mdi.c:2462
int MDI_Call_language_driver_callback(void *class_obj)
Call the language driver callback needed by a language wrapper.
Definition: mdi.c:2729
int MDI_Set_language_driver_callback(MDI_Driver_node_callback_f90_t callback)
Set the language-specific driver_callback function needed by a language wrapper.
Definition: mdi.c:2706
const int MDI_UINT8_T
uint8_t data type
Definition: mdi.c:70
int MDI_Get_Node(int index, MDI_Comm comm, char *name)
Get the name of a node on a specified engine.
Definition: mdi.c:1285
int MDI_Set_Execute_Command_Func(int(*generic_command)(const char *, MDI_Comm, void *), void *class_object)
Set the callback MDI uses for MDI_Execute_Command.
Definition: mdi.c:2208
int MDI_Set_language_execute_command(int(*execute_command)(void *, MDI_Comm, void *))
Set the language execute_command function needed by a language wrapper.
Definition: mdi.c:2622
const int MDI_INT16_T
int16_t data type
Definition: mdi.c:64
int MDI_Get_intra_rank(int intra_rank_out)
Get the rank of this process within the MPI intra-communicator for the current code.
Definition: mdi.c:1082
int MDI_Accept_Communicator(MDI_Comm *comm)
Accept a new MDI communicator.
Definition: mdi.c:280
int MDI_Check_node_exists(const char *node_name, MDI_Comm comm, int *flag)
Check whether a node is supported on a specified engine.
Definition: mdi.c:1166
int MDI_Get_NCommands(const char *node_name, MDI_Comm comm, int *ncommands)
Get the number of commands supported for a specified node on a specified engine.
Definition: mdi.c:1506
int MDI_Get_ncommands(const char *node_name, MDI_Comm comm, int *ncommands)
Get the number of commands supported for a specified node on a specified engine.
Definition: mdi.c:1525
int MDI_Register_Callback(const char *node_name, const char *callback_name)
Register a callback on a specified node.
Definition: mdi.c:1683
const int MDI_DRIVER
Driver role type.
Definition: mdi.c:100
int MDI_Conversion_Factor(const char *in_unit, const char *out_unit, double *conv)
Determine the conversion factor between two units.
Definition: mdi.c:532
int MDI_Launch_plugin(const char *plugin_name, const char *options, void *mpi_comm_ptr, MDI_Driver_node_callback_t driver_node_callback, void *driver_callback_object)
Launch an MDI plugin instance.
Definition: mdi.c:2101
int MDI_Get_Callback(const char *node_name, int index, MDI_Comm comm, char *name)
Get the name of a callback on a specified node on a specified engine.
Definition: mdi.c:1923
int MDI_MPI_set_world_comm(void *world_comm)
Set the MPI communicator that spans the single code corresponding to the calling rank.
Definition: mdi.c:2052
int MDI_Recv_Command(char *buf, MDI_Comm comm)
Receive a command of length MDI_COMMAND_LENGTH through the MDI connection.
Definition: mdi.c:433
int MDI_Register_node(const char *node_name)
Register a node.
Definition: mdi.c:1119
const int MDI_LINK
Library communication method (deprecated)
Definition: mdi.c:92
int MDI_Plugin_get_argv(char ***argv_ptr)
Get plugin_argv.
Definition: mdi.c:2335
const int MDI_COMMAND_LENGTH
length of an MDI command in characters
Definition: mdi.c:47
int MDI_Init_with_argv(int *argc, char ***argv)
Initialize communication through the MDI library.
Definition: mdi.c:163
int MDI_Get_Command(const char *node_name, int index, MDI_Comm comm, char *name)
Get the name of a command on a specified node on a specified engine.
Definition: mdi.c:1594
const int MDI_NAME_LENGTH
length of an MDI name in characters
Definition: mdi.c:50
const int MDI_TCP
TCP/IP communication method.
Definition: mdi.c:88
int MDI_Get_callback(const char *node_name, int index, MDI_Comm comm, char *name)
Get the name of a callback on a specified node on a specified engine.
Definition: mdi.c:1943
int MDI_Register_Node(const char *node_name)
Register a node.
Definition: mdi.c:1106
int MDI_Recv(void *buf, int count, MDI_Datatype datatype, MDI_Comm comm)
Receive data through the MDI connection.
Definition: mdi.c:359
int MDI_Send_command(const char *buf, MDI_Comm comm)
Send a command of length MDI_COMMAND_LENGTH through the MDI connection.
Definition: mdi.c:404
const int MDI_BYTE
character data type
Definition: mdi.c:84
int MDI_Close_plugin(MDI_Comm mdi_comm)
Close an MDI plugin instance.
Definition: mdi.c:2190
int MDI_Init(int *argc, char ***argv)
Initialize communication through the MDI library.
Definition: mdi.c:115
int MDI_Init_code()
Initialize a code structure for the MDI library.
Definition: mdi.c:211
int MDI_Check_command_exists(const char *node_name, const char *command_name, MDI_Comm comm, int *flag)
Check whether a command is supported on specified node on a specified engine.
Definition: mdi.c:1420
const int MDI_INT32_T
int32_t data type
Definition: mdi.c:66
int MDI_Get_communicator(MDI_Comm *comm, int index)
Get the previously accepted MDI communicator at a specific index in the array of all communicators.
Definition: mdi.c:1023
const int MDI_ENGINE
Engine role type.
Definition: mdi.c:102
int MDI_Init_with_options(const char *options)
Initialize communication through the MDI library.
Definition: mdi.c:241
int MDI_Set_execute_command_func(int(*generic_command)(const char *, MDI_Comm, void *), void *class_object)
Set the callback MDI uses for MDI_Execute_Command.
Definition: mdi.c:2220
int MDI_Set_Mpi4py_Split_Callback(int(*mpi4py_split)(int, int, MDI_Comm, int))
Set the callback MDI uses for MPI_Split when using mpi4py.
Definition: mdi.c:2504
int MDI_Get_role(int *role)
Get the role of the code.
Definition: mdi.c:960
const int MDI_TEST
Test communication method.
Definition: mdi.c:96
int(*)(void *, MDI_Comm, void *) MDI_Get_language_execute_command(MDI_Comm comm)
Get the language execute_command function needed by a language wrapper.
Definition: mdi.c:2665
int MDI_Plugin_get_arg(int index, char **arg_ptr)
Get a specific element from plugin_argv.
Definition: mdi.c:2377
int MDI_Get_NCallbacks(const char *node_name, MDI_Comm comm, int *ncallbacks)
Get the number of callbacks on a specified node on a specified engine.
Definition: mdi.c:1835
int MDI_Conversion_factor(const char *in_unit, const char *out_unit, double *conv)
Determine the conversion factor between two units.
Definition: mdi.c:597
const int MDI_CHAR
character data type
Definition: mdi.c:80
int MDI_Set_Mpi4py_Recv_Callback(int(*mpi4py_recv)(void *, int, int, int, MDI_Comm))
Set the callback MDI uses for MPI_Recv when using mpi4py.
Definition: mdi.c:2420
int MDI_Recv_command(char *buf, MDI_Comm comm)
Receive a command of length MDI_COMMAND_LENGTH through the MDI connection.
Definition: mdi.c:449
int MDI_Register_callback(const char *node_name, const char *callback_name)
Register a callback on a specified node.
Definition: mdi.c:1698
const int MDI_PLUGIN
Library communication method.
Definition: mdi.c:94
const int MDI_MAJOR_VERSION
MDI major version number.
Definition: mdi.c:38
int MDI_Set_Mpi4py_Gather_Names_Callback(int(*mpi4py_gather_names)(void *, void *, int *, int *))
Set the callback MDI uses for gathering code names when using mpi4py.
Definition: mdi.c:2483
const int MDI_PATCH_VERSION
MDI patch version number.
Definition: mdi.c:44
void mdi_error(const char *message)
Print error message.
Definition: mdi_global.c:799
int MDI_Check_Command_Exists(const char *node_name, const char *command_name, MDI_Comm comm, int *flag)
Check whether a command is supported on specified node on a specified engine.
Definition: mdi.c:1400
int MDI_Set_on_destroy_code(int(*func)(int))
Set the language-based callback for when a code is destroyed.
Definition: mdi.c:2289
const int MDI_INT
integer data type
Definition: mdi.c:60
int MDI_Send_Command(const char *buf, MDI_Comm comm)
Send a command of length MDI_COMMAND_LENGTH through the MDI connection.
Definition: mdi.c:388
const int MDI_FLOAT
single precision float data type
Definition: mdi.c:82
int MDI_Register_command(const char *node_name, const char *command_name)
Register a command on a specified node.
Definition: mdi.c:1368
const int MDI_MINOR_VERSION
MDI minor version number.
Definition: mdi.c:41
const int MDI_UINT16_T
uint16_t data type
Definition: mdi.c:72
int MDI_Set_Mpi4py_Barrier_Callback(int(*mpi4py_barrier)(int))
Set the callback MDI uses for MPI_Barrier when using mpi4py.
Definition: mdi.c:2566
int MDI_Get_nnodes(MDI_Comm comm, int *nnodes)
Get the number of nodes on a specified engine.
Definition: mdi.c:1241
MDI_Driver_node_callback_f90_t MDI_Get_language_driver_callback()
Get the language driver callback needed by a language wrapper.
Definition: mdi.c:2686
int MDI_Get_command(const char *node_name, int index, MDI_Comm comm, char *name)
Get the name of a command on a specified node on a specified engine.
Definition: mdi.c:1614
int MDI_Accept_communicator(MDI_Comm *comm)
Accept a new MDI communicator.
Definition: mdi.c:292
void MDI_Set_World_Size(int world_size_in)
Set the size of MPI_COMM_WORLD.
Definition: mdi.c:1060
int MDI_Check_Callback_Exists(const char *node_name, const char *callback_name, MDI_Comm comm, int *flag)
Check whether a callback exists on specified node on a specified engine.
Definition: mdi.c:1729
void MDI_Set_World_Rank(int world_rank_in)
Set the rank of this process within MPI_COMM_WORLD.
Definition: mdi.c:1071
const int MDI_UINT64_T
uint64_t data type
Definition: mdi.c:76
int MDI_Set_Mpi4py_Rank_Callback(int(*mpi4py_rank)(int))
Set the callback MDI uses for MPI_Comm_rank when using mpi4py.
Definition: mdi.c:2525
int MDI_Open_plugin(const char *plugin_name, const char *options, void *mpi_comm_ptr, MDI_Comm *mdi_comm_ptr)
Open an MDI plugin instance in the background.
Definition: mdi.c:2164
const int MDI_MPI
MPI communication method.
Definition: mdi.c:90