00001 /*************************************************************************** 00002 * Copyright (C) 2008 by Jason Ansel * 00003 * jansel@ccs.neu.edu * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00021 #ifndef DMTCPAWARE_H 00022 #define DMTCPAWARE_H 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00029 #define DMTCP_AFTER_CHECKPOINT 1 00031 #define DMTCP_AFTER_RESTART 2 00032 00034 #define DMTCP_ERROR_DISABLED -128 00035 00037 typedef void (*DmtcpFunctionPointer)(void); 00038 00040 typedef struct _DmtcpCoordinatorStatus { 00041 00043 int numProcesses; 00044 00046 int isRunning; 00047 00048 } DmtcpCoordinatorStatus; 00049 00051 typedef struct _DmtcpLocalStatus { 00052 00054 int numCheckpoints; 00055 00057 int numRestarts; 00058 00060 const char* checkpointFilenameMtcp; 00061 00063 const char* checkpointFilenameDmtcp; 00064 00067 const char* uniquePidStr; 00068 00069 } DmtcpLocalStatus; 00070 00071 00075 int dmtcpIsEnabled(); 00076 00084 int dmtcpCheckpoint(); 00085 00094 int dmtcpDelayCheckpointsLock(); 00095 00100 int dmtcpDelayCheckpointsUnlock(); 00101 00111 int dmtcpInstallHooks( DmtcpFunctionPointer preCheckpoint 00112 , DmtcpFunctionPointer postCheckpoint 00113 , DmtcpFunctionPointer postRestart); 00114 00120 const DmtcpCoordinatorStatus* dmtcpGetCoordinatorStatus(); 00121 00127 const DmtcpLocalStatus* dmtcpGetLocalStatus(); 00128 00133 int dmtcpRunCommand(char command); 00134 00135 #ifdef __cplusplus 00136 } //extern "C" 00137 #endif 00138 00139 #endif //DMTCPAWARE_H