Skip to content
Snippets Groups Projects
Commit 9d41d5a4 authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files

salloc:

  Add -D, --dependency option
  Man page updates.
parent 4f6300f8
No related branches found
No related tags found
No related merge requests found
......@@ -14,40 +14,45 @@ The command may be any program the user wishes. Some typical commands are xterm
.SH "OPTIONS"
.LP
.TP
\fB\-\-jobid\fR[=]<\fIJOBID\fP>
The job allocation under which the parallel application should be launched.
.TP
\fB\-n\fR, \fB\-\-ntasks\fR[=]<\fInumber\fR>
Specify the number of processes to launch. The default is one process per node, but note that the \-c parameter will change this default.
.TP
\fB\-N\fR, \fB\-\-nodes\fR[=]<\fInumber|[min]\-[max]\fR>
Specify the number of nodes to be used by this job step. This option accepts either a single number, or a range of possible node counts. If a single number is used, such as "\-N 4", then the allocation is asking for four and ONLY four nodes. If a range is specified, such as "\-N 2\-6", SLURM controller may grant salloc anywhere from 2 to 6 nodes. When using a range, either of the min or max options may be omitted. For instance, "\-N 10\-" means "no fewer than 10 nodes", and "\-N \-20" means "no more than 20 nodes". The default value of this option is one node, but other options may require more than one node to be allocated.
.TP
\fB\-D\fR, \fB\-\-dependency\fR[=]<\fIjobid\fR>
Defer the start of this job until the specified \fIjobid\fR has completed. Many jobs can share the same dependency and these jobs may even belong to different users. The value may be changed after job submission using the scontrol command.
.TP
\fB\-I\fR,\fB\-\-immediate\fR
Do not wait for the resources need to grant this allocation. Normally salloc will wait for the resources necessary to satisfy the requested job allocation, but when \-\-immediate is specified it will exit immediately without running the \fIcommand\fR parameter.
.TP
\fB\-W\fR, \fB\-\-wait\fR[=]<\fIseconds\fR>
If the resources needed to satisy a job allocation are not immediately available, the job allocation is enqueued and is said to be PENDING. This option tells salloc how long (in seconds) to wait for the allocation to be granted before giving up. When the wait limit has been reached, salloc will exit without running the \fIcommand\fR parameter. By default, salloc will wait indefinitely. (The \-\-immediate option makes \-\-wait moot.)
.TP
\fB\-p\fR, \fB\-\-partition\fR[=]<\fIpartition name\fR>
Request a specific partition for the resource allocation. If not specified, the default behaviour is to allow the slurm controller to select the default partition as designated by the system administrator.
.TP
\fB\-c\fR, \fB\-\-cpus\-per\-task\fR=<\fIncpus\fR>
.PP
Help options
.TP
\fB\-\-help\fR
Display verbose help message and exit.
.TP
\fB\-\-usage\fR
Display brief help message and exit.
\fB\-\-bell\fR
Force salloc to ring the terminal bell when the job allocation is granted. By default, salloc only rings the bell if the allocation is pending for more than ten seconds.
.TP
\fB\-\-no\-bell\fR
Silence salloc's use of the terminal bell.
.PP
Other options
.TP
\fB\-\-help\fR
Output help information and exit.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
Output version information and exit.
.SH "ENVIRONMENT VARIABLES"
.LP
.TP
\fBSALLOC_BELL\fR
Same as \fB\-\-bell\fR.
.TP
\fBSALLOC_NO_BELL\fR
Same as \fB\-\-no\-bell\fR.
.SH "EXAMPLES"
.LP
To get an allocation, and open a new xterm in which slaunch commands may be typed interactively:
......
......@@ -86,6 +86,8 @@
#define OPT_GEOMETRY 0x0b
#define OPT_CPU_BIND 0x0d
#define OPT_MEM_BIND 0x0e
#define OPT_BELL 0x0f
#define OPT_NO_BELL 0x10
/* generic getopt_long flags, integers and *not* valid characters */
#define LONG_OPT_HELP 0x100
......@@ -812,6 +814,8 @@ env_vars_t env_vars[] = {
{"SLURM_PARTITION", OPT_STRING, &opt.partition, NULL },
{"SLURM_TIMELIMIT", OPT_INT, &opt.time_limit, NULL },
{"SLURM_WAIT", OPT_INT, &opt.max_wait, NULL },
{"SALLOC_BELL", OPT_BELL, NULL, NULL },
{"SALLOC_NO_BELL", OPT_NO_BELL, NULL, NULL },
{NULL, 0, NULL, NULL}
};
......@@ -914,6 +918,12 @@ _process_env_var(env_vars_t *e, const char *val)
e->var, val);
}
break;
case OPT_BELL:
opt.bell = BELL_ALWAYS;
break;
case OPT_NO_BELL:
opt.bell = BELL_NEVER;
break;
default:
/* do nothing */
break;
......@@ -951,7 +961,6 @@ void set_options(const int argc, char **argv, int first)
static struct option long_options[] = {
{"cpus-per-task", required_argument, 0, 'c'},
{"constraint", required_argument, 0, 'C'},
{"slurmd-debug", required_argument, 0, 'd'},
{"geometry", required_argument, 0, 'g'},
{"hold", no_argument, 0, 'H'},
{"immediate", no_argument, 0, 'I'},
......@@ -1002,8 +1011,7 @@ void set_options(const int argc, char **argv, int first)
{"no-bell", no_argument, 0, LONG_OPT_NO_BELL},
{NULL, 0, 0, 0}
};
char *opt_string = "+a:c:C:g:HIJ:km:N:"
"Op:P:qQR:st:U:vVw:W:x:";
char *opt_string = "+a:c:C:D:g:HIJ:km:N:Op:qQR:st:U:vVw:W:x:";
if(opt.progname == NULL)
opt.progname = xbasename(argv[0]);
......@@ -1036,6 +1044,12 @@ void set_options(const int argc, char **argv, int first)
xfree(opt.constraints);
opt.constraints = xstrdup(optarg);
break;
case (int)'D':
if(!first && opt.dependency)
break;
opt.dependency = _get_int(optarg, "dependency");
break;
case (int)'g':
if(!first && opt.geometry)
break;
......@@ -1100,12 +1114,6 @@ void set_options(const int argc, char **argv, int first)
xfree(opt.partition);
opt.partition = xstrdup(optarg);
break;
case (int)'P':
if(!first && opt.dependency)
break;
opt.dependency = _get_int(optarg, "dependency");
break;
case (int)'q':
opt.quit_on_intr = true;
break;
......@@ -1606,7 +1614,7 @@ static void _usage(void)
printf(
"Usage: salloc [-N numnodes|[min nodes]-[max nodes]]\n"
" [-c ncpus] [-r n] [-p partition] [--hold] [-t minutes]\n"
" [-D path] [--immediate] [--overcommit] [--no-kill]\n"
" [--immediate] [--overcommit] [--no-kill]\n"
" [--share] [-m dist] [-J jobname]\n"
" [--verbose]\n"
" [-W sec]\n"
......@@ -1646,7 +1654,6 @@ static void _help(void)
" -q, --quit-on-interrupt quit on single Ctrl-C\n"
" -v, --verbose verbose mode (multiple -v's increase verbosity)\n"
" -Q, --quiet quiet mode (suppress informational messages)\n"
" -d, --slurmd-debug=level slurmd debug level\n"
" -P, --dependency=jobid defer job until specified jobid completes\n"
" --nice[=value] decrease secheduling priority by value\n"
" -U, --account=name charge job to specified account\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment