⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 localmpi.h

📁 Path MPICH-V for MPICH the MPI Implementation
💻 H
字号:
/** @file localmpi.h define connection and communication method between daemon and local mpi process */#ifndef LOCALMPI_H#define LOCALMPI_H#include "config.h"#include "debug.h"#include "flitvec.h"/** Clean the pipe if they already exist to avoid the daemon and *  the driver to work on two different set of pipes with the same *  name * @param group: group of the MPI process * @param rank  : rank of the MPI process */void localMPI_regeneratePipes(int group, int rank);/** Suppress the pipe if they exists * @param group : group of the MPI process * @param rank  : rank of the MPI process */void localMPI_removePipes(int group, int rank);/** Opens the pipe used to write to the driver * WARNING: can block! * (POSIX: For opening a pipe for writing only, the pipe must *  exists and a process must have opened it for reading) * Waits for the pipe to exists, and then open it O_WRONLY: block * until the driver has opened its side for writing. * As a consequence, MUST be called after forking the driver. * * @param group : group of the MPI process * @param rank  : rank of the MPI process * @return a fd suitable for writing */int localMPI_OpenWriteToDriver(int group, int rank);/** Creates then opens the pipe used to read from the driver * For the same reason than above: MUST BE CALLED before forking the driver  * @param group : group of the MPI process * @param rank  : rank of the MPI process * @return a fd suitable for reading */int localMPI_OpenReadFromDriver(int group, int rank);/** Return a malloced string containing the base name of the pipes associated to this MPI process * @param group : group of the MPI process * @param rank : rank of the MPI process * @return a malloced string containing the name (should be free() after use) */char* localMPI_PipeBaseName(int group, int rank);/** set the command line for spawning the MPI process * @param argc [IN/OUT] : number of arguments including argv[0] * @param argv [IN/OUT] : arguments * @param g: group of MPI process * @param r: rank of MPI process * @param np: size of MPI world * @param debug: level of debug information * * @return <0 if error, 0 if ok */int localMPI_setCommand(int *argc, char ***argv, int g, int r, int np, char *debug);/** daemon deliver a message to the local mpi process; *  Com Daemon --> local MPI process *  Current implementation: synchronous send *  This function frees the memory associated to this pkt. * @param pkt : * @return void */void on_writeback (pkt_header * pkt);/** when local mpi process request something to daemon * @return void */void on_request();/** when everybody is ok to finalize : release the driver * @return void */void release_driver();/** received a full mpi message from other daemon * @param buf : complete message of other daemon * @return void */void on_receive(char *buf);#endif /* LOCALMPI_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -