Fault Tolerance Interface
diff-checkpoint.c File Reference

Differential checkpointing routines. More...

#include "interface.h"
Include dependency graph for diff-checkpoint.c:

Macros

#define _DEFAULT_SOURCE
 
#define _BSD_SOURCE
 

Functions

int FTI_FinalizeDcp (FTIT_configuration *FTI_Conf, FTIT_execution *FTI_Exec)
 Finalizes dCP. More...
 
int FTI_InitDcp (FTIT_configuration *FTI_Conf, FTIT_execution *FTI_Exec, FTIT_dataset *FTI_Data)
 Initializes dCP. More...
 
dcpBLK_t FTI_GetDiffBlockSize ()
 Returns the dCP block size. More...
 
int FTI_GetDcpMode ()
 Returns the dCP mode. More...
 
int FTI_InitBlockHashArray (FTIFF_dbvar *dbvar)
 Initializes a new hash meta data structure for data chunk. More...
 
int FTI_CollapseBlockHashArray (FTIFF_dbvar *dbvar)
 Shrinks an existing hash meta data structure for data chunk. More...
 
int FTI_ExpandBlockHashArray (FTIFF_dbvar *dbvar)
 Expands an existing hash meta data structure for data chunk. More...
 
long FTI_CalcNumHashes (long chunkSize)
 Computes number of hashblocks for chunk size. More...
 
int FTI_HashCmp (long hashIdx, FTIFF_dbvar *dbvar)
 Checks if data block is dirty, clean or invalid. More...
 
int FTI_UpdateDcpChanges (FTIT_dataset *FTI_Data, FTIT_execution *FTI_Exec)
 Updates data chunk hash meta data. More...
 
int FTI_ReceiveDataChunk (FTI_ADDRVAL *buffer_addr, FTI_ADDRVAL *buffer_size, FTIFF_dbvar *dbvar, FTIT_dataset *FTI_Data)
 Returns pointer and size of buffer to write during checkpoint. More...
 

Detailed Description

Differential checkpointing routines.

Copyright (c) 2017 Leonardo A. Bautista-Gomez All rights reserved

FTI - A multi-level checkpointing library for C/C++/Fortran applications

Revision 1.0 : Fault Tolerance Interface (FTI)

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author
Kai Keller (kelle.nosp@m.kai@.nosp@m.gmx.d.nosp@m.e)
Date
February, 2018

Macro Definition Documentation

#define _BSD_SOURCE
#define _DEFAULT_SOURCE

Function Documentation

long FTI_CalcNumHashes ( long  chunkSize)

Computes number of hashblocks for chunk size.

Parameters
chunkSizechunk size of data chunk
Returns
long FTI_SCES if successful.

This function computes the number of hash blocks according to the set dCP block size corresponding to chunkSize.

int FTI_CollapseBlockHashArray ( FTIFF_dbvar dbvar)

Shrinks an existing hash meta data structure for data chunk.

Parameters
dbvarDatchunk metadata.
Returns
integer FTI_SCES if successful.

This function re-allocates memory for the 'dataDiffHash' member of the 'FTIFF_dbvar' structure and if dCP mode is MD5 also for the MD5 digest array placed in the member 'md5hash' of the 'dataDiffHash' structure.

It also updates the other members of the 'dataDiffHash' structure.

Here is the call graph for this function:

int FTI_ExpandBlockHashArray ( FTIFF_dbvar dbvar)

Expands an existing hash meta data structure for data chunk.

Parameters
dbvarDatchunk metadata.
Returns
integer FTI_SCES if successful.

This function re-allocates memory for the 'dataDiffHash' member of the 'FTIFF_dbvar' structure and if dCP mode is MD5 also for the MD5 digest array placed in the member 'md5hash' of the 'dataDiffHash' structure.

It also updates the other members of the 'dataDiffHash' structure.

Here is the call graph for this function:

int FTI_FinalizeDcp ( FTIT_configuration FTI_Conf,
FTIT_execution FTI_Exec 
)

Finalizes dCP.

Function Definitions

Parameters
FTI_ConfConfiguration metadata.
FTI_ExecExecution metadata.
Returns
integer FTI_SCES if successful.

This function deallocates structures used for dCP and exposes the status dcp disabled to FTI. It is also called for failures during dCP creation.

int FTI_GetDcpMode ( )

Returns the dCP mode.

dcpBLK_t FTI_GetDiffBlockSize ( )

Returns the dCP block size.

int FTI_HashCmp ( long  hashIdx,
FTIFF_dbvar dbvar 
)

Checks if data block is dirty, clean or invalid.

Parameters
hashIdxindex for hash meta data in data chunk meta data.
dbvarData chunk meta data.
Returns
integer 0 if data block is clean.
integer 1 if data block is dirty or invalid.
integer -1 if hashIdx not in range.

This function checks if data block corresponding to the hash meta data element is clean, dirty or invalid.

It returns -1 if hashIdx is out of range.

int FTI_InitBlockHashArray ( FTIFF_dbvar dbvar)

Initializes a new hash meta data structure for data chunk.

Parameters
dbvarDatchunk metadata.
Returns
integer FTI_SCES if successful.

This function allocates memory for the 'dataDiffHash' member of the 'FTIFF_dbvar' structure and if dCP mode is MD5 also for the MD5 digest array placed in the member 'md5hash' of the 'dataDiffHash' structure.

It also initializes the other members of the 'dataDiffHash' structure.

Here is the call graph for this function:

int FTI_InitDcp ( FTIT_configuration FTI_Conf,
FTIT_execution FTI_Exec,
FTIT_dataset FTI_Data 
)

Initializes dCP.

Parameters
FTI_ConfConfiguration metadata.
FTI_ExecExecution metadata.
FTI_DataDataset metadata.
Returns
integer FTI_SCES if successful.

This function looks for environment variables set for the dCP mode and dCP block size and overwrites, if found, the values from the configuration file.

It also initializes the file local variables 'dcpEnabled', 'DCP_MODE' and 'DCP_BLOCK_SIZE'.

Here is the call graph for this function:

int FTI_ReceiveDataChunk ( FTI_ADDRVAL buffer_addr,
FTI_ADDRVAL buffer_size,
FTIFF_dbvar dbvar,
FTIT_dataset FTI_Data 
)

Returns pointer and size of buffer to write during checkpoint.

Parameters
buffer_addrPointer to buffer.
buffer_sizeSize of buffer.
dbvarData chunk meta data.
FTI_DataDataset metadata.
Returns
integer 1 if buffer holds data to write.
integer 0 if nothing to write.

This function is called repeatedly for each data chunk. If it returns 1, 'buffer_addr' holds the pointer to a memory region inside the data chunk and 'buffer_size' holds the size of the region. For dCP disabled, this region is the whole data chunk. For dCP enabled, the function returns a pointer to contiguous dirty regions until no further dirty regions are found in which case 0 is returned.

Here is the call graph for this function:

int FTI_UpdateDcpChanges ( FTIT_dataset FTI_Data,
FTIT_execution FTI_Exec 
)

Updates data chunk hash meta data.

Parameters
FTI_ExecExecution metadata.
FTI_DataDataset metadata.
Returns
integer FTI_SCES if successful.

This function updates the hashes of data blocks that were identified as dirty and initializes the hashes for data blocks that are invalid.