From abbee2f6672a49930b2380205d1410360106f8bc Mon Sep 17 00:00:00 2001 From: barate Date: Mon, 23 Sep 2013 13:27:42 +0000 Subject: [PATCH] Add parameter MEMPERCPU (EDF issue #2671) --- src/Core/Constants.cxx | 1 + src/Core/Constants.hxx | 1 + src/Core/ParameterTypeMap.cxx | 1 + src/Slurm/BatchManager_Slurm.cxx | 2 ++ 4 files changed, 5 insertions(+) diff --git a/src/Core/Constants.cxx b/src/Core/Constants.cxx index cc91363..d2d0e74 100644 --- a/src/Core/Constants.cxx +++ b/src/Core/Constants.cxx @@ -49,6 +49,7 @@ namespace Batch { def_Constant(STATE); def_Constant(WORKDIR); def_Constant(EXCLUSIVE); + def_Constant(MEMPERCPU); // Parameters for COORM def_Constant(LAUNCHER_FILE); diff --git a/src/Core/Constants.hxx b/src/Core/Constants.hxx index a18b031..8a08098 100644 --- a/src/Core/Constants.hxx +++ b/src/Core/Constants.hxx @@ -60,6 +60,7 @@ namespace Batch { decl_extern_Constant(STATE); decl_extern_Constant(WORKDIR); decl_extern_Constant(EXCLUSIVE); + decl_extern_Constant(MEMPERCPU); // Parameters for COORM decl_extern_Constant(LAUNCHER_FILE); diff --git a/src/Core/ParameterTypeMap.cxx b/src/Core/ParameterTypeMap.cxx index 1375ada..c20ad71 100644 --- a/src/Core/ParameterTypeMap.cxx +++ b/src/Core/ParameterTypeMap.cxx @@ -62,6 +62,7 @@ namespace Batch { addParameter("STATE", STRING, 1); addParameter("WORKDIR", STRING, 1); addParameter("EXCLUSIVE", BOOL, 1); + addParameter("MEMPERCPU", LONG, 1); // Parameters for COORM addParameter("LAUNCHER_FILE", STRING, 1); diff --git a/src/Slurm/BatchManager_Slurm.cxx b/src/Slurm/BatchManager_Slurm.cxx index d3d46aa..9d62def 100644 --- a/src/Slurm/BatchManager_Slurm.cxx +++ b/src/Slurm/BatchManager_Slurm.cxx @@ -148,6 +148,8 @@ namespace Batch { tempOutputFile << "#SBATCH --time=" << params[MAXWALLTIME] << endl; if (params.find(MAXRAMSIZE) != params.end()) tempOutputFile << "#SBATCH --mem=" << params[MAXRAMSIZE] << endl; + else if (params.find(MEMPERCPU) != params.end()) + tempOutputFile << "#SBATCH --mem-per-cpu=" << params[MEMPERCPU] << endl; if (params.find(QUEUE) != params.end()) tempOutputFile << "#SBATCH --partition=" << params[QUEUE] << endl; -- 2.39.2