View | Details | Raw Unified | Return to ticket 3383
Collapse All | Expand All

(-)a/doc/man/man1/salloc.1 (-6 / +13 lines)
Lines 724-731 This parameter is a group among the groups of the user. Link Here
724
Default value is calculated by the Plugin mcs if it's enabled.
724
Default value is calculated by the Plugin mcs if it's enabled.
725
725
726
.TP
726
.TP
727
\fB\-\-mem\fR=<\fIMB\fR>
727
\fB\-\-mem\fR=<\fIsize[units]\fR>
728
Specify the real memory required per node in megabytes.
728
Specify the real memory required per node.
729
Default units are megabytes unless the SchedulerParameters configuration
730
parameter includes the "default_gbytes" option for gigabytes.
729
Different units can be specified using the suffix [K|M|G|T].
731
Different units can be specified using the suffix [K|M|G|T].
730
Default value is \fBDefMemPerNode\fR and the maximum value is
732
Default value is \fBDefMemPerNode\fR and the maximum value is
731
\fBMaxMemPerNode\fR. If configured, both of parameters can be
733
\fBMaxMemPerNode\fR. If configured, both of parameters can be
Lines 748-755 the job's Resident Set Size (RSS). A task may exceed the memory limit until Link Here
748
the next periodic accounting sample.
750
the next periodic accounting sample.
749
751
750
.TP
752
.TP
751
\fB\-\-mem\-per\-cpu\fR=<\fIMB\fR>
753
\fB\-\-mem\-per\-cpu\fR=<\fIsize[units]\fR>
752
Minimum memory required per allocated CPU in megabytes.
754
Minimum memory required per allocated CPU.
755
Default units are megabytes unless the SchedulerParameters configuration
756
parameter includes the "default_gbytes" option for gigabytes.
753
Different units can be specified using the suffix [K|M|G|T].
757
Different units can be specified using the suffix [K|M|G|T].
754
Default value is \fBDefMemPerCPU\fR and the maximum value is \fBMaxMemPerCPU\fR
758
Default value is \fBDefMemPerCPU\fR and the maximum value is \fBMaxMemPerCPU\fR
755
(see exception below). If configured, both of parameters can be
759
(see exception below). If configured, both of parameters can be
Lines 1299-1306 Acceptable time formats include "minutes", "minutes:seconds", Link Here
1299
"days\-hours:minutes:seconds".
1303
"days\-hours:minutes:seconds".
1300
1304
1301
.TP
1305
.TP
1302
\fB\-\-tmp\fR=<\fIMB\fR>
1306
\fB\-\-tmp\fR=<\fIsize[units]\fR>
1303
Specify a minimum amount of temporary disk space.
1307
Specify a minimum amount of temporary disk space per node.
1308
Default units are megabytes unless the SchedulerParameters configuration
1309
parameter includes the "default_gbytes" option for gigabytes.
1310
Different units can be specified using the suffix [K|M|G|T].
1304
1311
1305
.TP
1312
.TP
1306
\fB\-u\fR, \fB\-\-usage\fR
1313
\fB\-u\fR, \fB\-\-usage\fR
(-)a/doc/man/man1/sbatch.1 (-7 / +13 lines)
Lines 820-827 This parameter is a group among the groups of the user. Link Here
820
Default value is calculated by the Plugin mcs if it's enabled.
820
Default value is calculated by the Plugin mcs if it's enabled.
821
821
822
.TP
822
.TP
823
\fB\-\-mem\fR=<\fIMB\fR>
823
\fB\-\-mem\fR=<\fIsize[units]\fR>
824
Specify the real memory required per node in megabytes.
824
Specify the real memory required per node.
825
Default units are megabytes unless the SchedulerParameters configuration
826
parameter includes the "default_gbytes" option for gigabytes.
825
Different units can be specified using the suffix [K|M|G|T].
827
Different units can be specified using the suffix [K|M|G|T].
826
Default value is \fBDefMemPerNode\fR and the maximum value is
828
Default value is \fBDefMemPerNode\fR and the maximum value is
827
\fBMaxMemPerNode\fR. If configured, both parameters can be
829
\fBMaxMemPerNode\fR. If configured, both parameters can be
Lines 844-852 the job's Resident Set Size (RSS). A task may exceed the memory limit until Link Here
844
the next periodic accounting sample.
846
the next periodic accounting sample.
845
847
846
.TP
848
.TP
847
\fB\-\-mem\-per\-cpu\fR=<\fIMB\fR>
849
\fB\-\-mem\-per\-cpu\fR=<\fIsize[units]\fR>
848
Minimum memory required per allocated CPU in megabytes.
850
Minimum memory required per allocated CPU.
849
Different units can be specified using the suffix [K|M|G|T].
851
Default units are megabytes unless the SchedulerParameters configuration
852
parameter includes the "default_gbytes" option for gigabytes.
850
Default value is \fBDefMemPerCPU\fR and the maximum value is \fBMaxMemPerCPU\fR
853
Default value is \fBDefMemPerCPU\fR and the maximum value is \fBMaxMemPerCPU\fR
851
(see exception below). If configured, both parameters can be
854
(see exception below). If configured, both parameters can be
852
seen using the \fBscontrol show config\fR command.
855
seen using the \fBscontrol show config\fR command.
Lines 1479-1486 Acceptable time formats include "minutes", "minutes:seconds", Link Here
1479
"days\-hours:minutes:seconds".
1482
"days\-hours:minutes:seconds".
1480
1483
1481
.TP
1484
.TP
1482
\fB\-\-tmp\fR=<\fIMB\fR>
1485
\fB\-\-tmp\fR=<\fIsize[units]\fR>
1483
Specify a minimum amount of temporary disk space.
1486
Specify a minimum amount of temporary disk space per node.
1487
Default units are megabytes unless the SchedulerParameters configuration
1488
parameter includes the "default_gbytes" option for gigabytes.
1489
Different units can be specified using the suffix [K|M|G|T].
1484
1490
1485
.TP
1491
.TP
1486
\fB\-u\fR, \fB\-\-usage\fR
1492
\fB\-u\fR, \fB\-\-usage\fR
(-)a/doc/man/man1/srun.1 (-7 / +14 lines)
Lines 1076-1083 Default value is calculated by the Plugin mcs if it's enabled. This option Link Here
1076
applies to job allocations.
1076
applies to job allocations.
1077
1077
1078
.TP
1078
.TP
1079
\fB\-\-mem\fR=<\fIMB\fR>
1079
\fB\-\-mem\fR=<\fIsize[units]\fR>
1080
Specify the real memory required per node in megabytes.
1080
Specify the real memory required per node.
1081
Default units are megabytes unless the SchedulerParameters configuration
1082
parameter includes the "default_gbytes" option for gigabytes.
1081
Different units can be specified using the suffix [K|M|G|T].
1083
Different units can be specified using the suffix [K|M|G|T].
1082
Default value is \fBDefMemPerNode\fR and the maximum value is
1084
Default value is \fBDefMemPerNode\fR and the maximum value is
1083
\fBMaxMemPerNode\fR. If configured, both of parameters can be
1085
\fBMaxMemPerNode\fR. If configured, both of parameters can be
Lines 1105-1112 the next periodic accounting sample. Link Here
1105
This option applies to job and step allocations.
1107
This option applies to job and step allocations.
1106
1108
1107
.TP
1109
.TP
1108
\fB\-\-mem\-per\-cpu\fR=<\fIMB\fR>
1110
\fB\-\-mem\-per\-cpu\fR=<\fIsize[units]\fR>
1109
Minimum memory required per allocated CPU in megabytes.
1111
Minimum memory required per allocated CPU.
1112
Default units are megabytes unless the SchedulerParameters configuration
1113
parameter includes the "default_gbytes" option for gigabytes.
1110
Different units can be specified using the suffix [K|M|G|T].
1114
Different units can be specified using the suffix [K|M|G|T].
1111
Default value is \fBDefMemPerCPU\fR and the maximum value is \fBMaxMemPerCPU\fR
1115
Default value is \fBDefMemPerCPU\fR and the maximum value is \fBMaxMemPerCPU\fR
1112
(see exception below). If configured, both of parameters can be
1116
(see exception below). If configured, both of parameters can be
Lines 1941-1949 Acceptable time formats include "minutes", "minutes:seconds", Link Here
1941
"days\-hours:minutes:seconds". This option applies to job allocations.
1945
"days\-hours:minutes:seconds". This option applies to job allocations.
1942
1946
1943
.TP
1947
.TP
1944
\fB\-\-tmp\fR=<\fIMB\fR>
1948
\fB\-\-tmp\fR=<\fIsize[units]\fR>
1945
Specify a minimum amount of temporary disk space. This option applies to job
1949
Specify a minimum amount of temporary disk space per node.
1946
allocations.
1950
Default units are megabytes unless the SchedulerParameters configuration
1951
parameter includes the "default_gbytes" option for gigabytes.
1952
Different units can be specified using the suffix [K|M|G|T].
1953
This option applies to job allocations.
1947
1954
1948
.TP
1955
.TP
1949
\fB\-u\fR, \fB\-\-unbuffered\fR
1956
\fB\-u\fR, \fB\-\-unbuffered\fR
(-)a/doc/man/man5/slurm.conf.5 (+5 lines)
Lines 2585-2590 This option may improve system responsiveness when large numbers of jobs Link Here
2585
(many hundreds) are submitted at the same time, but it will delay the
2585
(many hundreds) are submitted at the same time, but it will delay the
2586
initiation time of individual jobs. Also see \fBdefault_queue_depth\fR above.
2586
initiation time of individual jobs. Also see \fBdefault_queue_depth\fR above.
2587
.TP
2587
.TP
2588
\fBdefault_gbytes\fR
2589
The default units in job submission memory and temporary disk size specification
2590
will be gigabytes rather than megabytes.
2591
Users can override the default by using a suffix of "M" for megabytes.
2592
.TP
2588
\fBdisable_user_top\fR
2593
\fBdisable_user_top\fR
2589
Disable use of the "scontrol top" command by non-privileged users.
2594
Disable use of the "scontrol top" command by non-privileged users.
2590
.TP
2595
.TP
(-)a/src/common/proc_args.c (-6 / +35 lines)
Lines 78-83 Link Here
78
#include "src/common/gres.h"
78
#include "src/common/gres.h"
79
#include "src/common/list.h"
79
#include "src/common/list.h"
80
#include "src/common/proc_args.h"
80
#include "src/common/proc_args.h"
81
#include "src/common/slurm_protocol_api.h"
81
#include "src/common/xmalloc.h"
82
#include "src/common/xmalloc.h"
82
#include "src/common/xstring.h"
83
#include "src/common/xstring.h"
83
84
Lines 601-611 char * base_name(char* command) Link Here
601
	return name;
602
	return name;
602
}
603
}
603
604
604
/*
605
static long _str_to_mbtyes(const char *arg, int use_gbytes)
605
 * str_to_mbytes(): verify that arg is numeric with optional "K", "M", "G"
606
 * or "T" at end and return the number in mega-bytes
607
 */
608
long str_to_mbytes(const char *arg)
609
{
606
{
610
	long result;
607
	long result;
611
	char *endptr;
608
	char *endptr;
Lines 614-620 long str_to_mbytes(const char *arg) Link Here
614
	result = strtol(arg, &endptr, 10);
611
	result = strtol(arg, &endptr, 10);
615
	if ((errno != 0) && ((result == LONG_MIN) || (result == LONG_MAX)))
612
	if ((errno != 0) && ((result == LONG_MIN) || (result == LONG_MAX)))
616
		result = -1;
613
		result = -1;
617
	else if (endptr[0] == '\0')
614
	else if ((endptr[0] == '\0') && (use_gbytes == 1))  /* GB default */
615
		result *= 1024;
616
	else if (endptr[0] == '\0')	/* MB default */
618
		;
617
		;
619
	else if ((endptr[0] == 'k') || (endptr[0] == 'K'))
618
	else if ((endptr[0] == 'k') || (endptr[0] == 'K'))
620
		result = (result + 1023) / 1024;	/* round up */
619
		result = (result + 1023) / 1024;	/* round up */
Lines 630-635 long str_to_mbytes(const char *arg) Link Here
630
	return result;
629
	return result;
631
}
630
}
632
631
632
/*
633
 * str_to_mbytes(): verify that arg is numeric with optional "K", "M", "G"
634
 * or "T" at end and return the number in mega-bytes. Default units are MB.
635
 */
636
long str_to_mbytes(const char *arg)
637
{
638
	return _str_to_mbtyes(arg, 0);
639
}
640
641
/*
642
 * str_to_mbytes2(): verify that arg is numeric with optional "K", "M", "G"
643
 * or "T" at end and return the number in mega-bytes. Default units are GB
644
 * if "SchedulerParameters=default_gbytes" is configured, otherwise MB.
645
 */
646
long str_to_mbytes2(const char *arg)
647
{
648
	static int use_gbytes = -1;
649
650
	if (use_gbytes == -1) {
651
		char *sched_params = slurm_get_sched_params();
652
		if (sched_params && strstr(sched_params, "default_gbytes"))
653
			use_gbytes = 1;
654
		else
655
			use_gbytes = 0;
656
		xfree(sched_params);
657
	}
658
659
	return _str_to_mbtyes(arg, use_gbytes);
660
}
661
633
/* Convert a string into a node count */
662
/* Convert a string into a node count */
634
static int
663
static int
635
_str_to_nodes(const char *num_str, char **leftover)
664
_str_to_nodes(const char *num_str, char **leftover)
(-)a/src/common/proc_args.h (-1 / +8 lines)
Lines 79-88 char * base_name(char* command); Link Here
79
79
80
/*
80
/*
81
 * str_to_mbytes(): verify that arg is numeric with optional "K", "M", "G"
81
 * str_to_mbytes(): verify that arg is numeric with optional "K", "M", "G"
82
 * or "T" at end and return the number in mega-bytes
82
 * or "T" at end and return the number in mega-bytes. Default units are MB.
83
 */
83
 */
84
long str_to_mbytes(const char *arg);
84
long str_to_mbytes(const char *arg);
85
85
86
/*
87
 * str_to_mbytes2(): verify that arg is numeric with optional "K", "M", "G"
88
 * or "T" at end and return the number in mega-bytes. Default units are GB
89
 * if ???, otherwise MB.
90
 */
91
long str_to_mbytes2(const char *arg);
92
86
/* verify that a node count in arg is of a known form (count or min-max) */
93
/* verify that a node count in arg is of a known form (count or min-max) */
87
bool verify_node_count(const char *arg, int *min_nodes, int *max_nodes);
94
bool verify_node_count(const char *arg, int *min_nodes, int *max_nodes);
88
95
(-)a/src/salloc/opt.c (-3 / +3 lines)
Lines 1009-1015 void set_options(const int argc, char **argv) Link Here
1009
			}
1009
			}
1010
			break;
1010
			break;
1011
		case LONG_OPT_MEM:
1011
		case LONG_OPT_MEM:
1012
			opt.realmem = (int) str_to_mbytes(optarg);
1012
			opt.realmem = (int) str_to_mbytes2(optarg);
1013
			if (opt.realmem < 0) {
1013
			if (opt.realmem < 0) {
1014
				error("invalid memory constraint %s",
1014
				error("invalid memory constraint %s",
1015
				      optarg);
1015
				      optarg);
Lines 1017-1023 void set_options(const int argc, char **argv) Link Here
1017
			}
1017
			}
1018
			break;
1018
			break;
1019
		case LONG_OPT_MEM_PER_CPU:
1019
		case LONG_OPT_MEM_PER_CPU:
1020
			opt.mem_per_cpu = (int) str_to_mbytes(optarg);
1020
			opt.mem_per_cpu = (int) str_to_mbytes2(optarg);
1021
			if (opt.mem_per_cpu < 0) {
1021
			if (opt.mem_per_cpu < 0) {
1022
				error("invalid memory constraint %s",
1022
				error("invalid memory constraint %s",
1023
				      optarg);
1023
				      optarg);
Lines 1025-1031 void set_options(const int argc, char **argv) Link Here
1025
			}
1025
			}
1026
			break;
1026
			break;
1027
		case LONG_OPT_TMP:
1027
		case LONG_OPT_TMP:
1028
			opt.tmpdisk = str_to_mbytes(optarg);
1028
			opt.tmpdisk = str_to_mbytes2(optarg);
1029
			if (opt.tmpdisk < 0) {
1029
			if (opt.tmpdisk < 0) {
1030
				error("invalid tmp value %s", optarg);
1030
				error("invalid tmp value %s", optarg);
1031
				exit(error_exit);
1031
				exit(error_exit);
(-)a/src/sbatch/opt.c (-3 / +3 lines)
Lines 1538-1544 static void _set_options(int argc, char **argv) Link Here
1538
			}
1538
			}
1539
			break;
1539
			break;
1540
		case LONG_OPT_MEM:
1540
		case LONG_OPT_MEM:
1541
			opt.realmem = (int) str_to_mbytes(optarg);
1541
			opt.realmem = (int) str_to_mbytes2(optarg);
1542
			if (opt.realmem < 0) {
1542
			if (opt.realmem < 0) {
1543
				error("invalid memory constraint %s",
1543
				error("invalid memory constraint %s",
1544
				      optarg);
1544
				      optarg);
Lines 1546-1552 static void _set_options(int argc, char **argv) Link Here
1546
			}
1546
			}
1547
			break;
1547
			break;
1548
		case LONG_OPT_MEM_PER_CPU:
1548
		case LONG_OPT_MEM_PER_CPU:
1549
			opt.mem_per_cpu = (int) str_to_mbytes(optarg);
1549
			opt.mem_per_cpu = (int) str_to_mbytes2(optarg);
1550
			if (opt.mem_per_cpu < 0) {
1550
			if (opt.mem_per_cpu < 0) {
1551
				error("invalid memory constraint %s",
1551
				error("invalid memory constraint %s",
1552
				      optarg);
1552
				      optarg);
Lines 1554-1560 static void _set_options(int argc, char **argv) Link Here
1554
			}
1554
			}
1555
			break;
1555
			break;
1556
		case LONG_OPT_TMP:
1556
		case LONG_OPT_TMP:
1557
			opt.tmpdisk = str_to_mbytes(optarg);
1557
			opt.tmpdisk = str_to_mbytes2(optarg);
1558
			if (opt.tmpdisk < 0) {
1558
			if (opt.tmpdisk < 0) {
1559
				error("invalid tmp value %s", optarg);
1559
				error("invalid tmp value %s", optarg);
1560
				exit(error_exit);
1560
				exit(error_exit);
(-)a/src/srun/libsrun/opt.c (-3 / +3 lines)
Lines 1372-1378 static void _set_options(const int argc, char **argv) Link Here
1372
			}
1372
			}
1373
			break;
1373
			break;
1374
		case LONG_OPT_MEM:
1374
		case LONG_OPT_MEM:
1375
			opt.pn_min_memory = (int) str_to_mbytes(optarg);
1375
			opt.pn_min_memory = (int) str_to_mbytes2(optarg);
1376
			opt.mem_per_cpu = NO_VAL;
1376
			opt.mem_per_cpu = NO_VAL;
1377
			if (opt.pn_min_memory < 0) {
1377
			if (opt.pn_min_memory < 0) {
1378
				error("invalid memory constraint %s",
1378
				error("invalid memory constraint %s",
Lines 1381-1387 static void _set_options(const int argc, char **argv) Link Here
1381
			}
1381
			}
1382
			break;
1382
			break;
1383
		case LONG_OPT_MEM_PER_CPU:
1383
		case LONG_OPT_MEM_PER_CPU:
1384
			opt.mem_per_cpu = (int) str_to_mbytes(optarg);
1384
			opt.mem_per_cpu = (int) str_to_mbytes2(optarg);
1385
			opt.pn_min_memory = NO_VAL;
1385
			opt.pn_min_memory = NO_VAL;
1386
			if (opt.mem_per_cpu < 0) {
1386
			if (opt.mem_per_cpu < 0) {
1387
				error("invalid memory constraint %s",
1387
				error("invalid memory constraint %s",
Lines 1408-1414 static void _set_options(const int argc, char **argv) Link Here
1408
				opt.resv_port_cnt = 0;
1408
				opt.resv_port_cnt = 0;
1409
			break;
1409
			break;
1410
		case LONG_OPT_TMP:
1410
		case LONG_OPT_TMP:
1411
			opt.pn_min_tmp_disk = str_to_mbytes(optarg);
1411
			opt.pn_min_tmp_disk = str_to_mbytes2(optarg);
1412
			if (opt.pn_min_tmp_disk < 0) {
1412
			if (opt.pn_min_tmp_disk < 0) {
1413
				error("invalid tmp value %s", optarg);
1413
				error("invalid tmp value %s", optarg);
1414
				exit(error_exit);
1414
				exit(error_exit);

Return to ticket 3383