From 0dff2acb294673c94c9c2f997f72d250e5e7a20f Mon Sep 17 00:00:00 2001 From: ribes Date: Wed, 18 Nov 2009 15:22:04 +0000 Subject: [PATCH] Removing old code --- src/PBS/Batch_BatchManager_ePBS.cxx | 92 +---------------------------- src/PBS/Batch_BatchManager_ePBS.hxx | 1 - 2 files changed, 1 insertion(+), 92 deletions(-) diff --git a/src/PBS/Batch_BatchManager_ePBS.cxx b/src/PBS/Batch_BatchManager_ePBS.cxx index 994c721..724e9f8 100644 --- a/src/PBS/Batch_BatchManager_ePBS.cxx +++ b/src/PBS/Batch_BatchManager_ePBS.cxx @@ -22,7 +22,7 @@ /* * BatchManager_ePBS.cxx : emulation of PBS client * - * Auteur : Bernard SECHER - CEA DEN + * Auteur : Bernard SECHER - CEA DEN, André RIBES - EDF R&D * Mail : mailto:bernard.secher@cea.fr * Date : Thu Apr 24 10:17:22 2008 * Projet : PAL Salome @@ -284,94 +284,4 @@ namespace Batch { if (status) throw EmulationException("Error of connection on remote host, cannot copy batch submission file"); } - - void BatchManager_ePBS::oldbuildBatchScript(const Job & job) - { - Parametre params = job.getParametre(); - Environnement env = job.getEnvironnement(); - const long nbproc = params[NBPROC]; - const long edt = params[MAXWALLTIME]; - const long mem = params[MAXRAMSIZE]; - const string workDir = params[WORKDIR]; - const std::string dirForTmpFiles = params[TMPDIR]; - const string fileToExecute = params[EXECUTABLE]; - const string home = params[HOMEDIR]; - const std::string queue = params[QUEUE]; - std::string rootNameToExecute; - std::string fileNameToExecute; - std::string filelogtemp; - if( fileToExecute.size() > 0 ){ - string::size_type p1 = fileToExecute.find_last_of("/"); - string::size_type p2 = fileToExecute.find_last_of("."); - rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1); - -#ifdef MSVC - char fname[_MAX_FNAME]; - char ext[_MAX_EXT]; - _splitpath_s(fileToExecute.c_str(), NULL, 0, NULL, 0, fname, _MAX_FNAME, ext, _MAX_EXT); - string execBaseName = string(fname) + ext; -#else - char* basec=strdup(fileToExecute.c_str()); - string execBaseName = string(basename(basec)); - free(basec); -#endif - - fileNameToExecute = "~/" + dirForTmpFiles + "/" + execBaseName; - - int idx = dirForTmpFiles.find("Batch/"); - filelogtemp = dirForTmpFiles.substr(idx+6, dirForTmpFiles.length()); - } - else{ - rootNameToExecute = "command"; - } - - ofstream tempOutputFile; - std::string TmpFileName = createAndOpenTemporaryFile("PBS-script", tempOutputFile); - - tempOutputFile << "#! /bin/sh -f" << endl; - if (queue != "") - tempOutputFile << "#BSUB -q " << queue << endl; - if( edt > 0 ) - tempOutputFile << "#PBS -l walltime=" << edt*60 << endl ; - if( mem > 0 ) - tempOutputFile << "#PBS -l mem=" << mem << "mb" << endl ; - if( fileToExecute.size() > 0 ){ - tempOutputFile << "#PBS -o " << home << "/" << dirForTmpFiles << "/output.log." << filelogtemp << endl ; - tempOutputFile << "#PBS -e " << home << "/" << dirForTmpFiles << "/error.log." << filelogtemp << endl ; - } - else{ - tempOutputFile << "#PBS -o " << dirForTmpFiles << "/" << env["LOGFILE"] << ".output.log" << endl ; - tempOutputFile << "#PBS -e " << dirForTmpFiles << "/" << env["LOGFILE"] << ".error.log" << endl ; - } - if( workDir.size() > 0 ) - tempOutputFile << "cd " << workDir << endl ; - if( fileToExecute.size() > 0 ){ - tempOutputFile << _mpiImpl->boot("${PBS_NODEFILE}",nbproc); - tempOutputFile << _mpiImpl->run("${PBS_NODEFILE}",nbproc,fileNameToExecute); - tempOutputFile << _mpiImpl->halt(); - } - else{ - tempOutputFile << "source " << env["SOURCEFILE"] << endl ; - tempOutputFile << env["COMMAND"]; - } - - tempOutputFile.flush(); - tempOutputFile.close(); -#ifdef WIN32 - _chmod( -#else - chmod( -#endif - TmpFileName.c_str(), 0x1ED); - cerr << TmpFileName.c_str() << endl; - - int status = _protocol.copyFile(TmpFileName, "", "", - dirForTmpFiles + "/" + rootNameToExecute + "_Batch.sh", - _hostname, _username); - if (status) - throw EmulationException("Error of connection on remote host"); - - remove(TmpFileName.c_str()); - } - } diff --git a/src/PBS/Batch_BatchManager_ePBS.hxx b/src/PBS/Batch_BatchManager_ePBS.hxx index 73b4947..9d7e8ce 100644 --- a/src/PBS/Batch_BatchManager_ePBS.hxx +++ b/src/PBS/Batch_BatchManager_ePBS.hxx @@ -69,7 +69,6 @@ namespace Batch { protected: void buildBatchScript(const Job & job); - void oldbuildBatchScript(const Job & job); private: int _nb_proc_per_node; -- 2.39.2