diff --git a/src/plugins/burst_buffer/cray/burst_buffer_cray.c b/src/plugins/burst_buffer/cray/burst_buffer_cray.c index f68989ee40f05ca0d30372f8c9eead8327808c36..3031d654456611276611dbc46a55c2774c300ad4 100644 --- a/src/plugins/burst_buffer/cray/burst_buffer_cray.c +++ b/src/plugins/burst_buffer/cray/burst_buffer_cray.c @@ -3181,7 +3181,7 @@ extern int bb_p_job_validate2(struct job_record *job_ptr, char **err_msg) dw_cli_path = xstrdup(bb_state.bb_config.get_sys_state); slurm_mutex_unlock(&bb_state.bb_mutex); - /* Standard file location for job arrays, version 16.05+ */ + /* Standard file location for job arrays */ if ((job_ptr->array_task_id != NO_VAL) && (job_ptr->array_job_id != job_ptr->job_id)) { hash_inx = job_ptr->array_job_id % 10; @@ -3198,6 +3198,15 @@ extern int bb_p_job_validate2(struct job_record *job_ptr, char **err_msg) } else { xfree(hash_dir); } + } else { + hash_inx = job_ptr->job_id % 10; + xstrfmtcat(hash_dir, "%s/hash.%d", state_save_loc, hash_inx); + (void) mkdir(hash_dir, 0700); + xstrfmtcat(job_dir, "%s/job.%u", hash_dir, job_ptr->job_id); + (void) mkdir(job_dir, 0700); + xstrfmtcat(script_file, "%s/script", job_dir); + if (job_ptr->batch_flag == 0) + rc = _build_bb_script(job_ptr, script_file); } /* Run "job_process" function, validates user script */ diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index f3c106d5eccb81bb0dbb8d8e258511ca4cc9d5b4..ad2be37eb6cd3b6a879e0c7f71713d53c264db28 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -6581,7 +6581,7 @@ char **get_job_env(struct job_record *job_ptr, uint32_t * env_size) char *file_name = NULL, job_dir[40], **environment = NULL; int cc, fd = -1, hash; - /* Standard file location for job arrays, version 16.05+ */ + /* Standard file location for job arrays */ if (job_ptr->array_task_id != NO_VAL) { hash = job_ptr->array_job_id % 10; sprintf(job_dir, "/hash.%d/job.%u/environment", @@ -6590,6 +6590,14 @@ char **get_job_env(struct job_record *job_ptr, uint32_t * env_size) file_name = slurm_get_state_save_location(); xstrcat(file_name, job_dir); fd = open(file_name, 0); + } else { + hash = job_ptr->job_id % 10; + sprintf(job_dir, "/hash.%d/job.%u/environment", + hash, job_ptr->job_id); + xfree(file_name); + file_name = slurm_get_state_save_location(); + xstrcat(file_name, job_dir); + fd = open(file_name, 0); } if (fd >= 0) { @@ -6620,7 +6628,7 @@ char *get_job_script(struct job_record *job_ptr) if (!job_ptr->batch_flag) return NULL; - /* Standard file location for job arrays, version 16.05+ */ + /* Standard file location for job arrays */ if (job_ptr->array_task_id != NO_VAL) { hash = job_ptr->array_job_id % 10; sprintf(job_dir, "/hash.%d/job.%u/script", @@ -6629,6 +6637,14 @@ char *get_job_script(struct job_record *job_ptr) file_name = slurm_get_state_save_location(); xstrcat(file_name, job_dir); fd = open(file_name, 0); + } else { + hash = job_ptr->job_id % 10; + sprintf(job_dir, "/hash.%d/job.%u/script", + hash, job_ptr->job_id); + xfree(file_name); + file_name = slurm_get_state_save_location(); + xstrcat(file_name, job_dir); + fd = open(file_name, 0); } if (fd >= 0) {