Ticket 1351

Summary: array_task_id defined as uint16_t not uint32_t in src/srun/libsrun/fname.c
Product: Slurm Reporter: Chris Samuel <samuel>
Component: OtherAssignee: David Bigagli <david>
Status: RESOLVED FIXED QA Contact:
Severity: 4 - Minor Issue    
Priority: --- CC: brian, da, jacob
Version: 15.08.x   
Hardware: Linux   
OS: Linux   
Site: VLSCI Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: 14.11.3 Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---

Description Chris Samuel 2015-01-05 13:04:03 MST
Hi there,

I was just grep'ing the Slurm code after seeing a mention about an old bug after array_task_id was upgraded from uint16_t to uint32_t and noticed that there was still one mentioned left of it in master (also 14.11 and 14.03):

samuel@haswell:~/Code/Slurm$ git grep array_task_id | fgrep uint16_t
src/srun/libsrun/fname.c:       uint16_t array_task_id = (uint16_t) NO_VAL;

I've also just noticed that (in addition) 14.03 and 14.11 also have:

samuel@haswell:~/Code/Slurm$ git grep array_task_id | fgrep -w uint16_t
src/common/slurm_protocol_pack.c:               pack16((uint16_t) msg->array_task_id, buffer);
src/slurmctld/job_mgr.c:                pack16((uint16_t) dump_job_ptr->array_task_id, buffer);
src/slurmctld/step_mgr.c:               pack16((uint16_t) step_ptr->job_ptr->array_task_id, buffer);

(I've removed the fname.c match from that list)

I would guess these are all likely to be oversights from that conversion (though I could be wrong, not being a programmer).
Comment 1 David Bigagli 2015-01-06 08:14:50 MST
Hi,
   the uint16_t value in libbsrun.c is indeed a bug. We have fixed in it in 14.11.3, commit 8d67b0323.

The protocol operation are correct as the library has to handle different
Slurm versions, in this case it is packing the array_task_id to a 2.6 version
which uses 16 bit for that variable.

Thanks,
          David
Comment 2 Chris Samuel 2015-01-07 09:26:28 MST
Thanks David!