Molssi Driver Interface Library
Functions
mdi_test.h File Reference

Dummy communication implementation for testing purposes. More...

#include "mdi.h"

Go to the source code of this file.

Functions

int enable_test_support (int code_id)
 Enable support for the TEST method.
 
int test_on_selection ()
 Callback when the end-user selects TCP as the method.
 
int test_on_accept_communicator ()
 Callback when the TEST method must accept a communicator.
 
int test_on_send_command (const char *command, MDI_Comm comm, int *skip_flag)
 Callback when the TEST method must send a command.
 
int test_after_send_command (const char *command, MDI_Comm comm)
 Callback after the TEST method has received a command.
 
int test_on_recv_command (MDI_Comm comm)
 Callback when the TEST method must receive a command.
 
int test_initialize ()
 Perform initialization of a dummy communicator for testing purposes. More...
 
int test_send (const void *buf, int count, MDI_Datatype datatype, MDI_Comm comm, int msg_flag)
 Dummy function to handle sending data through an MDI connection, for testing purposes. More...
 
int test_recv (void *buf, int count, MDI_Datatype datatype, MDI_Comm comm, int msg_flag)
 Dummy function to handle receiving data through an MDI connection, for testing purposes. More...
 

Detailed Description

Dummy communication implementation for testing purposes.

Function Documentation

◆ test_initialize()

int test_initialize ( )

Perform initialization of a dummy communicator for testing purposes.

◆ test_recv()

int test_recv ( void *  buf,
int  count,
MDI_Datatype  datatype,
MDI_Comm  comm,
int  msg_flag 
)

Dummy function to handle receiving data through an MDI connection, for testing purposes.

Parameters
[in]bufPointer to the buffer where the received data will be stored.
[in]countNumber of values (integers, double precision floats, characters, etc.) to be received.
[in]datatypeMDI handle (MDI_INT, MDI_DOUBLE, MDI_CHAR, etc.) corresponding to the type of data to be received.
[in]commMDI communicator associated with the connection to the sending code.
[in]msg_flagType of role this data has within a message. 0: Not part of a message. 1: The header of a message. 2: The body (data) of a message.

◆ test_send()

int test_send ( const void *  buf,
int  count,
MDI_Datatype  datatype,
MDI_Comm  comm,
int  msg_flag 
)

Dummy function to handle sending data through an MDI connection, for testing purposes.

Parameters
[in]bufPointer to the data to be sent.
[in]countNumber of values (integers, double precision floats, characters, etc.) to be sent.
[in]datatypeMDI handle (MDI_INT, MDI_DOUBLE, MDI_CHAR, etc.) corresponding to the type of data to be sent.
[in]commMDI communicator associated with the intended recipient code.
[in]msg_flagType of role this data has within a message. 0: Not part of a message. 1: The header of a message. 2: The body (data) of a message.