Molssi Driver Interface Library
mdi.h
1 /* ----------------------------------------------------------------------
2  MDI - MolSSI Driver Interface
3  https://molssi.org/, Molecular Sciences Software Institute
4  Taylor Barnes, tbarnes1@vt.edu
5 -------------------------------------------------------------------------
6 
7 Contents:
8  MDI_Init: Initializes a socket and sets it to listen
9  MDI_Accept_Communicator: Accepts a new MDI communicator
10  MDI_Send: Sends data through the socket
11  MDI_Recv: Receives data from the socket
12  MDI_Send_Command: Sends a string of length MDI_COMMAND_LENGTH over the
13  socket
14  MDI_Recv_Command: Receives a string of length MDI_COMMAND_LENGTH over the
15  socket
16 */
17 
18 #ifndef MDI_LIBRARY
19 #define MDI_LIBRARY
20 
21 #ifdef __cplusplus
22 //namespace MDI_STUBS { }
23 extern "C" {
24 #endif
25 
26 // ensure that symbols are exported to Windows .dll files
27 #ifdef _WIN32
28  #define DllExport __declspec( dllexport )
29 #else
30  #define DllExport
31 #endif
32 
33 // type of an MDI communicator handle
34 typedef int MDI_Comm;
35 
36 // type of an MDI datatype handle
37 typedef int MDI_Datatype;
38 
39 typedef int (*MDI_Driver_node_callback_t)(void*, int, void*);
40 typedef int (*MDI_Driver_node_callback_f90_t)(void*);
41 
42 // MDI version numbers
43 DllExport extern const int MDI_MAJOR_VERSION;
44 DllExport extern const int MDI_MINOR_VERSION;
45 DllExport extern const int MDI_PATCH_VERSION;
46 
47 // length of an MDI command in characters
48 DllExport extern const int MDI_COMMAND_LENGTH;
49 
50 // length of an MDI name in characters
51 DllExport extern const int MDI_NAME_LENGTH;
52 
53 // length of an MDI label in characters
54 DllExport extern const int MDI_LABEL_LENGTH;
55 
56 // value of a null communicator
57 DllExport extern const MDI_Comm MDI_COMM_NULL;
58 
59 // MDI data types
60 DllExport extern const int MDI_INT;
61 DllExport extern const int MDI_INT8_T;
62 DllExport extern const int MDI_INT16_T;
63 DllExport extern const int MDI_INT32_T;
64 DllExport extern const int MDI_INT64_T;
65 DllExport extern const int MDI_UINT8_T;
66 DllExport extern const int MDI_UINT16_T;
67 DllExport extern const int MDI_UINT32_T;
68 DllExport extern const int MDI_UINT64_T;
69 DllExport extern const int MDI_DOUBLE;
70 DllExport extern const int MDI_CHAR;
71 DllExport extern const int MDI_FLOAT;
72 DllExport extern const int MDI_BYTE;
73 
74 // MDI communication types
75 DllExport extern const int MDI_TCP;
76 DllExport extern const int MDI_MPI;
77 DllExport extern const int MDI_LINK;
78 DllExport extern const int MDI_PLUGIN;
79 DllExport extern const int MDI_TEST;
80 
81 // MDI role types
82 DllExport extern const int MDI_DRIVER;
83 DllExport extern const int MDI_ENGINE;
84 
85 // functions for handling MDI communication
86 DllExport int MDI_Init(int* argc, char ***argv);
87 DllExport int MDI_Initialized(int* flag);
88 DllExport int MDI_Accept_Communicator(MDI_Comm* comm);
89 DllExport int MDI_Accept_communicator(MDI_Comm* comm);
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);
92 DllExport int MDI_Send_Command(const char* buf, MDI_Comm comm);
93 DllExport int MDI_Send_command(const char* buf, MDI_Comm comm);
94 DllExport int MDI_Recv_Command(char* buf, MDI_Comm comm);
95 DllExport int MDI_Recv_command(char* buf, MDI_Comm comm);
96 DllExport int MDI_Conversion_Factor(const char* in_unit, const char* out_unit, double* conv);
97 DllExport int MDI_Conversion_factor(const char* in_unit, const char* out_unit, double* conv);
98 DllExport int MDI_Get_Role(int* role);
99 DllExport int MDI_Get_role(int* role);
100 DllExport int MDI_Get_method(int* role, MDI_Comm comm);
101 DllExport int MDI_Get_communicator(MDI_Comm* comm, int index);
102 DllExport int MDI_String_to_atomic_number(const char* element_symbol, int* atomic_number);
103 
104 // functions for managing Nodes, Commands, and Callbacks
105 DllExport int MDI_Register_Node(const char* node_name);
106 DllExport int MDI_Register_node(const char* node_name);
107 DllExport int MDI_Check_Node_Exists(const char* node_name, MDI_Comm comm, int* flag);
108 DllExport int MDI_Check_node_exists(const char* node_name, MDI_Comm comm, int* flag);
109 DllExport int MDI_Get_NNodes(MDI_Comm comm, int* nnodes);
110 DllExport int MDI_Get_nnodes(MDI_Comm comm, int* nnodes);
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);
113 DllExport int MDI_Register_Command(const char* node_name, const char* command_name);
114 DllExport int MDI_Register_command(const char* node_name, const char* command_name);
115 DllExport int MDI_Check_Command_Exists(const char* node_name, const char* command_name, MDI_Comm comm, int* flag);
116 DllExport int MDI_Check_command_exists(const char* node_name, const char* command_name, MDI_Comm comm, int* flag);
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);
121 DllExport int MDI_Register_Callback(const char* node_name, const char* callback_name);
122 DllExport int MDI_Register_callback(const char* node_name, const char* callback_name);
123 DllExport int MDI_Check_Callback_Exists(const char* node_name, const char* callback_name, MDI_Comm comm, int* flag);
124 DllExport int MDI_Check_callback_exists(const char* node_name, const char* callback_name, MDI_Comm comm, int* flag);
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);
129 
130 // functions for handling MPI in combination with MDI
131 DllExport int MDI_MPI_get_world_comm(void* world_comm);
132 DllExport int MDI_MPI_set_world_comm(void* world_comm);
133 
134 // functions for managing callback functions (used only with the LINK communication method)
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);
139 DllExport int MDI_Close_plugin(MDI_Comm mdi_comm);
140 DllExport int MDI_Set_Execute_Command_Func(int (*generic_command)(const char*, MDI_Comm, void*), void* class_object);
141 DllExport int MDI_Set_execute_command_func(int (*generic_command)(const char*, MDI_Comm, void*), void* class_object);
142 DllExport int MDI_Set_plugin_state(void* state);
143 DllExport int MDI_Set_plugin_state_internal(void* state);
144 DllExport int MDI_Plugin_get_argc(int* argc_ptr);
145 DllExport int MDI_Plugin_get_argv(char*** argv_ptr);
146 DllExport int MDI_Plugin_get_args(char** args_ptr);
147 DllExport int MDI_Plugin_get_arg(int index, char** arg_ptr);
148 
149 // functions for managing callback functions for mpi4py
150 DllExport int MDI_Set_Mpi4py_Recv_Callback(int (*mpi4py_recv)(void*, int, int, int, MDI_Comm));
151 DllExport int MDI_Set_Mpi4py_Send_Callback(int (*mpi4py_send)(void*, int, int, int, MDI_Comm));
152 DllExport int MDI_Set_Mpi4py_Allgather_Callback(int (*mpi4py_allgather)(void*, void*));
153 DllExport int MDI_Set_Mpi4py_Gather_Names_Callback(int (*mpi4py_gather_names)(void*, void*, int*, int*));
154 DllExport int MDI_Set_Mpi4py_Split_Callback(int (*mpi4py_split)(int, int, MDI_Comm, int));
155 DllExport int MDI_Set_Mpi4py_Rank_Callback(int (*mpi4py_rank)(int));
156 DllExport int MDI_Set_Mpi4py_Size_Callback(int (*mpi4py_size)(int));
157 DllExport int MDI_Set_Mpi4py_Barrier_Callback(int (*mpi4py_barrier)(int));
158 DllExport int MDI_Set_Launch_Plugin_Callback(int (*launch_plugin)(void*, void*, void*, int));
159 
160 // only used internally by MDI
161 DllExport int MDI_Init_code();
162 DllExport int MDI_Init_with_argv(int* argc, char ***argv);
163 DllExport int MDI_Init_with_options(const char *options);
164 DllExport void mdi_error(const char* message);
165 DllExport void MDI_Set_World_Size(int world_size_in);
166 DllExport void MDI_Set_World_Rank(int world_rank_in);
167 DllExport int MDI_Get_intra_rank(int intra_rank_out);
168 DllExport int MDI_Get_Current_Code();
169 DllExport int MDI_Get_python_plugin_mpi_world_ptr(void** python_plugin_mpi_world_ptr_ptr, void* state_in);
170 DllExport int MDI_Set_on_destroy_code(int (*func)(int));
171 DllExport int MDI_Set_plugin_language(int language, void* plugin_state);
172 DllExport int MDI_Set_language_execute_command(int (*execute_command)(void*, MDI_Comm, void*));
173 DllExport int (*MDI_Get_language_execute_command(MDI_Comm comm))(void*, MDI_Comm, void*);
174 DllExport MDI_Driver_node_callback_f90_t MDI_Get_language_driver_callback();
175 DllExport int MDI_Set_language_driver_callback(MDI_Driver_node_callback_f90_t callback);
176 DllExport int MDI_Call_language_driver_callback(void*);
177 
178 #ifdef __cplusplus
179 }
180 #endif
181 
182 #endif
MDI_Set_plugin_language
int MDI_Set_plugin_language(int language, void *plugin_state)
Set the language of an MDI plugin.
Definition: mdi.c:2608
MDI_Check_callback_exists
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
MDI_Check_Node_Exists
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
MDI_MPI_get_world_comm
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
MDI_Get_Current_Code
int MDI_Get_Current_Code()
Get the current code.
Definition: mdi.c:2306
MDI_Get_node
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
MDI_INT8_T
const int MDI_INT8_T
int8_t data type
Definition: mdi.c:62
MDI_Get_Role
int MDI_Get_Role(int *role)
Get the role of the code.
Definition: mdi.c:946
MDI_Initialized
int MDI_Initialized(int *flag)
Indicates whether MDI_Init has been called.
Definition: mdi.c:265
MDI_Set_plugin_state_internal
int MDI_Set_plugin_state_internal(void *state)
Set the language-based callback for when a code is destroyed.
Definition: mdi.c:2279
MDI_COMM_NULL
const MDI_Comm MDI_COMM_NULL
value of a null communicator
Definition: mdi.c:56
MDI_UINT32_T
const int MDI_UINT32_T
uint32_t data type
Definition: mdi.c:74
MDI_Set_Launch_Plugin_Callback
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
MDI_Send
int MDI_Send(const void *buf, int count, MDI_Datatype datatype, MDI_Comm comm)
Send data through the MDI connection.
Definition: mdi.c:326
MDI_LABEL_LENGTH
const int MDI_LABEL_LENGTH
length of an MDI label in characters
Definition: mdi.c:53
MDI_Get_NNodes
int MDI_Get_NNodes(MDI_Comm comm, int *nnodes)
Get the number of nodes on a specified engine.
Definition: mdi.c:1225
MDI_Register_Command
int MDI_Register_Command(const char *node_name, const char *command_name)
Register a command on a specified node.
Definition: mdi.c:1353
MDI_Get_python_plugin_mpi_world_ptr
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
MDI_INT64_T
const int MDI_INT64_T
int64_t data type
Definition: mdi.c:68
MDI_Get_ncallbacks
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
MDI_Set_Mpi4py_Size_Callback
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
MDI_Get_method
int MDI_Get_method(int *method, MDI_Comm comm)
Get the communication method of a communicator.
Definition: mdi.c:997
MDI_DOUBLE
const int MDI_DOUBLE
double precision float data type
Definition: mdi.c:78
MDI_Plugin_get_args
int MDI_Plugin_get_args(char **args_ptr)
Get plugin_unedited_options.
Definition: mdi.c:2356
MDI_Set_Mpi4py_Send_Callback
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
MDI_Plugin_get_argc
int MDI_Plugin_get_argc(int *argc_ptr)
Get plugin_argc.
Definition: mdi.c:2314
MDI_Set_Mpi4py_Allgather_Callback
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
MDI_Call_language_driver_callback
int MDI_Call_language_driver_callback(void *class_obj)
Call the language driver callback needed by a language wrapper.
Definition: mdi.c:2729
MDI_Set_language_driver_callback
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
MDI_UINT8_T
const int MDI_UINT8_T
uint8_t data type
Definition: mdi.c:70
MDI_Get_Node
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
MDI_Set_Execute_Command_Func
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
MDI_Set_language_execute_command
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
MDI_INT16_T
const int MDI_INT16_T
int16_t data type
Definition: mdi.c:64
MDI_Get_intra_rank
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
MDI_Accept_Communicator
int MDI_Accept_Communicator(MDI_Comm *comm)
Accept a new MDI communicator.
Definition: mdi.c:280
MDI_Check_node_exists
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
MDI_Get_NCommands
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
MDI_Get_ncommands
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
MDI_Register_Callback
int MDI_Register_Callback(const char *node_name, const char *callback_name)
Register a callback on a specified node.
Definition: mdi.c:1683
MDI_DRIVER
const int MDI_DRIVER
Driver role type.
Definition: mdi.c:100
MDI_Conversion_Factor
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
MDI_Launch_plugin
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
MDI_Get_Callback
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
MDI_MPI_set_world_comm
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
MDI_Recv_Command
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
MDI_Register_node
int MDI_Register_node(const char *node_name)
Register a node.
Definition: mdi.c:1119
MDI_LINK
const int MDI_LINK
Library communication method (deprecated)
Definition: mdi.c:92
MDI_Plugin_get_argv
int MDI_Plugin_get_argv(char ***argv_ptr)
Get plugin_argv.
Definition: mdi.c:2335
MDI_COMMAND_LENGTH
const int MDI_COMMAND_LENGTH
length of an MDI command in characters
Definition: mdi.c:47
MDI_Init_with_argv
int MDI_Init_with_argv(int *argc, char ***argv)
Initialize communication through the MDI library.
Definition: mdi.c:163
MDI_Get_Command
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
MDI_NAME_LENGTH
const int MDI_NAME_LENGTH
length of an MDI name in characters
Definition: mdi.c:50
MDI_TCP
const int MDI_TCP
TCP/IP communication method.
Definition: mdi.c:88
MDI_Get_callback
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
MDI_Register_Node
int MDI_Register_Node(const char *node_name)
Register a node.
Definition: mdi.c:1106
MDI_Recv
int MDI_Recv(void *buf, int count, MDI_Datatype datatype, MDI_Comm comm)
Receive data through the MDI connection.
Definition: mdi.c:359
MDI_Send_command
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
MDI_BYTE
const int MDI_BYTE
character data type
Definition: mdi.c:84
MDI_Close_plugin
int MDI_Close_plugin(MDI_Comm mdi_comm)
Close an MDI plugin instance.
Definition: mdi.c:2190
MDI_Init
int MDI_Init(int *argc, char ***argv)
Initialize communication through the MDI library.
Definition: mdi.c:115
MDI_Init_code
int MDI_Init_code()
Initialize a code structure for the MDI library.
Definition: mdi.c:211
MDI_Check_command_exists
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
MDI_INT32_T
const int MDI_INT32_T
int32_t data type
Definition: mdi.c:66
MDI_Get_communicator
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
MDI_ENGINE
const int MDI_ENGINE
Engine role type.
Definition: mdi.c:102
MDI_Init_with_options
int MDI_Init_with_options(const char *options)
Initialize communication through the MDI library.
Definition: mdi.c:241
MDI_Set_execute_command_func
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
MDI_Set_Mpi4py_Split_Callback
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
MDI_Get_role
int MDI_Get_role(int *role)
Get the role of the code.
Definition: mdi.c:960
MDI_TEST
const int MDI_TEST
Test communication method.
Definition: mdi.c:96
MDI_Get_language_execute_command
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
MDI_Plugin_get_arg
int MDI_Plugin_get_arg(int index, char **arg_ptr)
Get a specific element from plugin_argv.
Definition: mdi.c:2377
MDI_Get_NCallbacks
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
MDI_Conversion_factor
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
MDI_CHAR
const int MDI_CHAR
character data type
Definition: mdi.c:80
MDI_Set_Mpi4py_Recv_Callback
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
MDI_Recv_command
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
MDI_Register_callback
int MDI_Register_callback(const char *node_name, const char *callback_name)
Register a callback on a specified node.
Definition: mdi.c:1698
MDI_PLUGIN
const int MDI_PLUGIN
Library communication method.
Definition: mdi.c:94
MDI_MAJOR_VERSION
const int MDI_MAJOR_VERSION
MDI major version number.
Definition: mdi.c:38
MDI_Set_Mpi4py_Gather_Names_Callback
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
MDI_PATCH_VERSION
const int MDI_PATCH_VERSION
MDI patch version number.
Definition: mdi.c:44
mdi_error
void mdi_error(const char *message)
Print error message.
Definition: mdi_global.c:799
MDI_Check_Command_Exists
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
MDI_Set_on_destroy_code
int MDI_Set_on_destroy_code(int(*func)(int))
Set the language-based callback for when a code is destroyed.
Definition: mdi.c:2289
MDI_INT
const int MDI_INT
integer data type
Definition: mdi.c:60
MDI_Send_Command
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
MDI_FLOAT
const int MDI_FLOAT
single precision float data type
Definition: mdi.c:82
MDI_Register_command
int MDI_Register_command(const char *node_name, const char *command_name)
Register a command on a specified node.
Definition: mdi.c:1368
MDI_MINOR_VERSION
const int MDI_MINOR_VERSION
MDI minor version number.
Definition: mdi.c:41
MDI_UINT16_T
const int MDI_UINT16_T
uint16_t data type
Definition: mdi.c:72
MDI_Set_Mpi4py_Barrier_Callback
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
MDI_Get_nnodes
int MDI_Get_nnodes(MDI_Comm comm, int *nnodes)
Get the number of nodes on a specified engine.
Definition: mdi.c:1241
MDI_Get_language_driver_callback
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
MDI_Get_command
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
MDI_Accept_communicator
int MDI_Accept_communicator(MDI_Comm *comm)
Accept a new MDI communicator.
Definition: mdi.c:292
MDI_Set_World_Size
void MDI_Set_World_Size(int world_size_in)
Set the size of MPI_COMM_WORLD.
Definition: mdi.c:1060
MDI_Check_Callback_Exists
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
MDI_Set_World_Rank
void MDI_Set_World_Rank(int world_rank_in)
Set the rank of this process within MPI_COMM_WORLD.
Definition: mdi.c:1071
MDI_UINT64_T
const int MDI_UINT64_T
uint64_t data type
Definition: mdi.c:76
MDI_Set_Mpi4py_Rank_Callback
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
MDI_Open_plugin
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
MDI_MPI
const int MDI_MPI
MPI communication method.
Definition: mdi.c:90