From ab4a50a66e0d8a474f5ff8c15b7745a9d2cec732 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 10 Sep 2024 19:02:40 +0100 Subject: 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. --- ravanan/command-line-tool.scm | 1 + ravanan/slurm-api.scm | 14 +++++++------- 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) -- cgit v1.2.3