| |
Molssi Driver Interface Library
|
Go to the documentation of this file.
6 #ifndef MDI_LIBRARY_IMPL
7 #define MDI_LIBRARY_IMPL
12 typedef int (*MDI_Plugin_init_t)(
void* shared_state );
130 MDI_Driver_node_callback_t driver_node_callback,
131 void* driver_callback_object);
133 MDI_Comm* mdi_comm_ptr);
134 int library_close_plugin(MDI_Comm mdi_comm);
139 int library_send(
const void* buf,
int count, MDI_Datatype datatype, MDI_Comm comm,
int msg_flag);
140 int library_recv(
void* buf,
int count, MDI_Datatype datatype, MDI_Comm comm,
int msg_flag);
141 int library_send_msg(
const void* buf,
int count, MDI_Datatype datatype, MDI_Comm comm);
142 int library_recv_msg(
void* buf,
int count, MDI_Datatype datatype, MDI_Comm comm);
MDI_Driver_node_callback_t driver_node_callback
Function pointer to the driver node's callback function.
Definition: mdi_lib.h:105
int(* lib_execute_command)(MDI_Comm)
Function pointer to the library execute command function.
Definition: mdi_lib.h:60
MDI_Comm engine_mdi_comm
Engine-side MDI communicator.
Definition: mdi_lib.h:78
void * execute_command_obj
Pointer to the class object that is passed to any call to execute_command.
Definition: mdi_lib.h:45
int plugin_argc
Argument count for plugin command-line options.
Definition: mdi_lib.h:82
int library_set_command(const char *command, MDI_Comm comm)
Set the next command that will be executed through the library communicator.
Definition: mdi_lib.c:971
MDI_Comm driver_mdi_comm
Driver-side MDI communicator.
Definition: mdi_lib.h:76
int(* delete_engine)(size_t)
Function pointer to the engine's function to delete everything.
Definition: mdi_lib.h:66
void * buf
Buffer used for communication of data.
Definition: mdi_lib.h:33
int plug_on_send_command(const char *command, MDI_Comm comm, int *skip_flag)
Callback when the PLUG method must send a command.
Definition: mdi_lib.c:111
int library_delete_engine(size_t code_id)
Function to delete all of the engine's state.
Definition: mdi_lib.c:1403
int library_execute_command(MDI_Comm comm)
Execute a command through a communicator.
Definition: mdi_lib.c:1013
size_t driver_code_id
Driver-side ID of the driver code.
Definition: mdi_lib.h:70
int library_set_driver_current(MDI_Comm comm)
Set the driver as the current code.
Definition: mdi_lib.c:930
int connected_code
Handle of the code to which this communicator connects.
Definition: mdi_lib.h:97
MDI_Driver_node_callback_t driver_node_callback
Function pointer to the driver node's callback function.
Definition: mdi_lib.h:74
Global structures used by MDI.
int python_interpreter_initialized
Flag whether the Python interpreter has been initialized.
Definition: mdi_lib.h:90
int library_send(const void *buf, int count, MDI_Datatype datatype, MDI_Comm comm, int msg_flag)
Function to handle sending data through an MDI connection, using library-based communication.
Definition: mdi_lib.c:1074
int plug_on_selection()
Callback when the end-user selects PLUG as the method.
Definition: mdi_lib.c:50
void * driver_callback_obj
Pointer to the class object that is used for the driver_node_callback function.
Definition: mdi_lib.h:43
char command[MDI_COMMAND_LENGTH_]
Name of the next command to be executed on this code. This is only used by engines.
Definition: mdi_lib.h:25
void * engine_nodes
Pointer to the engine's nodes vector.
Definition: mdi_lib.h:54
int communicator_delete_lib(void *comm)
Function for LIBRARY-specific deletion operations for communicator deletion.
Definition: mdi_lib.c:1308
MDI_execute_command_type execute_command
Pointer to engine's execute_command function.
Definition: mdi_lib.h:72
int buf_allocated
Flag whether buf is allocated.
Definition: mdi_lib.h:80
char * plugin_unedited_options
Unedited command-line options for currently running plugin.
Definition: mdi_lib.h:39
int plug_on_recv_command(MDI_Comm comm)
Callback when the PLUG method must receive a command.
Definition: mdi_lib.c:222
int is_python
Flag whether this communicator connects to a Python library.
Definition: mdi_lib.h:116
int engine_version[3]
Version number of the engine.
Definition: mdi_lib.h:31
int library_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.
Definition: mdi_lib.c:512
int(* execute_builtin)(const char *, MDI_Comm_Type, int *)
Function pointer to the engine's function for responding to built-in commands.
Definition: mdi_lib.h:64
size_t engine_code_id
Engine-side ID of the engine code.
Definition: mdi_lib.h:68
int library_open_plugin(const char *plugin_name, const char *options, void *mpi_comm_ptr, MDI_Comm *mdi_comm_ptr)
Open an MDI plugin in the background.
Definition: mdi_lib.c:664
int(* driver_activate_code)(void *, int)
Function pointer to the driver's library_activate_code function.
Definition: mdi_lib.h:56
MDI_Plugin_init_t plugin_init
Initialization function for the plugin library.
Definition: mdi_lib.h:114
void ** ext
For future-proofing, this is a pointer to any extensions to this structure.
Definition: mdi_lib.h:27
void * python_interpreter_dict
Pointer to the original Python interpreter's dictionary. Only used for Python plugins.
Definition: mdi_lib.h:48
int enable_plug_support(int code_id)
Enable support for the PLUG method.
Definition: mdi_lib.c:25
int engine_language
Flag whether the engine is a Python code.
Definition: mdi_lib.h:88
int plugin_argv_allocated
Flag whether plugin_argv is allocted for this code.
Definition: mdi_lib.h:84
char * plugin_options
Command-line options for currently running plugin.
Definition: mdi_lib.h:37
char ** plugin_argv
Argument vector for plugin command-line options.
Definition: mdi_lib.h:35
int(* engine_activate_code)(void *, int)
Function pointer to the engine's library_activate_code function.
Definition: mdi_lib.h:58
int library_load_init(const char *plugin_name, void *mpi_comm_ptr, library_data *libd, int mode)
Load the initialization function for a plugin.
Definition: mdi_lib.c:287
plugin_shared_state * shared_state
State shared between the driver and the plugin.
Definition: mdi_lib.h:95
void * engine_codes_ptr
Pointer to the engine's codes vector.
Definition: mdi_lib.h:52
int library_activate_code(void *codes_in, int code_id)
Function to set the active code.
Definition: mdi_lib.c:1454
int plug_on_accept_communicator()
Callback when the PLUG method must accept a communicator.
Definition: mdi_lib.c:72
void * driver_codes_ptr
Pointer to the driver's codes vector.
Definition: mdi_lib.h:50
int library_recv(void *buf, int count, MDI_Datatype datatype, MDI_Comm comm, int msg_flag)
Function to handle receiving data through an MDI connection, using library-based communication.
Definition: mdi_lib.c:1214
int(* execute_command_wrapper)(const char *, MDI_Comm_Type, void *)
Function pointer to a wrapper for the language-specific execute command function.
Definition: mdi_lib.h:62
int intra_rank
MPI rank of this process within the plugin
Definition: mdi_lib.h:86
MPI_Comm mpi_comm
MPI intra-communicator for the engine.
Definition: mdi_lib.h:101
void * mpi_comm_ptr
Pointer to the intra-communicator for the plugin.
Definition: mdi_lib.h:41
int execute_on_send
Flag whether the next MDI_Send call should trigger execution of the engine's command.
Definition: mdi_lib.h:99
int library_initialize()
Perform initialization of a communicator for library-based communication.
Definition: mdi_lib.c:826
void * plugin_handle
Non-windows handle for the plugin library.
Definition: mdi_lib.h:111
int library_set_state(void *state)
Function to set the plugin's state.
Definition: mdi_lib.c:1424
int driver_version[3]
Version number of the driver.
Definition: mdi_lib.h:29
void * driver_callback_obj
Pointer to the class object that is used for the driver_node_callback function.
Definition: mdi_lib.h:103
int plug_after_send_command(const char *command, MDI_Comm comm)
Callback after the PLUG method has received a command.
Definition: mdi_lib.c:215
int library_parse_options(const char *options, library_data *libd)
Parse command-line plugin options.
Definition: mdi_lib.c:418