xenon-middleware / xenon-cli

Perform files and jobs operations with Xenon library from command line
http://nlesc.github.io/Xenon/
Apache License 2.0
2 stars 3 forks source link

Job accounting info doesn't include node list in JSON #76

Open arnikz opened 4 years ago

arnikz commented 4 years ago
$ xenon --json scheduler slurm --location local:// list --identifier 194906
{
  "statuses": [
    {
      "jobIdentifier": "194906",
      "name": "smk.delly_s",
      "state": "COMPLETED",
      "exitCode": 0,
      "running": false,
      "done": true,
      "schedulerSpecificInformation": {
        "Partition": "normal",
        "Comment": "",
        "DerivedExitCode": "0:0",
        "User": "xyz",
        "Start": "2020-11-09T13:31:26",
        "Priority": "1907",
        "NTasks": "",
        "ExitCode": "0:0",
        "JobName": "smk.delly_s",
        "State": "COMPLETED",
        "Elapsed": "00:00:15",
        "Submit": "2020-11-09T13:31:26",
        "End": "2020-11-09T13:31:41",
        "NNodes": "1",
        "AllocCPUS": "2",
        "Suspended": "00:00:00",
        "Timelimit": "00:15:00",
        "JobID": "194906"
      }
    }
  ]
}
sverhoeven commented 4 years ago

Correct, Xenon fetched "JobID,JobName,Partition,NTasks,Elapsed,State,ExitCode,AllocCPUS,DerivedExitCode,Submit,Suspended,Start,User,End,NNodes,Timelimit,Comment,Priority" fields for completed jobs in https://github.com/xenon-middleware/xenon/blob/master/src/main/java/nl/esciencecenter/xenon/adaptors/schedulers/slurm/SlurmScheduler.java#L332-L333. Which is missing NodeList.

We could add NodeList to sacct command and %N to squeue command, but this could open up floodgates for even more fields. To just fetch everything you can use sacct --helpformat to get list of all fields and concat them for get the completed job info and squeue has %all format to report all fields. There will be differences between Slurm version, Slurm deployments, non-completed vs completed jobs, but as the info is in schedulerSpecificInformation that should be OK.

arnikz commented 4 years ago
xenon --version
Xenon CLI v3.0.5, Xenon library v3.1.0, Xenon cloud library v3.0.2

This works fine when using the gridengine scheduler (i.e., hostname included in JSON).

arnikz commented 4 years ago

We could add NodeList to sacct command and %N to squeue command, but this could open up floodgates for even more fields.

Having NodeList in the output would be sufficient and consistent with the GE's hostname, and one can use one command for basic accounting info.