aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2024-09-10 19:02:40 +0100
committerArun Isaac2024-09-10 19:02:40 +0100
commitab4a50a66e0d8a474f5ff8c15b7745a9d2cec732 (patch)
tree66d729a097b0726ab7e2dff50b7beec87ed50df5
parente3da733094145d63fbe8bfa69d1f7b3702c5225f (diff)
downloadravanan-ab4a50a66e0d8a474f5ff8c15b7745a9d2cec732.tar.gz
ravanan-ab4a50a66e0d8a474f5ff8c15b7745a9d2cec732.tar.lz
ravanan-ab4a50a66e0d8a474f5ff8c15b7745a9d2cec732.zip
slurm-api: Set name of job.
* ravanan/slurm-api.scm (submit-job): Accept name argument and set it as the job name. * ravanan/command-line-tool.scm (run-command-line-tool): Pass name to submit-job.
-rw-r--r--ravanan/command-line-tool.scm1
-rw-r--r--ravanan/slurm-api.scm14
2 files changed, 8 insertions, 7 deletions
diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm
index 9541207..cbb81c4 100644
--- a/ravanan/command-line-tool.scm
+++ b/ravanan/command-line-tool.scm
@@ -559,6 +559,7 @@ path."
,store-data-file))
stdout-file
stderr-file
+ name
script
#:api-endpoint slurm-api-endpoint
#:jwt slurm-jwt)))
diff --git a/ravanan/slurm-api.scm b/ravanan/slurm-api.scm
index 6092b26..4ed02b5 100644
--- a/ravanan/slurm-api.scm
+++ b/ravanan/slurm-api.scm
@@ -62,15 +62,15 @@ document and pass in as the body of the HTTP request."
#:body (call-with-output-bytevector
(cut scm->json body-scm <>))))
-(define* (submit-job environment stdout-file stderr-file script
+(define* (submit-job environment stdout-file stderr-file name script
#:key api-endpoint jwt)
- "Submit job @var{script} to slurm via @var{api-endpoint} and
-authenticating using @var{jwt}. @var{environment} is an association
-list of environment variables to set in the job. @var{stdout-file} and
-@var{stderr-file} are files in which to write the stdout and stderr of
-the job respectively."
+ "Submit job named @var{name} running @var{script} to slurm via @var{api-endpoint}
+and authenticating using @var{jwt}. @var{environment} is an association list of
+environment variables to set in the job. @var{stdout-file} and @var{stderr-file}
+are files in which to write the stdout and stderr of the job respectively."
(define job-spec
- `(("script" . ,(string-append "#!/bin/bash\n" script))
+ `(("name" . ,name)
+ ("script" . ,(string-append "#!/bin/bash\n" script))
("environment" . ,(list->vector
(map (match-lambda
((name . value)