aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-08-28 15:08:07 +0200
committerThomas White <taw@physics.org>2020-08-28 15:08:07 +0200
commit3002e04ec239b5dc48ef426cb1136f7937f0bb0e (patch)
treedb77b986ad8b98556a691c469483ffbf6216908b
parentbbe0b812c930335a4ee33b376584a350ffae40b2 (diff)
SLURM: Add environment
-rw-r--r--src/gui_backend_slurm.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui_backend_slurm.c b/src/gui_backend_slurm.c
index 4b1ba73f..d96c69d2 100644
--- a/src/gui_backend_slurm.c
+++ b/src/gui_backend_slurm.c
@@ -72,6 +72,20 @@ static void cancel_task(void *job_priv)
}
+static char **create_env(uint32_t *psize)
+{
+ char **env;
+
+ env = malloc(10*sizeof(char *));
+ if ( env == NULL ) return NULL;
+
+ env[0] = strdup("PATH=/path/to/indexamajig");
+ *psize = 1;
+
+ return env;
+}
+
+
static void *run_indexing(const char *job_title,
const char *job_notes,
char **filenames,
@@ -151,7 +165,7 @@ static void *run_indexing(const char *job_title,
job_desc_msg.std_out = strdup("job.out");
job_desc_msg.work_dir = g_file_get_path(workdir_file);
job_desc_msg.script = script;
- //environment/env_size
+ job_desc_msg.environment = create_env(&job_desc_msg.env_size);
r = slurm_submit_batch_job(&job_desc_msg, &resp);