Skip to content
Snippets Groups Projects
Commit 8d67b032 authored by David Bigagli's avatar David Bigagli
Browse files

Fix the size of array_task_id in fname.c from 16 to 32 bit.

parent 745208e8
No related branches found
No related tags found
No related merge requests found
...@@ -72,8 +72,9 @@ fname_create(srun_job_t *job, char *format) ...@@ -72,8 +72,9 @@ fname_create(srun_job_t *job, char *format)
fname_t *fname = NULL; fname_t *fname = NULL;
char *p, *q, *name, *tmp_env; char *p, *q, *name, *tmp_env;
uint32_t array_job_id = job->jobid; uint32_t array_job_id = job->jobid;
uint16_t array_task_id = (uint16_t) NO_VAL; uint32_t array_task_id = NO_VAL;
char *esc; char *esc;
char *end;
fname = xmalloc(sizeof(*fname)); fname = xmalloc(sizeof(*fname));
fname->type = IO_ALL; fname->type = IO_ALL;
...@@ -141,17 +142,17 @@ fname_create(srun_job_t *job, char *format) ...@@ -141,17 +142,17 @@ fname_create(srun_job_t *job, char *format)
case 'a': /* '%a' => array task id */ case 'a': /* '%a' => array task id */
tmp_env = getenv("SLURM_ARRAY_TASK_ID"); tmp_env = getenv("SLURM_ARRAY_TASK_ID");
if (tmp_env) if (tmp_env)
array_task_id = atoi(tmp_env); array_task_id = strtoul(tmp_env, &end, 10);
xmemcat(name, q, p - 1); xmemcat(name, q, p - 1);
xstrfmtcat(name, "%0*d", wid, array_task_id); xstrfmtcat(name, "%0*u", wid, array_task_id);
q = ++p; q = ++p;
break; break;
case 'A': /* '%A' => array master job id */ case 'A': /* '%A' => array master job id */
tmp_env = getenv("SLURM_ARRAY_JOB_ID"); tmp_env = getenv("SLURM_ARRAY_JOB_ID");
if (tmp_env) if (tmp_env)
array_job_id = atoi(tmp_env); array_job_id = strtoul(tmp_env, &end, 10);
xmemcat(name, q, p - 1); xmemcat(name, q, p - 1);
xstrfmtcat(name, "%0*d", wid, array_job_id); xstrfmtcat(name, "%0*u", wid, array_job_id);
q = ++p; q = ++p;
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment