Fault Tolerance Interface
ftiff.h
Go to the documentation of this file.
1 
40 #ifndef _FTIFF_H
41 #define _FTIFF_H
42 
43 #include "fti.h"
44 #ifndef FTI_NOZLIB
45 # include "zlib.h"
46 #endif
47 #include <assert.h>
48 #include <string.h>
49 
50 #define MBR_CNT(TYPE) int TYPE ## _mbrCnt
51 #define MBR_BLK_LEN(TYPE) int TYPE ## _mbrBlkLen[]
52 #define MBR_TYPES(TYPE) MPI_Datatype TYPE ## _mbrTypes[]
53 #define MBR_DISP(TYPE) MPI_Aint TYPE ## _mbrDisp[]
54 
55 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
56 
57 #define DBG_MSG(MSG,RANK,...) do { \
58  int rank; \
59  MPI_Comm_rank(MPI_COMM_WORLD,&rank); \
60  if ( rank == RANK ) \
61  printf( "%s:%d[DEBUG-%d] " MSG "\n", __FILENAME__,__LINE__,rank, ##__VA_ARGS__); \
62  if ( RANK == -1 ) \
63  printf( "%s:%d[DEBUG-%d] " MSG "\n", __FILENAME__,__LINE__,rank, ##__VA_ARGS__); \
64 } while (0)
65 
81 typedef unsigned short dcpBLK_t;
82 
90 typedef struct FTIFF_headInfo {
91  int exists;
92  int nbVar;
94  long maxFs;
95  long fs;
96  long pfs;
97  int isDcp;
99 
106 typedef struct FTIFF_L2Info {
109  int ckptID;
110  int rightIdx;
111  long fs;
112  long pfs;
113 } FTIFF_L2Info;
114 
121 typedef struct FTIFF_L3Info {
124  int ckptID;
125  long fs;
126  long RSfs; // maxFs
127 } FTIFF_L3Info;
128 
137 // ID MPI types
138 enum {
143 };
144 
145 // declare MPI datatypes
146 extern MPI_Datatype FTIFF_MpiTypes[FTIFF_NUM_MPI_TYPES];
147 
148 typedef struct FTIFF_MPITypeInfo {
149  MPI_Datatype raw;
150  int mbrCnt;
151  int* mbrBlkLen;
152  MPI_Datatype* mbrTypes;
153  MPI_Aint* mbrDisp;
155 
164 void FTIFF_InitMpiTypes();
165 int FTIFF_DeserializeFileMeta( FTIFF_metaInfo* meta, char* buffer_ser );
166 int FTIFF_DeserializeDbMeta( FTIFF_db* db, char* buffer_ser );
167 int FTIFF_DeserializeDbVarMeta( FTIFF_dbvar* dbvar, char* buffer_ser );
168 int FTIFF_SerializeFileMeta( FTIFF_metaInfo* meta, char* buffer_ser );
169 int FTIFF_SerializeDbMeta( FTIFF_db* db, char* buffer_ser );
170 int FTIFF_SerializeDbVarMeta( FTIFF_dbvar* dbvar, char* buffer_ser );
171 void FTIFF_FreeDbFTIFF(FTIFF_db* last);
172 int FTIFF_Recover( FTIT_execution *FTI_Exec, FTIT_dataset *FTI_Data, FTIT_checkpoint *FTI_Ckpt );
173 int FTIFF_RecoverVar( int id, FTIT_execution *FTI_Exec, FTIT_dataset *FTI_Data, FTIT_checkpoint *FTI_Ckpt );
174 int FTIFF_UpdateDatastructFTIFF( FTIT_execution* FTI_Exec, FTIT_dataset* FTI_Data, FTIT_configuration* FTI_Conf );
175 int FTIFF_ReadDbFTIFF( FTIT_configuration *FTI_Conf, FTIT_execution *FTI_Exec, FTIT_checkpoint* FTI_Ckpt );
176 int FTIFF_GetFileChecksum( FTIFF_metaInfo *FTIFF_Meta, FTIT_checkpoint* FTI_Ckpt, int fd, unsigned char *hash );
177 int FTIFF_WriteFTIFF(FTIT_configuration* FTI_Conf, FTIT_execution* FTI_Exec,
178  FTIT_topology* FTI_Topo, FTIT_checkpoint* FTI_Ckpt,
179  FTIT_dataset* FTI_Data);
180 int FTIFF_CreateMetadata( FTIT_execution* FTI_Exec, FTIT_topology* FTI_Topo,
181  FTIT_dataset* FTI_Data, FTIT_configuration* FTI_Conf );
182 int FTIFF_CheckL1RecoverInit( FTIT_execution* FTI_Exec, FTIT_topology* FTI_Topo,
183  FTIT_checkpoint* FTI_Ckpt );
184 int FTIFF_CheckL2RecoverInit( FTIT_execution* FTI_Exec, FTIT_topology* FTI_Topo,
185  FTIT_checkpoint* FTI_Ckpt, int *exists);
186 int FTIFF_CheckL3RecoverInit( FTIT_execution* FTI_Exec, FTIT_topology* FTI_Topo,
187  FTIT_checkpoint* FTI_Ckpt, int* erased);
188 int FTIFF_CheckL4RecoverInit( FTIT_execution* FTI_Exec, FTIT_topology* FTI_Topo,
189  FTIT_checkpoint* FTI_Ckpt);
190 void FTIFF_GetHashMetaInfo( unsigned char *hash, FTIFF_metaInfo *FTIFFMeta );
191 void FTIFF_GetHashdb( unsigned char *hash, FTIFF_db *db );
192 void FTIFF_GetHashdbvar( unsigned char *hash, FTIFF_dbvar *dbvar );
193 void FTIFF_PrintDataStructure( int rank, FTIT_execution* FTI_Exec, FTIT_dataset* FTI_Data );
194 #endif
int FTIFF_CheckL2RecoverInit(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_checkpoint *FTI_Ckpt, int *exists)
Init of FTI-FF L2 recovery.
Definition: ftiff.c:1921
Definition: fti.h:411
Definition: ftiff.h:121
MPI_Datatype raw
Definition: ftiff.h:149
int FTIFF_CheckL3RecoverInit(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_checkpoint *FTI_Ckpt, int *erased)
Init of FTI-FF L3 recovery.
Definition: ftiff.c:2288
int FTIFF_CheckL1RecoverInit(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_checkpoint *FTI_Ckpt)
Init of FTI-FF L1 recovery.
Definition: ftiff.c:1716
int FileExists
Definition: ftiff.h:122
Definition: fti.h:189
int FTIFF_WriteFTIFF(FTIT_configuration *FTI_Conf, FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_checkpoint *FTI_Ckpt, FTIT_dataset *FTI_Data)
Writes ckpt to local/PFS using FTIFF.
Definition: ftiff.c:890
long fs
Definition: ftiff.h:111
int FTIFF_UpdateDatastructFTIFF(FTIT_execution *FTI_Exec, FTIT_dataset *FTI_Data, FTIT_configuration *FTI_Conf)
updates datablock structure for FTI File Format.
Definition: ftiff.c:500
int FTIFF_DeserializeDbVarMeta(FTIFF_dbvar *dbvar, char *buffer_ser)
deserializes FTI-FF data chunk meta data
Definition: ftiff.c:3042
void FTIFF_FreeDbFTIFF(FTIFF_db *last)
Frees allocated memory for the FTI-FF meta data struct list.
Definition: ftiff.c:3178
Definition: fti.h:330
void FTIFF_GetHashdbvar(unsigned char *hash, FTIFF_dbvar *dbvar)
Computes hash of the FTI-FF data chunk meta data structure.
Definition: ftiff.c:2872
void FTIFF_GetHashdb(unsigned char *hash, FTIFF_db *db)
Computes hash of the FTI-FF file data block meta data structure.
Definition: ftiff.c:2856
int * mbrBlkLen
Definition: ftiff.h:151
long RSfs
Definition: ftiff.h:126
long fs
Definition: ftiff.h:125
Definition: fti.h:365
Definition: ftiff.h:141
void FTIFF_PrintDataStructure(int rank, FTIT_execution *FTI_Exec, FTIT_dataset *FTI_Data)
Definition: ftiff.c:3196
int FTIFF_SerializeFileMeta(FTIFF_metaInfo *meta, char *buffer_ser)
serializes FTI-FF file meta data
Definition: ftiff.c:3082
int FTIFF_CreateMetadata(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_dataset *FTI_Data, FTIT_configuration *FTI_Conf)
Assign meta data to runtime and file meta data types.
Definition: ftiff.c:1248
int FTIFF_GetFileChecksum(FTIFF_metaInfo *FTIFF_Meta, FTIT_checkpoint *FTI_Ckpt, int fd, unsigned char *hash)
Determines checksum of checkpoint data.
Definition: ftiff.c:330
int rightIdx
Definition: ftiff.h:110
struct FTIFF_MPITypeInfo FTIFF_MPITypeInfo
#define FTI_BUFS
Definition: fti.h:33
int nbVar
Definition: ftiff.h:92
struct FTIFF_L2Info FTIFF_L2Info
Meta data for L2 recovery.
Definition: ftiff.h:106
long pfs
Definition: ftiff.h:96
int RSFileExists
Definition: ftiff.h:123
void FTIFF_GetHashMetaInfo(unsigned char *hash, FTIFF_metaInfo *FTIFFMeta)
Computes hash of the FTI-FF file meta data structure.
Definition: ftiff.c:2836
int FTIFF_Recover(FTIT_execution *FTI_Exec, FTIT_dataset *FTI_Data, FTIT_checkpoint *FTI_Ckpt)
Recovers protected data to the variable pointers for FTI-FF.
Definition: ftiff.c:1336
int FTIFF_SerializeDbMeta(FTIFF_db *db, char *buffer_ser)
serializes FTI-FF file data block meta data
Definition: ftiff.c:3115
long maxFs
Definition: ftiff.h:94
Definition: ftiff.h:90
Definition: ftiff.h:148
int FTIFF_ReadDbFTIFF(FTIT_configuration *FTI_Conf, FTIT_execution *FTI_Exec, FTIT_checkpoint *FTI_Ckpt)
Reads datablock structure for FTI File Format from ckpt file.
Definition: ftiff.c:72
void FTIFF_InitMpiTypes()
Initializes the derived MPI data types used for FTI-FF.
Definition: ftiff.c:2894
int ckptID
Definition: ftiff.h:109
Definition: fti.h:150
Header file for the FTI library.
Definition: fti.h:476
Definition: ftiff.h:139
int exists
Definition: ftiff.h:91
int FileExists
Definition: ftiff.h:107
Definition: ftiff.h:140
int FTIFF_RecoverVar(int id, FTIT_execution *FTI_Exec, FTIT_dataset *FTI_Data, FTIT_checkpoint *FTI_Ckpt)
Recovers protected data to the variable pointer with id.
Definition: ftiff.c:1537
MPI_Datatype * mbrTypes
Definition: ftiff.h:152
int FTIFF_CheckL4RecoverInit(FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_checkpoint *FTI_Ckpt)
Init of FTI-FF L4 recovery.
Definition: ftiff.c:2649
long fs
Definition: ftiff.h:95
Definition: fti.h:448
Definition: fti.h:214
int CopyExists
Definition: ftiff.h:108
int mbrCnt
Definition: ftiff.h:150
MPI_Aint * mbrDisp
Definition: ftiff.h:153
int FTIFF_DeserializeDbMeta(FTIFF_db *db, char *buffer_ser)
deserializes FTI-FF file data block meta data
Definition: ftiff.c:3018
unsigned short dcpBLK_t
unsigned short (0 - 65535).
Definition: ftiff.h:81
int isDcp
Definition: ftiff.h:97
char ckptFile[FTI_BUFS]
Definition: ftiff.h:93
MPI_Datatype FTIFF_MpiTypes[FTIFF_NUM_MPI_TYPES]
Definition: ftiff.c:51
struct FTIFF_headInfo FTIFF_headInfo
Runtime meta info for the heads.
long pfs
Definition: ftiff.h:112
int ckptID
Definition: ftiff.h:124
int FTIFF_SerializeDbVarMeta(FTIFF_dbvar *dbvar, char *buffer_ser)
serializes FTI-FF data chunk meta data
Definition: ftiff.c:3139
int FTIFF_DeserializeFileMeta(FTIFF_metaInfo *meta, char *buffer_ser)
deserializes FTI-FF file meta data
Definition: ftiff.c:2984
Definition: ftiff.h:142
struct FTIFF_L3Info FTIFF_L3Info
Meta data for L3 recovery.