Skip to content

Commit

Permalink
sim: overwrite batch_inx for make_batch_job_cred and step_set_alloc_tres
Browse files Browse the repository at this point in the history
  • Loading branch information
nsimakov committed Feb 9, 2024
1 parent b848730 commit f99a71e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/slurmctld/job_scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,10 @@ extern int make_batch_job_cred(batch_job_launch_msg_t *launch_msg_ptr,
cred_arg.step_id.step_id = SLURM_BATCH_SCRIPT;
cred_arg.step_id.step_het_comp = NO_VAL;
if (job_resrcs_ptr->memory_allocated) {
#ifdef SLURM_SIMULATOR
// due to front-end mode
int batch_inx = 0;
#else
int batch_inx = job_get_node_inx(
job_ptr->batch_host, job_ptr->node_bitmap);

Expand All @@ -2682,6 +2686,7 @@ extern int make_batch_job_cred(batch_job_launch_msg_t *launch_msg_ptr,
__func__, job_ptr->batch_host, job_ptr);
batch_inx = 0;
}
#endif
cred_arg.job_mem_alloc = xmalloc(sizeof(uint64_t));
cred_arg.job_mem_alloc[0] =
job_resrcs_ptr->memory_allocated[batch_inx];
Expand Down
5 changes: 5 additions & 0 deletions src/slurmctld/step_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4548,13 +4548,18 @@ extern void step_set_alloc_tres(step_record_t *step_ptr, uint32_t node_count,
* job specific job_resrcs structure.
*/
if (job_ptr->batch_host) {
#ifdef SLURM_SIMULATOR
// due to front-end mode
batch_inx = 0;
#else
batch_inx = job_get_node_inx(
job_ptr->batch_host, job_ptr->node_bitmap);
if (batch_inx == -1) {
error("%s: Invalid batch host %s for %pJ; this should never happen",
__func__, job_ptr->batch_host, job_ptr);
batch_inx = 0;
}
#endif
}

/* get the cpus and memory on the first node */
Expand Down

0 comments on commit f99a71e

Please sign in to comment.