diff --git a/NEWS b/NEWS index e2d491ab6e7d78004a997c3e1ab5dceee46a731b..5e29899155fb662c98883fdbc0f11418986070dc 100644 --- a/NEWS +++ b/NEWS @@ -60,6 +60,11 @@ documents those changes that are of interest to users and admins. -- When restarting slurmctld with priority/basic, increment all job priorities so the highest job priority becomes TOP_PRIORITY. +* Changes in SLURM 2.2.3 +======================== + -- Update srun, salloc, and sbatch man page description of --distribution + option. Patches from Rod Schulz, Bull. + * Changes in SLURM 2.2.2 ======================== -- Correct logic to set correct job hold state (admin or user) when setting @@ -108,6 +113,9 @@ documents those changes that are of interest to users and admins. -- Removed remnant code for enforcing max sockets/cores/threads in the cons_res plugin (see last item in 2.1.0-pre5). This was responsible for a bug reported by Rod Schultz. + -- BLUEGENE - Set correct env vars for HTC mode on a P system to get correct + block. + -- Correct RunTime reported by "scontrol show job" for pending jobs. * Changes in SLURM 2.2.1 ======================== diff --git a/doc/man/man1/salloc.1 b/doc/man/man1/salloc.1 index 31cb371e74042c199537580a0178de7640fae7a1..52e1622acb89e74a751e61f463b8de2fd7e1b899 100644 --- a/doc/man/man1/salloc.1 +++ b/doc/man/man1/salloc.1 @@ -460,11 +460,25 @@ Multiple license names should be comma separated (e.g. .TP \fB\-m\fR, \fB\-\-distribution\fR= -<\fIblock\fR|\fIcyclic\fR|\fIarbitrary\fR|\fIplane=<options>\fR> -Specify an alternate distribution method for remote processes. In -salloc, this only sets environment variables that will be used by +<\fIblock\fR|\fIcyclic\fR|\fIarbitrary\fR|\fIplane=<options>\fR[:\fIblock\fR|\fIcyclic\fR]> + +Specify alternate distribution methods for remote processes. +In salloc, this only sets environment variables that will be used by subsequent srun requests. +This option does not affect the allocation of resources to +a job or step, but only the assignment of tasks to the nodes on which +resources have been allocated, and the distribution of those resources +to tasks for binding (task affinity). The first distribution +method (before the ":") controls the distribution of resources across +nodes. The optional second distribution method (after the ":") +controls the distribution of resources across sockets within a node. +Note that with select/cons_res, the number of cpus allocated on each +socket and node may be different. Refer to the mc_support.html document +for more information on resource allocation, assignment of tasks to +nodes, and binding of tasks to CPUs. .RS + +First distribution method: .TP .B block The block distribution method will distribute tasks to a node such @@ -484,9 +498,9 @@ will distribute those tasks to the nodes with tasks one and four on the first node, task two on the second node, and task three on the third node. Note that when SelectType is select/cons_res the same number of CPUs -may not be allocated on each node with the \-n (\-\-ntasks) option. +may not be allocated on each node. Distribution will be round\-robin among all the nodes with CPUs yet to -be assigned to tasks. If you want the same number of CPUs allocated on +be assigned tasks. If you want the same number of CPUs allocated on all nodes, use the \-\-ntasks\-per\-node option. Cyclic distribution is the default behavior if the number of tasks is no larger than the number of allocated nodes. @@ -505,12 +519,26 @@ and https://computing.llnl.gov/linux/slurm/dist_plane.html. .TP .B arbitrary -The arbitrary method of distribution will allocate processes in\-order as -listed in file designated by the environment variable SLURM_HOSTFILE. If -this variable is listed it will over ride any other method specified. -If not set the method will default to block. Inside the hostfile must -contain at minimum the number of hosts requested. If requesting tasks -(\-n) your tasks will be laid out on the nodes in the order of the file. +The arbitrary method of distribution will allocate processes in\-order +as listed in file designated by the environment variable +SLURM_HOSTFILE. If this variable is listed it will over ride any +other method specified. If not set the method will default to block. +Inside the hostfile must contain at minimum the number of hosts +requested and be one per line or comma separated. If specifying a +task count (\fB\-n\fR, \fB\-\-ntasks\fR=<\fInumber\fR>), your tasks +will be laid out on the nodes in the order of the file. +.TP + +Second distribution method: +.TP +.B block +The block distribution method will distribute tasks to sockets such +that consecutive tasks share a socket. +.TP +.B cyclic +The cyclic distribution method will distribute tasks to sockets such +that consecutive tasks are distributed over consecutive sockets (in a +round\-robin fashion). .RE .TP diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1 index da7548c91f1f9fa66a9d585216458a45f02cb3d9..94d9f085ca6c548f57ecac1fed080e40ba3ddbe4 100644 --- a/doc/man/man1/sbatch.1 +++ b/doc/man/man1/sbatch.1 @@ -514,11 +514,25 @@ between clusters. .TP \fB\-m\fR, \fB\-\-distribution\fR= -<\fIblock\fR|\fIcyclic\fR|\fIarbitrary\fR|\fIplane=<options>\fR> -Specify an alternate distribution method for remote processes. In -sbatch, this only sets environment variables that will be used by +<\fIblock\fR|\fIcyclic\fR|\fIarbitrary\fR|\fIplane=<options>\fR[:\fIblock\fR|\fIcyclic\fR]> + +Specify alternate distribution methods for remote processes. +In sbatch, this only sets environment variables that will be used by subsequent srun requests. +This option does not affect the allocation of resources to +a job or step, but only the assignment of tasks to the nodes on which +resources have been allocated, and the distribution of those resources +to tasks for binding (task affinity). The first distribution +method (before the ":") controls the distribution of resources across +nodes. The optional second distribution method (after the ":") +controls the distribution of resources across sockets within a node. +Note that with select/cons_res, the number of cpus allocated on each +socket and node may be different. Refer to the mc_support.html document +for more information on resource allocation, assignment of tasks to +nodes, and binding of tasks to CPUs. .RS + +First distribution method: .TP .B block The block distribution method will distribute tasks to a node such @@ -538,9 +552,9 @@ will distribute those tasks to the nodes with tasks one and four on the first node, task two on the second node, and task three on the third node. Note that when SelectType is select/cons_res the same number of CPUs -may not be allocated on each node with the \-n (\-\-ntasks) option. +may not be allocated on each node. Distribution will be round\-robin among all the nodes with CPUs yet to -be assigned to tasks. If you want the same number of CPUs allocated on +be assigned tasks. If you want the same number of CPUs allocated on all nodes, use the \-\-ntasks\-per\-node option. Cyclic distribution is the default behavior if the number of tasks is no larger than the number of allocated nodes. @@ -559,12 +573,26 @@ and https://computing.llnl.gov/linux/slurm/dist_plane.html. .TP .B arbitrary -The arbitrary method of distribution will allocate processes in\-order as -listed in file designated by the environment variable SLURM_HOSTFILE. If -this variable is listed it will override any other method specified. -If not set the method will default to block. Inside the hostfile must -contain at minimum the number of hosts requested. If requesting tasks -(\-n) your tasks will be laid out on the nodes in the order of the file. +The arbitrary method of distribution will allocate processes in\-order +as listed in file designated by the environment variable +SLURM_HOSTFILE. If this variable is listed it will over ride any +other method specified. If not set the method will default to block. +Inside the hostfile must contain at minimum the number of hosts +requested and be one per line or comma separated. If specifying a +task count (\fB\-n\fR, \fB\-\-ntasks\fR=<\fInumber\fR>), your tasks +will be laid out on the nodes in the order of the file. +.TP + +Second distribution method: +.TP +.B block +The block distribution method will distribute tasks to sockets such +that consecutive tasks share a socket. +.TP +.B cyclic +The cyclic distribution method will distribute tasks to sockets such +that consecutive tasks are distributed over consecutive sockets (in a +round\-robin fashion). .RE .TP diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1 index ccf4aa9ce146f1072a2057ef727e7fe6f8da5b64..dea67f3593afd3b7bdd11c72b437d574f2c39ee5 100644 --- a/doc/man/man1/srun.1 +++ b/doc/man/man1/srun.1 @@ -513,9 +513,23 @@ Multiple license names should be comma separated (e.g. .TP \fB\-m\fR, \fB\-\-distribution\fR= -<\fIblock\fR|\fIcyclic\fR|\fIarbitrary\fR|\fIplane=<options>\fR> -Specify an alternate distribution method for remote processes. +<\fIblock\fR|\fIcyclic\fR|\fIarbitrary\fR|\fIplane=<options>\fR[:\fIblock\fR|\fIcyclic\fR]> + +Specify alternate distribution methods for remote processes. +This option does not affect the allocation of resources to +a job or step, but only the assignment of tasks to the nodes on which +resources have been allocated, and the distribution of those resources +to tasks for binding (task affinity). The first distribution +method (before the ":") controls the distribution of resources across +nodes. The optional second distribution method (after the ":") +controls the distribution of resources across sockets within a node. +Note that with select/cons_res, the number of cpus allocated on each +socket and node may be different. Refer to the mc_support.html document +for more information on resource allocation, assignment of tasks to +nodes, and binding of tasks to CPUs. .RS + +First distribution method: .TP .B block The block distribution method will distribute tasks to a node such @@ -533,11 +547,11 @@ round\-robin fashion). For example, consider an allocation of three nodes each with two cpus. A four\-task cyclic distribution request will distribute those tasks to the nodes with tasks one and four on the first node, task two on the second node, and task three on the -third node. +third node. Note that when SelectType is select/cons_res the same number of CPUs -may not be allocated on each node with the \-n (\-\-ntasks) option. +may not be allocated on each node. Distribution will be round\-robin among all the nodes with CPUs yet to -be assigned to tasks. If you want the same number of CPUs allocated on +be assigned tasks. If you want the same number of CPUs allocated on all nodes, use the \-\-ntasks\-per\-node option. Cyclic distribution is the default behavior if the number of tasks is no larger than the number of allocated nodes. @@ -564,6 +578,18 @@ Inside the hostfile must contain at minimum the number of hosts requested and be one per line or comma separated. If specifying a task count (\fB\-n\fR, \fB\-\-ntasks\fR=<\fInumber\fR>), your tasks will be laid out on the nodes in the order of the file. +.TP + +Second distribution method: +.TP +.B block +The block distribution method will distribute tasks to sockets such +that consecutive tasks share a socket. +.TP +.B cyclic +The cyclic distribution method will distribute tasks to sockets such +that consecutive tasks are distributed over consecutive sockets (in a +round\-robin fashion). .RE .TP diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5 index d29974128e46436c50fb3be5f30fa3a30ab7ca68..8786d62fb5bb9c2a479f4ef58186f6193c1c45f7 100644 --- a/doc/man/man5/slurm.conf.5 +++ b/doc/man/man5/slurm.conf.5 @@ -1497,8 +1497,6 @@ thread on nodes with more than one \fBThreadsPerCore\fR configured. .TP \fBCR_CORE_DEFAULT_DIST_BLOCK\fR Allocate cores using block distribution by default. -This default behavior can be overridden specifying a particular -"\-m" parameter with srun/salloc/sbatch. Without this option, cores will be allocated cyclicly across the sockets. .TP \fBCR_Socket\fR diff --git a/src/api/job_info.c b/src/api/job_info.c index e237142ac73a2979530b390a291ddeff2d8b45f3..ddf28f39867e650f3d8d708550a7e3f6b231ffca 100644 --- a/src/api/job_info.c +++ b/src/api/job_info.c @@ -261,20 +261,23 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner ) line6: snprintf(tmp_line, sizeof(tmp_line), "RunTime="); xstrcat(out, tmp_line); - - run_time = time(NULL); - if (IS_JOB_SUSPENDED(job_ptr)) + if (IS_JOB_PENDING(job_ptr)) + run_time = 0; + else if (IS_JOB_SUSPENDED(job_ptr)) run_time = job_ptr->pre_sus_time; else { - if (!IS_JOB_RUNNING(job_ptr) && (job_ptr->end_time != 0)) - run_time = job_ptr->end_time; + time_t end_time; + if (IS_JOB_RUNNING(job_ptr) || (job_ptr->end_time == 0)) + end_time = time(NULL); + else + end_time = job_ptr->end_time; if (job_ptr->suspend_time) { run_time = (time_t) - (difftime(run_time, job_ptr->suspend_time) + (difftime(end_time, job_ptr->suspend_time) + job_ptr->pre_sus_time); } else run_time = (time_t) - difftime(run_time, job_ptr->start_time); + difftime(end_time, job_ptr->start_time); } secs2time_str(run_time, tmp1, sizeof(tmp1)); sprintf(tmp_line, "%s ", tmp1); diff --git a/src/common/env.c b/src/common/env.c index 3688392b35155404174d1e2a9406828ab03038bd..8963a639ad80ca6c7d16707867feec8288159beb 100644 --- a/src/common/env.c +++ b/src/common/env.c @@ -94,7 +94,8 @@ static int _setup_particulars(uint32_t cluster_flags, SELECT_JOBDATA_BLOCK_ID, &bg_part_id); if (bg_part_id) { - if (cluster_flags & CLUSTER_FLAG_BGL) { + /* check to see if this is a HTC block or not. */ + if (cluster_flags & CLUSTER_FLAG_BGP) { uint16_t conn_type = (uint16_t)NO_VAL; select_g_select_jobinfo_get( @@ -102,6 +103,8 @@ static int _setup_particulars(uint32_t cluster_flags, SELECT_JOBDATA_CONN_TYPE, &conn_type); if (conn_type > SELECT_SMALL) { + /* SUBMIT_POOL over rides + HTC_SUBMIT_POOL */ setenvf(dest, "SUBMIT_POOL", "%s", bg_part_id); } diff --git a/src/plugins/sched/backfill/backfill.c b/src/plugins/sched/backfill/backfill.c index deb2bfab2e1fa5244102e155efa30886f6e8cbb9..fb091a6a071b802edd181b282772d1460c81f8bc 100644 --- a/src/plugins/sched/backfill/backfill.c +++ b/src/plugins/sched/backfill/backfill.c @@ -229,6 +229,8 @@ static int _num_feature_count(struct job_record *job_ptr) return rc; feat_iter = list_iterator_create(detail_ptr->feature_list); + if (feat_iter == NULL) + fatal("list_iterator_create: malloc failure"); while ((feat_ptr = (struct feature_record *) list_next(feat_iter))) { if (feat_ptr->count) rc++; @@ -270,6 +272,8 @@ static int _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap, list_size = list_count(detail_ptr->feature_list); feat_cnt_orig = xmalloc(sizeof(uint16_t) * list_size); feat_iter = list_iterator_create(detail_ptr->feature_list); + if (feat_iter == NULL) + fatal("list_iterator_create: malloc failure"); while ((feat_ptr = (struct feature_record *) list_next(feat_iter))) { high_cnt = MAX(high_cnt, feat_ptr->count); diff --git a/src/plugins/select/cons_res/select_cons_res.c b/src/plugins/select/cons_res/select_cons_res.c index a9fdd9f2b5938d276086e3dac4a5f2809bba48eb..4eae32fa4e22ca723d919bac1fa20e6f8ff044a0 100644 --- a/src/plugins/select/cons_res/select_cons_res.c +++ b/src/plugins/select/cons_res/select_cons_res.c @@ -109,6 +109,23 @@ #define NODEINFO_MAGIC 0x82aa +/* The following parameters can be used to speed up the logic used to determine + * when and where a pending job will be able to start, but it will reduce + * the accuracy with which backfill scheduling is performed. It may improve + * performance of sched/backfill considerably if there are many running jobs. + * The original logic would simulate removing running jobs one at a time from + * an emulated system and test if the pending job could start on the resources + * then available. The new logic will remove jobs individually until + * SCHED_SKIP_START jobs have been removed then remove SCHED_SKIP_COUNT jobs + * at each iteration until the job can be scheduled. */ +#ifndef SCHED_SKIP_START +#define SCHED_SKIP_START 50 +#endif + +#ifndef SCHED_SKIP_COUNT +#define SCHED_SKIP_COUNT 10 +#endif + /* These are defined here so when we link with something other than * the slurmctld we will have these symbols defined. They will get * overwritten when linking with the slurmctld. @@ -1467,8 +1484,12 @@ static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, } /* Remove the running jobs one at a time from exp_node_cr and try - * scheduling the pending job after each one */ + * scheduling the pending job after each one. For larger job counts, + * remove multiple jobs between tests to reduce overhead. */ if (rc != SLURM_SUCCESS) { + int jobs_rm_last_test = 0; + int jobs_rm_total = 0; + int jobs_run_total = list_count(cr_job_list); list_sort(cr_job_list, _cr_job_list_sort); job_iterator = list_iterator_create(cr_job_list); if (job_iterator == NULL) @@ -1476,6 +1497,13 @@ static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, while ((tmp_job_ptr = list_next(job_iterator))) { _rm_job_from_res(future_part, future_usage, tmp_job_ptr, 0); + jobs_rm_total++; + jobs_rm_last_test++; + if ((jobs_rm_total > SCHED_SKIP_START) && + (jobs_rm_total < jobs_run_total) && + (jobs_rm_last_test < SCHED_SKIP_COUNT)) + continue; + jobs_rm_last_test = 0; bit_or(bitmap, orig_map); rc = cr_job_test(job_ptr, bitmap, min_nodes, max_nodes, req_nodes, diff --git a/src/salloc/salloc.c b/src/salloc/salloc.c index eee2b5758f821ab7e8199285a1c6c27b5bee194c..cf7ed4e93aff8bbb321c2e4de93fa61338abdb24 100644 --- a/src/salloc/salloc.c +++ b/src/salloc/salloc.c @@ -84,6 +84,7 @@ int command_argc; pid_t command_pid = -1; char *work_dir = NULL; static int is_interactive; +static bool is_foreground; enum possible_allocation_states allocation_state = NOT_GRANTED; pthread_mutex_t allocation_state_lock = PTHREAD_MUTEX_INITIALIZER; @@ -205,7 +206,8 @@ int main(int argc, char *argv[]) _set_rlimits(env); } - if ((!opt.no_shell) && isatty(STDIN_FILENO)) { + is_interactive = isatty(STDIN_FILENO); + if ((!opt.no_shell) && is_interactive) { /* * Job control: interactive sub-processes run in the foreground * process group of the controlling terminal. In order to grant @@ -222,17 +224,17 @@ int main(int argc, char *argv[]) } killpg(pid, SIGTTIN); } - is_interactive = true; + is_foreground = true; #else if (tcgetpgrp(STDIN_FILENO) == pid) - is_interactive = true; + is_foreground = true; #endif } /* * Save tty attributes and reset at exit, in case a child * process died before properly resetting terminal. */ - if (is_interactive) { + if (is_foreground) { tcgetattr (STDIN_FILENO, &saved_tty_attributes); atexit (_reset_input_mode); } diff --git a/src/slurmctld/job_scheduler.c b/src/slurmctld/job_scheduler.c index ce5f8a210263b3575711ea084c9a8334ca401b0e..be37e4e28652acb5e7381943cf13b8eeea7234d8 100644 --- a/src/slurmctld/job_scheduler.c +++ b/src/slurmctld/job_scheduler.c @@ -1284,12 +1284,25 @@ static char **_build_env(struct job_record *job_ptr) (const char **) job_ptr->spank_job_env); } -#if defined(HAVE_BG) +#ifdef HAVE_BG select_g_select_jobinfo_get(job_ptr->select_jobinfo, SELECT_JOBDATA_BLOCK_ID, &name); setenvf(&my_env, "MPIRUN_PARTITION", "%s", name); +# ifdef HAVE_BGP + { + uint16_t conn_type = (uint16_t)NO_VAL; + select_g_select_jobinfo_get(job_ptr->select_jobinfo, + SELECT_JOBDATA_CONN_TYPE, + &conn_type); + if (conn_type > SELECT_SMALL) { + /* SUBMIT_POOL over rides + HTC_SUBMIT_POOL */ + setenvf(&my_env, "SUBMIT_POOL", "%s", name); + } + } +# endif xfree(name); -#elif defined(HAVE_CRAY) +#elif defined HAVE_CRAY name = select_g_select_jobinfo_xstrdup(job_ptr->select_jobinfo, SELECT_PRINT_RESV_ID); setenvf(&my_env, "BASIL_RESERVATION_ID", "%s", name); diff --git a/src/slurmd/slurmd/req.c b/src/slurmd/slurmd/req.c index e7d35aca720ff64c1696ba5103620a8120c3b9ca..558dbecfaa8895f960c8fa4bb25ba6572ba9ef78 100644 --- a/src/slurmd/slurmd/req.c +++ b/src/slurmd/slurmd/req.c @@ -842,14 +842,6 @@ _check_job_credential(launch_tasks_request_msg_t *req, uid_t uid, error("cons_res: zero processors allocated to step"); step_cores = 1; } - if (tasks_to_launch > step_cores) { - /* This is expected with the --overcommit option - * or hyperthreads */ - debug("cons_res: More than one tasks per logical " - "processor (%d > %u) on host [%u.%u %ld %s] ", - tasks_to_launch, step_cores, arg.jobid, - arg.stepid, (long) arg.uid, arg.step_hostlist); - } /* NOTE: step_cores is the count of allocated resources * (typically cores). Convert to CPU count as needed */ if (i_last_bit <= i_first_bit) @@ -861,6 +853,14 @@ _check_job_credential(launch_tasks_request_msg_t *req, uid_t uid, step_cores *= i; } } + if (tasks_to_launch > step_cores) { + /* This is expected with the --overcommit option + * or hyperthreads */ + debug("cons_res: More than one tasks per logical " + "processor (%d > %u) on host [%u.%u %ld %s] ", + tasks_to_launch, step_cores, arg.jobid, + arg.stepid, (long) arg.uid, arg.step_hostlist); + } } else { step_cores = 1; job_cores = 1; @@ -3673,6 +3673,10 @@ _build_env(uint32_t jobid, uid_t uid, char *resv_id, if (resv_id) { #if defined(HAVE_BG) setenvf(&env, "MPIRUN_PARTITION", "%s", resv_id); +# ifdef HAVE_BGP + /* Needed for HTC jobs */ + setenvf(&env, "SUBMIT_POOL", "%s", resv_id); +# endif #elif defined(HAVE_CRAY) setenvf(&env, "BASIL_RESERVATION_ID", "%s", resv_id); #endif diff --git a/src/slurmd/slurmd/slurmd.c b/src/slurmd/slurmd/slurmd.c index fd89fcdd3c6a3c5aeb520c728fcd74af4b5b0d41..b318fc91db20659e51ea17570256c0735cf1fd70 100644 --- a/src/slurmd/slurmd/slurmd.c +++ b/src/slurmd/slurmd/slurmd.c @@ -777,7 +777,8 @@ _read_config(bool reconfig) &conf->block_map, &conf->block_map_inv); if (((cf->fast_schedule == 0) && !cr_flag && !gang_flag) || - (conf->actual_cpus < conf->conf_cpus)) { + ((cf->fast_schedule == 1) && + (conf->actual_cpus < conf->conf_cpus))) { conf->cpus = conf->actual_cpus; conf->sockets = conf->actual_sockets; conf->cores = conf->actual_cores; diff --git a/testsuite/expect/test1.84 b/testsuite/expect/test1.84 index 36616dd582fc5afc047aa7eabd1fc92689e8f438..73501be01c7a0f6e3675a122adf758bffb86900b 100755 --- a/testsuite/expect/test1.84 +++ b/testsuite/expect/test1.84 @@ -71,7 +71,7 @@ set host "" set timeout $max_job_delay set task_cnt 0 -set srun_pid [spawn $srun -N1 --cpus-per-task=1 --threads-per-core=1 --exclusive -l -t1 $file_in] +set srun_pid [spawn $srun -N1 --cpus-per-task=1 --exclusive -l -t1 $file_in] expect { -re "SLURM_CPUS_ON_NODE=($number) SLURMD_NODENAME=($alpha_numeric_under)" { set cpu_cnt $expect_out(1,string) @@ -107,6 +107,7 @@ if {[string compare $host ""] == 0} { } # Convert CPU count to core count if necessary if {$cpu_cnt != $task_cnt} { + set core_cnt $cpu_cnt set threads_per_core 1 spawn $scontrol show node $host expect { @@ -123,10 +124,10 @@ if {$cpu_cnt != $task_cnt} { } } if {$threads_per_core != 0} { - set cpu_cnt [expr $cpu_cnt / $threads_per_core] + set cpu_cnt [expr $cpu_cnt * $threads_per_core] } if {$cpu_cnt == $task_cnt} { - send_user "NOTE: Allocated cores and $threads_per_core CPUs per core\n" + send_user "NOTE: Allocated $core_cnt cores and $threads_per_core CPUs per core\n" } } if {$cpu_cnt != $task_cnt} { @@ -141,10 +142,10 @@ if {$cpu_cnt < 2} { } # -# Submit a 1 node job to determine the node's CPU count +# Now verify the --cpus-per-task option # set task_cnt 0 -set srun_pid [spawn $srun -N1 -t1 --nodelist=$host --cpus-per-task=2 --threads-per-core=1 --exclusive -l $bin_printenv SLURMD_NODENAME] +set srun_pid [spawn $srun -N1 --cpus-per-task=2 --exclusive -l -t1 --nodelist=$host $bin_printenv SLURMD_NODENAME] expect { -re "Invalid node name specified" { send_user "\nWARNING: Appears you are using " @@ -167,7 +168,7 @@ expect { } # -# Check CPU count +# Verify that half the number of tasks were spawned # if {$task_cnt != [expr $cpu_cnt / 2]} { send_user "\nFAILURE: Improper task count for given cpus-per-task\n"