📄 ftp_dcom.h
字号:
/** @file ftp_dcom.h defines the API for communication between daemons implied in the fault tolerant protocol */#ifndef FTP_DCOM_H#define FTP_DCOM_H#include "debug.h"#include "config.h"#include "connect.h"#include "vtypes.h"#include "flitvec.h"/** Initializes the fault tolerant protocol * @param sizeofmpipeer : number of mpi processes * @param rank: rank of the mpi process * @return void */#ifndef ftp_initvoid ftp_init(int sizeofmpipeer, int rank);#endif/** Finalizes the fault tolerant protocol * @return void */#ifndef ftp_finalizevoid ftp_finalize(void);#endif/** test if in replay and replay one probe in this case * remember the probe in the other case * @param rep : a pkt_header to answer to local mpi process * @return * - 0 if not in replay * - 1 if replaying one probe */#ifndef ftp_probeSaveOrReplayint ftp_probeSaveOrReplay(pkt_header *rep);#endif/** replay message reception if in restart mode * @param tag: the tag of the message to replay * @return * - 1 : in restart mode, replaying * - 0 : not in restart mode, nothing done */#ifndef ftp_readReplayint ftp_readReplay(int tag);#endif/** saves the message reception for further replay * @param pkt: the message to save */#ifndef ftp_readSavevoid ftp_readSave(pkt_header *pkt);#endif/** defines the starting state just after the connection * is successfull (define to CO_DONE if nothing to exchange * before communication phase). You can use any value different * from CO_DONE for handling your own connection automata. * @param : 0 if accepting connection, 1 if connecting to someone * @return connection state */#ifndef ftp_connection_starting_stateint ftp_connection_starting_state(int);#endif/** Called when something to read during connection phase * to stop connection phase and begin communication phase, * set mpipeer[rank].hstate to CO_DONE * @param mpipeer : tab of all peer socket infos * @param rank : rank of the local mpi process * @param h : clock of the daemon * @return <0 on error, 0 on success */#ifndef ftp_connection_readint ftp_connection_read(SockInfo mpipeer[], int rank);#endif/** Called when something to write during connection phase * to stop connection phase and begin communication phase, * set mpipeer[rank].hstate to CO_DONE * @param mpipeer : tab of all peer socket infos * @param rank : rank of the local mpi process * @return <0 on error, 0 on success */#ifndef ftp_connection_writeint ftp_connection_write(SockInfo mpipeer[], int rank);#endif/** handles new outgoing messages * @param pkt: the header of the message to handle * @mpi_data: the original MPI message * called by on_write in localmpi.c * must do the effective sending (or schedule it) */#ifndef ftp_newOutgoingMessagevoid ftp_newOutgoingMessage(pkt_header *pkt);#endif/** builds a new flitvec from a pkt_header to received message * @param pkt: the pkt header * @return a new flitvec describing the thing to receive */#ifndef ftp_create_newfvflitvec *ftp_create_newfv( pkt_header *pkt );#endif/** Called when a process has disconnected, after the clean of buffer and socket to this process. * @param mpipeer : tab of all peer socket infos * @param rank : rank of the local mpi process */#ifndef ftp_on_disconnectvoid ftp_on_disconnect(SockInfo mpipeer[], int rank);#endif/** called when mpi process send a message to itself * @param pkt: the header of the message to handle */#ifndef ftp_on_soliloquize_sendvoid ftp_on_soliloquize_send(pkt_header *pkt);#endif/** called to check if daemon is allowed to receive messages * from rank i (when possible) * @param mpipeer : tab of all peer socket infos * @param i : rank of process * @return !=0 if reception is allowed */#ifndef ftp_msgrecv_possibleint ftp_msgrecv_possible(SockInfo mpipeer[], int i);#endif/** called to check if protocol message have to be sent to process 'rank' * @param mpipeer : tab of all peer socket infos * @param rank : rank of process * @return 0 if no protocol message (reconnection ones) have to be sent for process 'rank' * 1 else */#ifndef ftp_msgsend_neededint ftp_msgsend_needed(SockInfo mpipeer[], int rank);#endif#endif /* DAEMONCOM_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -