Fault Tolerance Interface
stage.c File Reference

helper functions for the FTI staging feature. More...

#include "interface.h"
Include dependency graph for stage.c:

Functions

int FTI_InitStage (FTIT_execution *FTI_Exec, FTIT_configuration *FTI_Conf, FTIT_topology *FTI_Topo)
 Initializes the FTI staging feature. More...
 
void FTI_FinalizeStage (FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, FTIT_configuration *FTI_Conf)
 Finalizes staging feature. More...
 
int FTI_InitStageRequestApp (FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, uint32_t ID)
 Initializes new stage meta info element (application rank) More...
 
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) More...
 
int FTI_FreeStageRequest (FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID, int source)
 frees stage meta info element (head/application rank) More...
 
int FTI_GetRequestIdx (int ID)
 returns the index of desired stage meta info element. More...
 
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. More...
 
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. More...
 
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. More...
 
int FTI_GetRequestField (int ID, FTIT_RequestField val)
 Returns value from the 'idxRequest' field array at 'ID'. More...
 
int FTI_SetRequestField (int ID, uint32_t entry, FTIT_RequestField val)
 Sets value of the 'idxRequest' field array at 'ID'. More...
 
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'. More...
 
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'. More...
 
int FTI_GetRequestID (FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo)
 Returns unique 'ID' for staging request. More...
 
void FTI_PrintStageStatus (FTIT_execution *FTI_Exec, FTIT_topology *FTI_Topo, int ID, int source)
 

Detailed Description

helper functions for the FTI staging feature.

header for stage.c

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
July, 2018

Function Documentation

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.

Parameters
string'lpath', absolute path of local file
string'rpath', absolute path of remote file
FTI_ExecExecution metadata.
FTI_TopoTopology metadata.
FTI_ConfConfiguration metadata.
integer'ID' of staging request
Returns
'FTI_SCES' on success, 'FTI_NSCS' else.

This function uses a non-blocking send (MPI_Isend) in order to pass the information that is needed by the head process to perform an asynchronous staging of the local file to the PFS.

Here is the call graph for this function:

void FTI_FinalizeStage ( FTIT_execution FTI_Exec,
FTIT_topology FTI_Topo,
FTIT_configuration FTI_Conf 
)

Finalizes staging feature.

Parameters
FTI_ExecExecution metadata.
FTI_TopoTopology metadata.
FTI_ConfConfiguration metadata.

This function frees allocated ressources, removes local staging files and the staging directory and destroys the node communicator

Here is the call graph for this function:

int FTI_FreeStageRequest ( FTIT_execution FTI_Exec,
FTIT_topology FTI_Topo,
int  ID,
int  source 
)

frees stage meta info element (head/application rank)

Parameters
FTI_ExecExecution metadata.
FTI_TopoTopology metadata.
integer'ID' of staging request
integer'source', application rank of stage request

This function eliminates the 'ID' corresponding element from the stage meta info array and frees the corresponding memory. In the application ranks it also reorders the index information in the 'idxRequestÄ array corresponding to 'ID'.

Here is the call graph for this function:

int FTI_GetRequestField ( int  ID,
FTIT_RequestField  val 
)

Returns value from the 'idxRequest' field array at 'ID'.

Parameters
integer'ID' of staging request
FTIT_StatusFieldrequested field
Returns
Field value on success, 'FTI_NSCS' else.

Here is the call graph for this function:

int FTI_GetRequestID ( FTIT_execution FTI_Exec,
FTIT_topology FTI_Topo 
)

Returns unique 'ID' for staging request.

Parameters
FTI_ExecExecution metadata.
FTI_TopoTopology metadata.
Returns
'ID' on success, -1 else.

Here is the call graph for this function:

int FTI_GetRequestIdx ( int  ID)

returns the index of desired stage meta info element.

Parameters
integer'ID' of staging request
Returns
index if 'ID' corresponding meta info structure was allocated -1, else.

Here is the call graph for this function:

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'.

Parameters
FTI_ExecExecution metadata.
FTI_TopoTopology metadata.
integer'ID' of staging request
FTIT_StatusFieldrequested field
integer'source', application rank of stage request.
Returns
Field value on success, 'FTI_NSCS' else.

Here is the call graph for this function:

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.

Parameters
string'lpath', absolute path of local file.
string'rpath', absolute path of remote file.
FTI_ExecExecution metadata.
FTI_TopoTopology metadata.
FTI_ConfConfiguration metadata.
integer'source', application rank of stage request.
Returns
'FTI_SCES' on success, 'FTI_NSCS' else.

Here is the call graph for this function:

int FTI_InitStage ( FTIT_execution FTI_Exec,
FTIT_configuration FTI_Conf,
FTIT_topology FTI_Topo 
)

Initializes the FTI staging feature.

Parameters
FTI_ExecExecution metadata.
FTI_ConfConfiguration metadata.
FTI_TopoTopology metadata.

This function allocates memory for the 'idxRequest' and 'status' fields, creates a node communicator and an MPI shared memory window.

Here is the call graph for this function:

int FTI_InitStageRequestApp ( FTIT_execution FTI_Exec,
FTIT_topology FTI_Topo,
uint32_t  ID 
)

Initializes new stage meta info element (application rank)

Parameters
FTI_ExecExecution metadata.
FTI_TopoTopology metadata.
integer'ID' of staging request

This function appends a new staging meta info element for the application ranks to 'FTI_Exec->stageInfo->request'. Beside that it also initializes the status field (status -> pending) corresponding to 'ID' and assigns the proper index of the meta info element to the 'ID' corresponding 'idxRequest' field.

Here is the call graph for this function:

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)

Parameters
string'lpath', absolute path of local file
string'rpath', absolute path of remote file
FTI_ExecExecution metadata.
FTI_TopoTopology metadata.
integer'source', application rank of stage request
integer'ID' of staging request
Returns
'FTI_SCES' on success, 'FTI_NSCS' else.

This function appends a new staging meta info element for the head ranks to 'FTI_Exec->stageInfo->request'. Beside that it also changes the status field corresponding to 'ID' (status -> active).

Here is the call graph for this function:

void FTI_PrintStageStatus ( FTIT_execution FTI_Exec,
FTIT_topology FTI_Topo,
int  ID,
int  source 
)

Here is the call graph for this function:

int FTI_SetRequestField ( int  ID,
uint32_t  entry,
FTIT_RequestField  val 
)

Sets value of the 'idxRequest' field array at 'ID'.

Parameters
integer'ID' of staging request
integer'entry', new value of field
FTIT_StatusFieldrequested field
Returns
'entry' on success, 'FTI_NSCS' else.

Here is the call graph for this function:

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'.

Parameters
FTI_ExecExecution metadata.
FTI_TopoTopology metadata.
integer'ID' of staging request
integer'entry', new value of field
FTIT_StatusFieldrequested field
integer'source', application rank of stage request.
Returns
'entry' value on success, 'FTI_NSCS' else.

Here is the call graph for this function:

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.

Parameters
string'lpath', absolute path of local file
string'rpath', absolute path of remote file
FTI_ExecExecution metadata.
FTI_TopoTopology metadata.
FTI_ConfConfiguration metadata.
integer'ID' of staging request
Returns
'FTI_SCES' on success, 'FTI_NSCS' else.

This function should be called only if the staging feature is enabled without the head process being enabled.

Here is the call graph for this function: