资源简介
openlava-3.2.tar.gz 源码。
100%开源。 兼容LSF。 利用数以百计的现有集成。
代码片段和文件信息
/* $Id: echkpnt.c 397 2007-11-26 19:04:00Z mblack $
* Copyright (C) 2007 Platform Computing Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not write to the Free Software
* Foundation Inc. 51 Franklin Street Fifth Floor Boston MA 02110-1301 USA
*
*/
#include
#include
#include
#include
#include
#include
#include
#include “echkpnt.lib.h“
#include “echkpnt.env.h“
#define LSTMPDIR lsTmpDir_
static void usage(const char *);
static char logMesgBuf[MAXLINELEN];
extern char *lsTmpDir_;
static void
usage (const char *pCmd)
{
fprintf(stderr “Usage: %s [-c] [-f] [-k | -s] [-x] [-d chkdir] [-h] [-V] pid\n“ pCmd);
}
int
main(int argc char **argv){
static char fname[] = “main()“;
char *pMethodName = NULL;
char *pMethodDir = NULL;
char *pIsOutput = NULL;
char *pJobID = NULL;
char *presAcctFN = NULL;
char resAcctFN[MAXFILENAMELEN];
char echkpntProgPath[MAXPATHLEN];
char *pChkpntDir = NULL;
pid_t iChildPid;
LS_WAIT_T iStatus;
char *cargv[MAX_ARGS];
int argIndex = 0;
int cc;
int iReValue;
char *jf *jfn;
while ((cc = getopt(argc argv “cfksd:Vhx“)) != EOF ){
switch(cc){
case ‘c‘:
case ‘f‘:
case ‘k‘:
case ‘x‘:
case ‘s‘:
break;
case ‘V‘:
fputs(_LS_VERSION_ stderr);
exit(0);
case ‘d‘:
pChkpntDir = optarg;
break;
case ‘h‘:
usage(argv[0]);
exit(0);
default:
usage(argv[0]);
exit(-1);
}
}
if (pChkpntDir == NULL){
usage(argv[0]);
exit(-1);
}
if (access(pChkpntDirW_OK | X_OK) < 0){
fprintf(stderr“%s : the chkpnt dir %s can not be accessed\n“
fnamepChkpntDir);
exit(-1);
}
iReValue = fileIsExist(pChkpntDir);
if (iReValue == 1){
pMethodName = getEchkpntVar(ECHKPNT_METHOD);
if ((pMethodName == NULL)||(strcmp(pMethodName““) == 0)){
pMethodName = ECHKPNT_DEFAULT_METHOD;
}
pMethodDir = getEchkpntVar(ECHKPNT_METHOD_DIR);
pIsOutput = getEchkpntVar(ECHKPNT_KEEP_OUTPUT);
}else if (iReValue == 0) {
initenv_(NULLNULL);
pMethodName = getenv(ECHKPNT_METHOD);
if ((pMethodName == NULL)||(strcmp(pMethodName““) == 0)){
pMethodName = ECHKPNT_DEFAULT_METHOD;
}
pMethodDir = getenv(ECHKPNT_METHOD_DIR);
pIsOutput = getenv(ECHKPNT_KEEP_OUTPUT);
{
jf = getenv(“LSB_JOBFILENAME“);
if (jf == NULL) {
fprintf(stderr “%s : getenv of LSB_JOBFILENAME failed“ fname);
评论
共有 条评论