Molssi Driver Interface Library
mdi_mpi.h
Go to the documentation of this file.
1 
6 #ifndef MDI_MPI_IMPL
7 #define MDI_MPI_IMPL
8 
9 #include <mpi.h>
10 #include "mdi.h"
11 
12 typedef struct mpi_data_struct {
14  MPI_Comm mpi_comm;
16  int mpi_rank;
20 
21 int set_world_size(int world_size_in);
22 int set_world_rank(int world_rank_in);
23 
24 int enable_mpi_support();
25 int mpi_on_selection();
27 int mpi_on_send_command(const char* command, MDI_Comm comm, int* skip_flag);
28 int mpi_after_send_command(const char* command, MDI_Comm comm);
29 int mpi_on_recv_command(MDI_Comm comm);
30 
31 int mpi_identify_codes(const char* code_name, int use_mpi4py, MPI_Comm world_comm);
32 int mpi_update_world_comm(void* world_comm);
33 int mpi_send_msg(const void* buf, int count, MDI_Datatype datatype, MDI_Comm comm);
34 int mpi_recv_msg(void* buf, int count, MDI_Datatype datatype, MDI_Comm comm);
35 int mpi_send(const void* buf, int count, MDI_Datatype datatype, MDI_Comm comm, int msg_flag);
36 int mpi_recv(void* buf, int count, MDI_Datatype datatype, MDI_Comm comm, int msg_flag);
37 
38 int communicator_delete_mpi(void* comm);
39 
40 #endif
set_world_size
int set_world_size(int world_size_in)
Set the size of MPI_COMM_WORLD.
Definition: mdi_mpi.c:21
mpi_on_send_command
int mpi_on_send_command(const char *command, MDI_Comm comm, int *skip_flag)
Callback when the MPI method must send a command.
Definition: mdi_mpi.c:162
mpi_send
int mpi_send(const void *buf, int count, MDI_Datatype datatype, MDI_Comm comm, int msg_flag)
Send data through an MDI connection, using MPI.
Definition: mdi_mpi.c:435
mpi_data_struct
Definition: mdi_mpi.h:12
mpi_data_struct::mpi_rank
int mpi_rank
The rank of this process within the inter-code MPI communicator.
Definition: mdi_mpi.h:16
communicator_delete_mpi
int communicator_delete_mpi(void *comm)
Function for MPI-specific deletion operations for communicator deletion.
Definition: mdi_mpi.c:511
mpi_on_selection
int mpi_on_selection()
Callback when the end-user selects MPI as the method.
Definition: mdi_mpi.c:52
mpi_data_struct::mpi_comm
MPI_Comm mpi_comm
Inter-code MPI communicator.
Definition: mdi_mpi.h:14
mpi_update_world_comm
int mpi_update_world_comm(void *world_comm)
Update a pointer to MPI_COMM_WORLD to instead point to the intra-code MPI communicator.
Definition: mdi_mpi.c:411
mpi_after_send_command
int mpi_after_send_command(const char *command, MDI_Comm comm)
Callback after the MPI method has received a command.
Definition: mdi_mpi.c:169
mpi_on_accept_communicator
int mpi_on_accept_communicator()
Callback when the MPI method must accept a communicator.
Definition: mdi_mpi.c:146
set_world_rank
int set_world_rank(int world_rank_in)
Set the rank of this process in MPI_COMM_WORLD.
Definition: mdi_mpi.c:32
mpi_recv
int mpi_recv(void *buf, int count, MDI_Datatype datatype, MDI_Comm comm, int msg_flag)
Receive data through an MDI connection, using MPI.
Definition: mdi_mpi.c:480
mpi_identify_codes
int mpi_identify_codes(const char *code_name, int use_mpi4py, MPI_Comm world_comm)
Identify groups of processes belonging to the same codes.
Definition: mdi_mpi.c:210
mpi_on_recv_command
int mpi_on_recv_command(MDI_Comm comm)
Callback when the MPI method must receive a command.
Definition: mdi_mpi.c:190
mpi_data_struct::use_mpi4py
int use_mpi4py
Flag whether to use mpi4py instead of the linked MPI library.
Definition: mdi_mpi.h:18
enable_mpi_support
int enable_mpi_support()
Enable support for the TCP method.
Definition: mdi_mpi.c:39