This patch fixes the behaviour with allocating 2 cores instead of one with --ntasks-per-socket=1.

/Magnus

On 2013-01-18 13:59, Magnus Jonsson wrote:
Hi!

I'm experimenting with CR_ALLOCATE_FULL_SOCKET and found some weird
behaviour.

Currently running git/master but have seen the same behaviour on 2.4.3
with the #define.

My slurm.conf:

SelectType=select/cons_res
SelectTypeParameters=CR_Socket_Memory,CR_CORE_DEFAULT_DIST_BLOCK,CR_ALLOCATE_FULL_SOCKET


This is my submitscript (the important parts):

#SBATCH -n1
#SBATCH --ntasks-per-socket=1

This gives me (from scontrol show job):

    NumNodes=1 NumCPUs=2 CPUs/Task=1 ReqS:C:T=*:*:*
      Nodes=t-cn1033 CPU_IDs=42-3 Mem=15000

If I submit:

#SBATCH -n6
#SBATCH --ntasks-per-socket=3

it gives me (from scontrol show job):

    NumNodes=1 NumCPUs=6 CPUs/Task=1 ReqS:C:T=*:*:*
      Nodes=t-cn1033 CPU_IDs=36-38,42-44 Mem=15000

I think this is caused by how the ntasks-per-socket code is selecting
nodes in job_test.c of the cons_res-plugin.

I will look into the code and see if I can fix this some how otherwise I
can bug test patches.

I have a small part of our cluster available for testing right now
(2 nodes, 8 sockets/node, 6 cores/socket).

Best regards,
Magnus


--
Magnus Jonsson, Developer, HPC2N, UmeƄ Universitet
diff --git a/src/plugins/select/cons_res/job_test.c b/src/plugins/select/cons_res/job_test.c
index 60ec0b1..96b0dfa 100644
--- a/src/plugins/select/cons_res/job_test.c
+++ b/src/plugins/select/cons_res/job_test.c
@@ -310,7 +310,7 @@ uint16_t _allocate_sockets(struct job_record *job_ptr, bitstr_t *core_map,
 	 *          allocating cores
 	 */
 	cps = num_tasks;
-	if (ntasks_per_socket > 1) {
+	if (ntasks_per_socket >= 1) {
 		cps = ntasks_per_socket;
 		if (cpus_per_task > 1)
 			cps = ntasks_per_socket * cpus_per_task;

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to