Fault Tolerance Interface
stage.h
Go to the documentation of this file.
1 
42 #ifndef _STAGE_H_
43 #define _STAGE_H_
44 
45 // 1 bit field
46 #define FTI_SI_NAVL 0x1
47 #define FTI_SI_IAVL 0x0
48 
49 #define FTI_SI_IALL 0x1
50 #define FTI_SI_NALL 0x0
51 
52 #define FTI_SI_APTR( ptr ) ((FTIT_StageAppInfo*)ptr)
53 #define FTI_SI_HPTR( ptr ) ((FTIT_StageHeadInfo*)ptr)
54 
55 #define FTI_SI_MAX_ID (0x7ffff)
56 
57 #define FTI_DISABLE_STAGING do{*enableStagingPtr = false;} while(0)
58 #define FTI_SI_ENABLED (*(bool*)enableStagingPtr)
59 
66 typedef enum {
70 
77 typedef enum {
81 
85 typedef struct FTIT_StageHeadInfo {
86  char lpath[FTI_BUFS];
87  char rpath[FTI_BUFS];
88  size_t offset;
89  size_t size;
90  int ID;
92 
96 typedef struct FTIT_StageAppInfo {
97  void *sendBuf;
98  MPI_Request mpiReq;
99  int ID;
101 
102 
103 int FTI_GetRequestID( FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo );
104 int FTI_InitStage( FTIT_execution *FTI_Exec, FTIT_configuration *FTI_Conf, FTIT_topology *FTI_Topo );
105 int FTI_InitStageRequestApp( FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, uint32_t ID );
106 int FTI_AsyncStage( char *lpath, char *rpath, FTIT_configuration *FTI_Conf,
107  FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID );
108 int FTI_InitStageRequestHead( char* lpath, char *rpath, FTIT_execution *FTI_Exec,
109  FTIT_topology *FTI_Topo, int source, uint32_t ID );
110 int FTI_SyncStage( char* lpath, char *rpath, FTIT_execution *FTI_Exec,
111  FTIT_topology *FTI_Topo, FTIT_configuration *FTI_Conf, uint32_t ID );
113  FTIT_topology* FTI_Topo, FTIT_checkpoint* FTI_Ckpt, int source);
114 int FTI_GetStatusField( FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID, FTIT_StatusField val, int source );
115 int FTI_SetStatusField( FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID, uint8_t entry, FTIT_StatusField val, int source );
116 int FTI_GetRequestField( int ID, FTIT_RequestField val );
117 int FTI_SetRequestField( int ID, uint32_t entry, FTIT_RequestField val );
118 int FTI_FreeStageRequest( FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID, int source );
119 void FTI_PrintStageStatus( FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID, int source );
120 int FTI_GetRequestIdx( int ID );
121 void FTI_FinalizeStage( FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_configuration *FTI_Conf );
122 
123 #endif
Definition: fti.h:411
int FTI_InitStageRequestApp(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, uint32_t ID)
Initializes new stage meta info element (application rank)
Definition: stage.c:322
int ID
Definition: stage.h:90
size_t offset
Definition: stage.h:88
char lpath[FTI_BUFS]
Definition: stage.h:86
MPI_Request mpiReq
Definition: stage.h:98
Definition: fti.h:365
struct FTIT_StageHeadInfo FTIT_StageHeadInfo
Head rank staging meta info.
int FTI_AsyncStage(char *lpath, char *rpath, FTIT_configuration *FTI_Conf, FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID)
This function triggers the asynchronous stage.
Definition: stage.c:752
int FTI_GetRequestID(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo)
Returns unique 'ID' for staging request.
Definition: stage.c:1211
#define FTI_BUFS
Definition: fti.h:33
int FTI_SetRequestField(int ID, uint32_t entry, FTIT_RequestField val)
Sets value of the 'idxRequest' field array at 'ID'.
Definition: stage.c:1040
Definition: stage.h:85
FTIT_RequestField
valid fields of 'idxRequest'.
Definition: stage.h:77
FTIT_StatusField
valid fields of 'status'.
Definition: stage.h:66
int FTI_InitStage(FTIT_execution *FTI_Exec, FTIT_configuration *FTI_Conf, FTIT_topology *FTI_Topo)
Initializes the FTI staging feature.
Definition: stage.c:126
int FTI_GetRequestField(int ID, FTIT_RequestField val)
Returns value from the 'idxRequest' field array at 'ID'.
Definition: stage.c:996
int FTI_FreeStageRequest(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID, int source)
frees stage meta info element (head/application rank)
Definition: stage.c:421
Definition: stage.h:68
int FTI_SyncStage(char *lpath, char *rpath, FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_configuration *FTI_Conf, uint32_t ID)
This function synchronously stages the local file to the PFS.
Definition: stage.c:582
size_t size
Definition: stage.h:89
Definition: fti.h:476
Definition: stage.h:79
struct FTIT_StageAppInfo FTIT_StageAppInfo
Application rank staging meta info.
int FTI_GetStatusField(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID, FTIT_StatusField val, int source)
Returns value from the 'status' field array at 'ID'.
Definition: stage.c:1101
int FTI_SetStatusField(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID, uint8_t entry, FTIT_StatusField val, int source)
Sets value from the 'status' field array at 'ID'.
Definition: stage.c:1151
Definition: stage.h:67
Definition: fti.h:448
char rpath[FTI_BUFS]
Definition: stage.h:87
void * sendBuf
Definition: stage.h:97
int FTI_InitStageRequestHead(char *lpath, char *rpath, FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int source, uint32_t ID)
Initializes new stage meta info element (head rank)
Definition: stage.c:372
void FTI_FinalizeStage(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_configuration *FTI_Conf)
Finalizes staging feature.
Definition: stage.c:246
void FTI_PrintStageStatus(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID, int source)
Definition: stage.c:1241
Definition: stage.h:78
int FTI_HandleStageRequest(FTIT_configuration *FTI_Conf, FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_checkpoint *FTI_Ckpt, int source)
This function asynchronously stages the local file to the PFS.
Definition: stage.c:797
Definition: stage.h:96
int ID
Definition: stage.h:99
int FTI_GetRequestIdx(int ID)
returns the index of desired stage meta info element.
Definition: stage.c:558