In TMS/src/server/Env.cpp, in the replaceEnvVariables method, there is the following code for SLURM (line 82):
pos = scriptContent.find("$VISHNU_BATCHJOB_NODEFILE");
if(pos!=std::string::npos) {
std::string fileName = "/tmp/NODELIST_XXXXXX";
vishnu::createTmpFile(const_cast<char*>(fileName.c_str()));
pos = scriptContent.rfind("\n", pos-1);
scriptContent.insert(pos+1, "echo $SLURM_JOB_NODELIST > "+fileName+"\n");
std::string tmp = "echo $SLURM_JOB_NODELIST > "+fileName+"\n";
scriptContent.insert(pos+1+tmp.size(), "sed -i 's/,/\\n/g' "+fileName+"\n");
replaceAllOccurences(scriptContent, "$VISHNU_BATCHJOB_NODEFILE", fileName);
replaceAllOccurences(scriptContent, "${VISHNU_BATCHJOB_NODEFILE}", fileName);
scriptContent.insert(scriptContent.size()-1, "\n rm "+fileName+"\n");
}
I think this won't work, as /tmp/NODELIST_XXXXXX will be generated on the gateway, and not on a node where the script will run. It would be better to generate this in the home directory.