Salome HOME
spns #32755 : TopIIVolMesh: move back to master branch
[tools/sat_salome.git] / products / patches / libbatch_slurm_orcus.patch
1 diff --git a/src/Slurm/BatchManager_Slurm.cxx b/src/Slurm/BatchManager_Slurm.cxx
2 index 1c7f8d7..a1e28ed 100644
3 --- a/src/Slurm/BatchManager_Slurm.cxx
4 +++ b/src/Slurm/BatchManager_Slurm.cxx
5 @@ -64,7 +64,7 @@ namespace Batch {
6      string cmdFile = buildCommandFile(job);
7  
8      // define command to submit batch
9 -    string subCommand = string("cd ") + workDir + "; sbatch " + cmdFile;
10 +    string subCommand = string("bash -l -c \\\"cd ") + workDir + "; sbatch " + cmdFile + "\\\"";
11      string command = _protocol.getExecCommand(subCommand, _hostname, _username);
12      command += " 2>&1";
13      LOG(command);
14 @@ -203,7 +203,7 @@ namespace Batch {
15    void BatchManager_Slurm::deleteJob(const JobId & jobid)
16    {
17      // define command to delete job
18 -    string subCommand = "scancel " + jobid.getReference();
19 +    string subCommand = string("bash -l -c \\\"scancel ") + jobid.getReference() + "\\\"";
20      string command = _protocol.getExecCommand(subCommand, _hostname, _username);
21      LOG(command);
22  
23 @@ -217,7 +217,7 @@ namespace Batch {
24    JobInfo BatchManager_Slurm::queryJob(const JobId & jobid)
25    {
26      // First try to query the job with "squeue" command
27 -    string subCommand = "squeue -h -o %T -j " + jobid.getReference() + " 2>/dev/null";
28 +    string subCommand = string("bash -l -c \\\"squeue -h -o %T -j ") + jobid.getReference() + " 2>/dev/null" + "\\\"";
29      string command = _protocol.getExecCommand(subCommand, _hostname, _username);
30      LOG(command);
31      string output;
32 @@ -237,7 +237,7 @@ namespace Batch {
33      // If "squeue" failed, the job may be finished. In this case, try to query the job with
34      // "sacct".
35      if (! found) {
36 -        string subCommand = "sacct -X -o State%-10 -n -j " + jobid.getReference();
37 +        string subCommand = string("bash -l -c \\\"sacct -X -o State%-10 -n -j ") + jobid.getReference() + "\\\"";
38          string command = _protocol.getExecCommand(subCommand, _hostname, _username);
39          LOG(command);
40          string output;