From 74270a84801d5b4dbbdb6ef6d1e1f4c87242d043 Mon Sep 17 00:00:00 2001 From: secher Date: Mon, 22 Oct 2012 12:59:32 +0000 Subject: [PATCH] changes for eris cluster --- src/Core/Batch_MpiImpl.cxx | 30 +++++++++++++++++++++++++++++ src/Core/Batch_MpiImpl.hxx | 7 +++++++ src/SGE/Batch_BatchManager_eSGE.cxx | 8 ++++---- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/Core/Batch_MpiImpl.cxx b/src/Core/Batch_MpiImpl.cxx index f0f5e07..3e93d12 100644 --- a/src/Core/Batch_MpiImpl.cxx +++ b/src/Core/Batch_MpiImpl.cxx @@ -79,6 +79,11 @@ string MpiImpl_LAM::halt() return oss.str(); } +string MpiImpl_LAM::name() +{ + return "lam"; +} + // mpich1 implementation // Constructor MpiImpl_MPICH1::MpiImpl_MPICH1() : MpiImpl() @@ -117,6 +122,11 @@ string MpiImpl_MPICH1::halt() return ""; } +string MpiImpl_MPICH1::name() +{ + return "mpich"; +} + // mpich2 implementation // Constructor MpiImpl_MPICH2::MpiImpl_MPICH2() : MpiImpl() @@ -162,6 +172,11 @@ string MpiImpl_MPICH2::halt() return oss.str(); } +string MpiImpl_MPICH2::name() +{ + return "mpich"; +} + // openmpi implementation // Constructor MpiImpl_OPENMPI::MpiImpl_OPENMPI() : MpiImpl() @@ -200,6 +215,11 @@ string MpiImpl_OPENMPI::halt() return ""; } +string MpiImpl_OPENMPI::name() +{ + return "openmpi"; +} + // slurm implementation // Constructor MpiImpl_SLURM::MpiImpl_SLURM() : MpiImpl() @@ -238,6 +258,11 @@ string MpiImpl_SLURM::halt() return ""; } +string MpiImpl_SLURM::name() +{ + return "slurm"; +} + // prun implementation // Constructor MpiImpl_PRUN::MpiImpl_PRUN() : MpiImpl() @@ -275,3 +300,8 @@ string MpiImpl_PRUN::halt() { return ""; } + +string MpiImpl_PRUN::name() +{ + return "prun"; +} diff --git a/src/Core/Batch_MpiImpl.hxx b/src/Core/Batch_MpiImpl.hxx index 6e50dc9..12164ee 100644 --- a/src/Core/Batch_MpiImpl.hxx +++ b/src/Core/Batch_MpiImpl.hxx @@ -46,6 +46,7 @@ public: virtual std::string boot(const std::string machinefile, const unsigned int nbnodes) = 0; // get boot command virtual std::string run(const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute) = 0; // get run command virtual std::string halt() = 0; // get stop command + virtual std::string name() = 0; // name of mpi implementation protected: @@ -65,6 +66,7 @@ public: std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command std::string halt(); // get stop command + std::string name(); // name of mpi implementation protected: @@ -84,6 +86,7 @@ public: std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command std::string halt(); // get stop command + std::string name(); // name of mpi implementation protected: @@ -103,6 +106,7 @@ public: std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command std::string halt(); // get stop command + std::string name(); // name of mpi implementation protected: @@ -122,6 +126,7 @@ public: std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command std::string halt(); // get stop command + std::string name(); // name of mpi implementation protected: @@ -141,6 +146,7 @@ public: std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command std::string halt(); // get stop command + std::string name(); // name of mpi implementation protected: @@ -160,6 +166,7 @@ public: std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command std::string halt(); // get stop command + std::string name(); // name of mpi implementation protected: diff --git a/src/SGE/Batch_BatchManager_eSGE.cxx b/src/SGE/Batch_BatchManager_eSGE.cxx index 39a58cc..f6489a4 100644 --- a/src/SGE/Batch_BatchManager_eSGE.cxx +++ b/src/SGE/Batch_BatchManager_eSGE.cxx @@ -90,7 +90,7 @@ namespace Batch { string logFile = generateTemporaryFileName("SGE-submitlog"); // define command to submit batch - string subCommand = string("cd ") + workDir + "; qsub " + fileNameToExecute + "_Batch.sh"; + string subCommand = string("bash -l -c \"cd ") + workDir + "; qsub " + fileNameToExecute + "_Batch.sh\""; string command = _protocol.getExecCommand(subCommand, _hostname, _username); command += " > "; command += logFile; @@ -138,7 +138,7 @@ namespace Batch { iss >> ref; // define command to delete batch - string subCommand = string("qdel ") + iss.str(); + string subCommand = string("bash -l -c \"qdel ") + iss.str() + string("\""); string command = _protocol.getExecCommand(subCommand, _hostname, _username); cerr << command.c_str() << endl; status = system(command.c_str()); @@ -190,7 +190,7 @@ namespace Batch { string logFile = generateTemporaryFileName(string("SGE-querylog-id") + jobid.getReference()); // define command to query batch - string subCommand = string("qstat | grep ") + iss.str(); + string subCommand = string("bash -l -c \"qstat | grep ") + iss.str() + string("\""); string command = _protocol.getExecCommand(subCommand, _hostname, _username); command += " > "; command += logFile; @@ -256,7 +256,7 @@ namespace Batch { tempOutputFile << "#! /bin/sh -f" << endl; if (queue != "") tempOutputFile << "#$ -q " << queue << endl; - tempOutputFile << "#$ -pe mpich " << nbproc << endl; + tempOutputFile << "#$ -pe " << _mpiImpl->name() << " " << nbproc << endl; if( edt > 0 ) tempOutputFile << "#$ -l h_rt=" << getWallTime(edt) << endl ; if( mem > 0 ) -- 2.39.2