2
2
* src/common/env.c - add an environment variable to environment vector
3
3
*****************************************************************************
4
4
* Copyright (C) 2002-2007 The Regents of the University of California.
5
* Copyright (C) 2008 Lawrence Livermore National Security.
5
* Copyright (C) 2008-2009 Lawrence Livermore National Security.
6
6
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
7
7
* Written by Mark Grondona <mgrondona@llnl.gov>, Danny Auble <da@llnl.gov>.
8
* CODE-OCEC-09-009. All rights reserved.
10
10
* This file is part of SLURM, a resource management program.
11
* For details, see <http://www.llnl.gov/linux/slurm/>.
11
* For details, see <https://computing.llnl.gov/linux/slurm/>.
12
* Please also read the included file: DISCLAIMER.
13
14
* SLURM is free software; you can redistribute it and/or modify it under
14
15
* the terms of the GNU General Public License as published by the Free
150
static void _set_distribution(task_dist_states_t distribution,
151
char **dist, char **lllp_dist)
153
if (((int)distribution >= 0)
154
&& (distribution != SLURM_DIST_UNKNOWN)) {
155
switch(distribution) {
156
case SLURM_DIST_CYCLIC:
159
case SLURM_DIST_BLOCK:
162
case SLURM_DIST_PLANE:
164
*lllp_dist = "plane";
166
case SLURM_DIST_ARBITRARY:
169
case SLURM_DIST_CYCLIC_CYCLIC:
171
*lllp_dist = "cyclic";
173
case SLURM_DIST_CYCLIC_BLOCK:
175
*lllp_dist = "block";
177
case SLURM_DIST_BLOCK_CYCLIC:
179
*lllp_dist = "cyclic";
181
case SLURM_DIST_BLOCK_BLOCK:
183
*lllp_dist = "block";
186
error("unknown dist, type %d", distribution);
150
193
* Return the number of elements in the environment `env'
319
361
rc = SLURM_FAILURE;
322
if (((int)env->distribution >= 0)
323
&& (env->distribution != SLURM_DIST_UNKNOWN)) {
324
switch(env->distribution) {
325
case SLURM_DIST_CYCLIC:
329
case SLURM_DIST_BLOCK:
333
case SLURM_DIST_PLANE:
337
case SLURM_DIST_ARBITRARY:
341
case SLURM_DIST_CYCLIC_CYCLIC:
343
lllp_dist = "cyclic";
345
case SLURM_DIST_CYCLIC_BLOCK:
349
case SLURM_DIST_BLOCK_CYCLIC:
351
lllp_dist = "cyclic";
353
case SLURM_DIST_BLOCK_BLOCK:
358
error("unknown dist, type %d", env->distribution);
360
lllp_dist = "unknown";
364
_set_distribution(env->distribution, &dist, &lllp_dist);
364
366
if (setenvf(&env->env, "SLURM_DISTRIBUTION", "%s", dist)) {
365
367
error("Can't set SLURM_DISTRIBUTION env variable");
366
368
rc = SLURM_FAILURE;
369
if (setenvf(&env->env, "SLURM_DIST_PLANESIZE", "%d",
371
if(env->distribution == SLURM_DIST_PLANE)
372
if (setenvf(&env->env, "SLURM_DIST_PLANESIZE", "%u",
370
373
env->plane_size)) {
371
error("Can't set SLURM_DIST_PLANESIZE env variable");
374
error("Can't set SLURM_DIST_PLANESIZE "
372
376
rc = SLURM_FAILURE;
375
380
if (setenvf(&env->env, "SLURM_DIST_LLLP", "%s", lllp_dist)) {
376
381
error("Can't set SLURM_DIST_LLLP env variable");
377
382
rc = SLURM_FAILURE;
381
386
if (env->cpu_bind_type) {
382
387
char *str_verbose, *str_bind_type, *str_bind_list;
386
unsetenvp(env->env, "SLURM_CPU_BIND_VERBOSE");
387
unsetenvp(env->env, "SLURM_CPU_BIND_TYPE");
388
unsetenvp(env->env, "SLURM_CPU_BIND_LIST");
389
unsetenvp(env->env, "SLURM_CPU_BIND");
391
if (env->batch_flag) {
392
unsetenvp(env->env, "SBATCH_CPU_BIND_VERBOSE");
393
unsetenvp(env->env, "SBATCH_CPU_BIND_TYPE");
394
unsetenvp(env->env, "SBATCH_CPU_BIND_LIST");
395
unsetenvp(env->env, "SBATCH_CPU_BIND");
397
unsetenvp(env->env, "SLURM_CPU_BIND_VERBOSE");
398
unsetenvp(env->env, "SLURM_CPU_BIND_TYPE");
399
unsetenvp(env->env, "SLURM_CPU_BIND_LIST");
400
unsetenvp(env->env, "SLURM_CPU_BIND");
391
403
str_verbose = xstrdup ("");
392
404
if (env->cpu_bind_type & CPU_BIND_VERBOSE) {
395
407
xstrcat(str_verbose, "quiet");
397
if (setenvf(&env->env, "SLURM_CPU_BIND_VERBOSE", str_verbose)) {
398
error("Unable to set SLURM_CPU_BIND_VERBOSE");
402
409
str_bind_type = xstrdup ("");
403
410
if (env->cpu_bind_type & CPU_BIND_TO_THREADS) {
404
411
xstrcat(str_bind_type, "threads,");
406
413
xstrcat(str_bind_type, "cores,");
407
414
} else if (env->cpu_bind_type & CPU_BIND_TO_SOCKETS) {
408
415
xstrcat(str_bind_type, "sockets,");
416
} else if (env->cpu_bind_type & CPU_BIND_TO_LDOMS) {
417
xstrcat(str_bind_type, "ldoms,");
410
419
if (env->cpu_bind_type & CPU_BIND_NONE) {
411
420
xstrcat(str_bind_type, "none");
415
424
xstrcat(str_bind_type, "map_cpu:");
416
425
} else if (env->cpu_bind_type & CPU_BIND_MASK) {
417
426
xstrcat(str_bind_type, "mask_cpu:");
427
} else if (env->cpu_bind_type & CPU_BIND_LDRANK) {
428
xstrcat(str_bind_type, "rank_ldom");
429
} else if (env->cpu_bind_type & CPU_BIND_LDMAP) {
430
xstrcat(str_bind_type, "map_ldom:");
431
} else if (env->cpu_bind_type & CPU_BIND_LDMASK) {
432
xstrcat(str_bind_type, "mask_ldom:");
419
434
len = strlen(str_bind_type);
420
435
if (len) { /* remove a possible trailing ',' */
422
437
str_bind_type[len-1] = '\0';
425
if (setenvf(&env->env, "SLURM_CPU_BIND_TYPE", str_bind_type)) {
426
error("Unable to set SLURM_CPU_BIND_TYPE");
430
440
str_bind_list = xstrdup ("");
431
441
if (env->cpu_bind) {
432
442
xstrcat(str_bind_list, env->cpu_bind);
434
if (setenvf(&env->env, "SLURM_CPU_BIND_LIST", str_bind_list)) {
435
error("Unable to set SLURM_CPU_BIND_LIST");
439
444
str_bind = xstrdup ("");
440
445
xstrcat(str_bind, str_verbose);
441
if (str_bind[0]) { /* add ',' if str_verbose */
446
if (str_bind[0] && str_bind_type && str_bind_type[0])
442
447
xstrcatchar(str_bind, ',');
444
448
xstrcat(str_bind, str_bind_type);
445
449
xstrcat(str_bind, str_bind_list);
447
if (setenvf(&env->env, "SLURM_CPU_BIND", str_bind)) {
448
error("Unable to set SLURM_CPU_BIND");
451
if (env->batch_flag) {
452
if (setenvf(&env->env, "SBATCH_CPU_BIND_VERBOSE",
454
error("Unable to set SBATCH_CPU_BIND_VERBOSE");
457
if (setenvf(&env->env, "SBATCH_CPU_BIND_TYPE",
459
error("Unable to set SBATCH_CPU_BIND_TYPE");
462
if (setenvf(&env->env, "SBATCH_CPU_BIND_LIST",
464
error("Unable to set SBATCH_CPU_BIND_LIST");
467
if (setenvf(&env->env, "SBATCH_CPU_BIND", str_bind)) {
468
error("Unable to set SBATCH_CPU_BIND");
472
if (setenvf(&env->env, "SLURM_CPU_BIND_VERBOSE",
474
error("Unable to set SLURM_CPU_BIND_VERBOSE");
477
if (setenvf(&env->env, "SLURM_CPU_BIND_TYPE",
479
error("Unable to set SLURM_CPU_BIND_TYPE");
482
if (setenvf(&env->env, "SLURM_CPU_BIND_LIST",
484
error("Unable to set SLURM_CPU_BIND_LIST");
487
if (setenvf(&env->env, "SLURM_CPU_BIND", str_bind)) {
488
error("Unable to set SLURM_CPU_BIND");
454
495
char *str_verbose, *str_bind_type, *str_bind_list;
457
unsetenvp(env->env, "SLURM_MEM_BIND_VERBOSE");
458
unsetenvp(env->env, "SLURM_MEM_BIND_TYPE");
459
unsetenvp(env->env, "SLURM_MEM_BIND_LIST");
460
unsetenvp(env->env, "SLURM_MEM_BIND");
498
if (env->batch_flag) {
499
unsetenvp(env->env, "SBATCH_MEM_BIND_VERBOSE");
500
unsetenvp(env->env, "SBATCH_MEM_BIND_TYPE");
501
unsetenvp(env->env, "SBATCH_MEM_BIND_LIST");
502
unsetenvp(env->env, "SBATCH_MEM_BIND");
504
unsetenvp(env->env, "SLURM_MEM_BIND_VERBOSE");
505
unsetenvp(env->env, "SLURM_MEM_BIND_TYPE");
506
unsetenvp(env->env, "SLURM_MEM_BIND_LIST");
507
unsetenvp(env->env, "SLURM_MEM_BIND");
462
510
str_verbose = xstrdup ("");
463
511
if (env->mem_bind_type & MEM_BIND_VERBOSE) {
466
514
xstrcat(str_verbose, "quiet");
468
if (setenvf(&env->env, "SLURM_MEM_BIND_VERBOSE", str_verbose)) {
469
error("Unable to set SLURM_MEM_BIND_VERBOSE");
473
516
str_bind_type = xstrdup ("");
474
517
if (env->mem_bind_type & MEM_BIND_NONE) {
475
518
xstrcat(str_bind_type, "none");
482
525
} else if (env->mem_bind_type & MEM_BIND_LOCAL) {
483
526
xstrcat(str_bind_type, "local");
485
if (setenvf(&env->env, "SLURM_MEM_BIND_TYPE", str_bind_type)) {
486
error("Unable to set SLURM_MEM_BIND_TYPE");
490
528
str_bind_list = xstrdup ("");
491
529
if (env->mem_bind) {
492
530
xstrcat(str_bind_list, env->mem_bind);
494
if (setenvf(&env->env, "SLURM_MEM_BIND_LIST", str_bind_list)) {
495
error("Unable to set SLURM_MEM_BIND_LIST");
499
532
str_bind = xstrdup ("");
500
533
xstrcat(str_bind, str_verbose);
501
534
if (str_bind[0]) { /* add ',' if str_verbose */
504
537
xstrcat(str_bind, str_bind_type);
505
538
xstrcat(str_bind, str_bind_list);
507
if (setenvf(&env->env, "SLURM_MEM_BIND", str_bind)) {
508
error("Unable to set SLURM_MEM_BIND");
540
if (env->batch_flag) {
541
if (setenvf(&env->env, "SBATCH_MEM_BIND_VERBOSE",
543
error("Unable to set SBATCH_MEM_BIND_VERBOSE");
546
if (setenvf(&env->env, "SBATCH_MEM_BIND_TYPE",
548
error("Unable to set SBATCH_MEM_BIND_TYPE");
551
if (setenvf(&env->env, "SBATCH_MEM_BIND_LIST",
553
error("Unable to set SBATCH_MEM_BIND_LIST");
556
if (setenvf(&env->env, "SBATCH_MEM_BIND", str_bind)) {
557
error("Unable to set SBATCH_MEM_BIND");
561
if (setenvf(&env->env, "SLURM_MEM_BIND_VERBOSE",
563
error("Unable to set SLURM_MEM_BIND_VERBOSE");
566
if (setenvf(&env->env, "SLURM_MEM_BIND_TYPE",
568
error("Unable to set SLURM_MEM_BIND_TYPE");
571
if (setenvf(&env->env, "SLURM_MEM_BIND_LIST",
573
error("Unable to set SLURM_MEM_BIND_LIST");
576
if (setenvf(&env->env, "SLURM_MEM_BIND", str_bind)) {
577
error("Unable to set SLURM_MEM_BIND");
560
630
error("Can't set MPIRUN_PARTITION "
561
631
"environment variable");
636
char *resv_id = NULL;
637
select_g_get_jobinfo(env->select_jobinfo,
638
SELECT_DATA_RESV_ID, &resv_id);
640
if(setenvf(&env->env,
641
"BASIL_RESVERATION_ID", "%s", resv_id))
646
if(rc == SLURM_FAILURE)
647
error("Can't set BASIL_RESVERATION_ID "
648
"environment variable");
567
&& setenvf(&env->env, "SLURM_JOBID", "%d", env->jobid)) {
568
error("Unable to set SLURM_JOBID environment");
653
if (env->jobid >= 0) {
654
if (setenvf(&env->env, "SLURM_JOB_ID", "%d", env->jobid)) {
655
error("Unable to set SLURM_JOB_ID environment");
658
/* and for backwards compatability... */
659
if (setenvf(&env->env, "SLURM_JOBID", "%d", env->jobid)) {
660
error("Unable to set SLURM_JOBID environment");
572
665
if (env->nodeid >= 0
618
711
error ("Can't set SLURM_SRUN_COMM_PORT env variable");
619
712
rc = SLURM_FAILURE;
621
if (env->comm_hostname
622
&& setenvf (&env->env, "SLURM_SRUN_COMM_HOST", "%s",
623
env->comm_hostname)) {
624
error ("Can't set SLURM_SRUN_COMM_HOST env variable");
630
717
slurm_print_slurm_addr (env->cli, addrbuf, INET_ADDRSTRLEN);
683
770
error("Can't set SLURM_PTY_WIN_ROW env variable");
684
771
rc = SLURM_FAILURE;
687
&& setenvf(&env->env, "SLURM_CHECKPOINT_PATH", "%s", env->ckpt_path)) {
688
error("Can't set SLURM_CHECKPOINT_PATH env variable");
774
&& setenvf(&env->env, "SLURM_CHECKPOINT_IMAGE_DIR", "%s",
776
error("Can't set SLURM_CHECKPOINT_IMAGE_DIR env variable");
780
if (env->restart_cnt &&
781
setenvf(&env->env, "SLURM_RESTART_COUNT", "%u", env->restart_cnt)) {
782
error("Can't set SLURM_RESTART_COUNT env variable");
744
839
* The cpus-per-node representation in SLURM (and perhaps tasks-per-node
745
840
* in the future) is stored in a compressed format comprised of two
746
* equal-length arrays of uint32_t, and an integer holding the array length.
747
* In one array an element represents a count (number of cpus, number of tasks,
841
* equal-length arrays, and an integer holding the array length. In one
842
* array an element represents a count (number of cpus, number of tasks,
748
843
* etc.), and the corresponding element in the other array contains the
749
844
* number of times the count is repeated sequentially in the uncompressed
750
845
* something-per-node array.
787
882
* SLURM_JOB_NODELIST
788
883
* SLURM_JOB_CPUS_PER_NODE
789
884
* LOADLBATCH (AIX only)
790
* MPIRUN_PARTITION, MPIRUN_NOFREE, and MPIRUN_NOALLOCATE (BGL only)
885
* SLURM_BG_NUM_NODES, MPIRUN_PARTITION, MPIRUN_NOFREE, and
886
* MPIRUN_NOALLOCATE (BGL only)
792
888
* Sets OBSOLETE variables (needed for MPI, do not remove):
796
892
* SLURM_TASKS_PER_NODE
799
895
env_array_for_job(char ***dest, const resource_allocation_response_msg_t *alloc,
800
896
const job_desc_msg_t *desc)
899
char *resv_id = NULL;
802
901
char *tmp = NULL;
902
char *dist = NULL, *lllp_dist = NULL;
803
903
slurm_step_layout_t *step_layout = NULL;
804
904
uint32_t num_tasks = desc->num_tasks;
905
int rc = SLURM_SUCCESS;
908
uint32_t node_cnt = alloc->node_cnt;
909
select_g_get_jobinfo(alloc->select_jobinfo,
910
SELECT_DATA_NODE_CNT,
912
env_array_overwrite_fmt(dest, "SLURM_BG_NUM_NODES", "%u", node_cnt);
806
915
env_array_overwrite_fmt(dest, "SLURM_JOB_ID", "%u", alloc->job_id);
807
916
env_array_overwrite_fmt(dest, "SLURM_JOB_NUM_NODES", "%u",
809
918
env_array_overwrite_fmt(dest, "SLURM_JOB_NODELIST", "%s",
810
919
alloc->node_list);
812
tmp = uint32_compressed_to_str((uint32_t)alloc->num_cpu_groups,
921
_set_distribution(desc->task_dist, &dist, &lllp_dist);
923
env_array_overwrite_fmt(dest, "SLURM_DISTRIBUTION", "%s",
926
if(desc->task_dist == SLURM_DIST_PLANE)
927
env_array_overwrite_fmt(dest, "SLURM_DIST_PLANESIZE",
928
"%u", desc->plane_size);
931
env_array_overwrite_fmt(dest, "SLURM_DIST_LLLP", "%s",
934
tmp = uint32_compressed_to_str(alloc->num_cpu_groups,
813
935
alloc->cpus_per_node,
814
936
alloc->cpu_count_reps);
815
937
env_array_overwrite_fmt(dest, "SLURM_JOB_CPUS_PER_NODE", "%s", tmp);
969
select_g_get_jobinfo(alloc->select_jobinfo, SELECT_DATA_RESV_ID,
972
env_array_overwrite_fmt(dest, "BASIL_RESERVATION_ID", "%s",
845
977
/* OBSOLETE, but needed by MPI, do not remove */
846
978
env_array_overwrite_fmt(dest, "SLURM_JOBID", "%u", alloc->job_id);
847
979
env_array_overwrite_fmt(dest, "SLURM_NNODES", "%u", alloc->node_cnt);
864
996
&& desc->cpus_per_task != (uint16_t)NO_VAL)
865
997
num_tasks /= desc->cpus_per_task;
866
998
//num_tasks = desc->num_procs;
1001
if(desc->task_dist == SLURM_DIST_ARBITRARY) {
1002
tmp = desc->req_nodes;
1003
env_array_overwrite_fmt(dest, "SLURM_ARBITRARY_NODELIST",
1006
tmp = alloc->node_list;
868
1007
//info("got %d and %d", num_tasks, desc->cpus_per_task);
869
step_layout = slurm_step_layout_create(alloc->node_list,
870
alloc->cpus_per_node,
871
alloc->cpu_count_reps,
1008
if(!(step_layout = slurm_step_layout_create(tmp,
1009
alloc->cpus_per_node,
1010
alloc->cpu_count_reps,
1013
desc->cpus_per_task,
877
1019
tmp = _uint16_array_to_str(step_layout->node_cnt,
878
1020
step_layout->tasks);
879
1021
slurm_step_layout_destroy(step_layout);
880
1022
env_array_overwrite_fmt(dest, "SLURM_TASKS_PER_NODE", "%s", tmp);
905
1048
* SLURM_TASKS_PER_NODE
908
1051
env_array_for_batch_job(char ***dest, const batch_job_launch_msg_t *batch,
909
1052
const char *node_name)
911
char *tmp = getenvp(batch->environment, "SLURM_CPUS_PER_TASK");
912
1055
uint32_t num_nodes = 0;
913
1056
uint32_t num_cpus = 0;
915
1058
slurm_step_layout_t *step_layout = NULL;
916
int cpus_per_task = 1;
917
1059
uint32_t num_tasks = batch->nprocs;
1060
uint16_t cpus_per_task;
920
cpus_per_task = atoi(tmp);
1064
uint32_t node_cnt = 0;
1065
select_g_get_jobinfo(batch->select_jobinfo,
1066
SELECT_DATA_NODE_CNT,
1068
env_array_overwrite_fmt(dest, "SLURM_BG_NUM_NODES", "%u", node_cnt);
922
1070
/* There is no explicit node count in the batch structure,
923
so we need to calculate the node count. We also need to
924
figure out the explicit cpu count so we can figure out the
1071
* so we need to calculate the node count. */
926
1072
for (i = 0; i < batch->num_cpu_groups; i++) {
927
1073
num_nodes += batch->cpu_count_reps[i];
928
1074
num_cpus += batch->cpu_count_reps[i] * batch->cpus_per_node[i];
931
1077
env_array_overwrite_fmt(dest, "SLURM_JOB_ID", "%u", batch->job_id);
932
1078
env_array_overwrite_fmt(dest, "SLURM_JOB_NUM_NODES", "%u", num_nodes);
933
1079
env_array_overwrite_fmt(dest, "SLURM_JOB_NODELIST", "%s", batch->nodes);
934
tmp = uint32_compressed_to_str((uint32_t)batch->num_cpu_groups,
935
batch->cpus_per_node,
936
batch->cpu_count_reps);
1081
tmp = uint32_compressed_to_str(batch->num_cpu_groups,
1082
batch->cpus_per_node,
1083
batch->cpu_count_reps);
937
1084
env_array_overwrite_fmt(dest, "SLURM_JOB_CPUS_PER_NODE", "%s", tmp);
953
1100
env_array_overwrite_fmt(dest, "SLURM_NPROCS", "%u",
1103
if((batch->cpus_per_task != 0) &&
1104
(batch->cpus_per_task != (uint16_t) NO_VAL))
1105
cpus_per_task = batch->cpus_per_task;
1107
cpus_per_task = 1; /* default value */
1108
if (cpus_per_task > 1) {
1109
env_array_overwrite_fmt(dest, "SLURM_CPUS_PER_TASK", "%u",
1113
if((tmp = getenvp(*dest, "SLURM_ARBITRARY_NODELIST"))) {
1114
task_dist = SLURM_DIST_ARBITRARY;
1115
num_tasks = batch->nprocs;
1118
task_dist = SLURM_DIST_BLOCK;
956
1119
num_tasks = num_cpus / cpus_per_task;
958
step_layout = slurm_step_layout_create(batch->nodes,
959
batch->cpus_per_node,
960
batch->cpu_count_reps,
963
(uint16_t)cpus_per_task,
1122
if(!(step_layout = slurm_step_layout_create(tmp,
1123
batch->cpus_per_node,
1124
batch->cpu_count_reps,
967
1132
tmp = _uint16_array_to_str(step_layout->node_cnt,
968
1133
step_layout->tasks);
969
1134
slurm_step_layout_destroy(step_layout);
970
1135
env_array_overwrite_fmt(dest, "SLURM_TASKS_PER_NODE", "%s", tmp);
1137
return SLURM_SUCCESS;
976
1143
* overwriting any environment variables of the same name. If the address
977
1144
* pointed to by "dest" is NULL, memory will automatically be xmalloc'ed.
978
1145
* The array is terminated by a NULL pointer, and thus is suitable for
979
* use by execle() and other env_array_* functions.
1146
* use by execle() and other env_array_* functions. If preserve_env is
1147
* true, the variables SLURM_NNODES, SLURM_NPROCS and SLURM_TASKS_PER_NODE
981
1150
* Sets variables:
983
1152
* SLURM_STEP_NUM_NODES
984
1153
* SLURM_STEP_NUM_TASKS
985
1154
* SLURM_STEP_TASKS_PER_NODE
986
* SLURM_STEP_LAUNCHER_HOSTNAME
987
1155
* SLURM_STEP_LAUNCHER_PORT
988
1156
* SLURM_STEP_LAUNCHER_IPADDR
1157
* SLURM_STEP_RESV_PORTS
990
1159
* Sets OBSOLETE variables:
1015
1184
env_array_overwrite_fmt(dest, "SLURM_STEP_NUM_TASKS",
1016
1185
"%u", step->step_layout->task_cnt);
1017
1186
env_array_overwrite_fmt(dest, "SLURM_STEP_TASKS_PER_NODE", "%s", tmp);
1018
env_array_overwrite_fmt(dest, "SLURM_STEP_LAUNCHER_HOSTNAME",
1019
"%s", launcher_hostname);
1020
1187
env_array_overwrite_fmt(dest, "SLURM_STEP_LAUNCHER_PORT",
1021
1188
"%hu", launcher_port);
1189
if (step->resv_ports) {
1190
env_array_overwrite_fmt(dest, "SLURM_STEP_RESV_PORTS",
1191
"%s", step->resv_ports);
1023
1194
/* OBSOLETE, but needed by MPI, do not remove */
1024
1195
env_array_overwrite_fmt(dest, "SLURM_STEPID", "%u", step->job_step_id);
1025
env_array_overwrite_fmt(dest, "SLURM_NNODES",
1026
"%hu", step->step_layout->node_cnt);
1027
env_array_overwrite_fmt(dest, "SLURM_NPROCS",
1028
"%u", step->step_layout->task_cnt);
1029
env_array_overwrite_fmt(dest, "SLURM_TASKS_PER_NODE", "%s", tmp);
1196
if (!preserve_env) {
1197
env_array_overwrite_fmt(dest, "SLURM_NNODES",
1198
"%hu", step->step_layout->node_cnt);
1199
env_array_overwrite_fmt(dest, "SLURM_NPROCS",
1200
"%u", step->step_layout->task_cnt);
1201
env_array_overwrite_fmt(dest, "SLURM_TASKS_PER_NODE", "%s",
1030
1204
env_array_overwrite_fmt(dest, "SLURM_SRUN_COMM_PORT",
1031
1205
"%hu", launcher_port);