+ // If "squeue" failed, the job may be finished. In this case, try to query the job with
+ // "sacct".
+ if (! found) {
+ string subCommand = string("bash -l -c \\\"sacct -X -o State%-10 -n -j ") + jobid.getReference() + "\\\"";
+ string command = _protocol.getExecCommand(subCommand, _hostname, _username);
+ LOG(command);
+ string output;
+ int status = Utils::getCommandOutput(command, output);
+ LOG("status: " << status << ", output: " << output);
+ if (status == 0) {
+ try {
+ jobinfo = JobInfo_Slurm(jobid.getReference(), output);
+ } catch (const RunTimeException & exc) {
+ LOG(exc);
+ throw(exc);
+ }
+ } else {
+ throw RunTimeException("sacct command failed with return code: " + status);
+ }
+ }