From 3b1d3cc3a5e401902aaa133bc86b57e16ee34eb7 Mon Sep 17 00:00:00 2001 From: Farah Salhany Date: Wed, 3 Jul 2024 15:59:06 -0400 Subject: [PATCH 01/24] reverting changes and proofreading until section 2.4 --- doc/scheduler-directives.tex | 136 +++++----- doc/scheduler-env.tex | 50 ++-- doc/scheduler-scripting.tex | 298 +++++++++++----------- doc/speed-manual.tex | 482 ++++++++++++++++------------------- 4 files changed, 450 insertions(+), 516 deletions(-) diff --git a/doc/scheduler-directives.tex b/doc/scheduler-directives.tex index 099ab37..9b249f7 100644 --- a/doc/scheduler-directives.tex +++ b/doc/scheduler-directives.tex @@ -1,21 +1,19 @@ -% ------------------------------------------------------------------------------ -\subsubsection{Directives} -\label{sect:directives} +% 2.2.1 Directives +% ------------------- +% TMP scheduler-specific section Directives are comments included at the beginning of a job script that set the shell -and the options for the job scheduler. +and the options for the job scheduler. % The shebang directive is always the first line of a script. In your job script, this directive sets which shell your script's commands will run in. On ``Speed'', -we recommend that your script use a shell from the \texttt{/encs/bin} directory. +we recommend that your script use a shell from the \texttt{/encs/bin} directory.\\ To use the \texttt{tcsh} shell, start your script with \verb|#!/encs/bin/tcsh|. -% -For \texttt{bash}, start with \verb|#!/encs/bin/bash|. -% -Directives that start with \verb|#SBATCH|, set the options for the cluster's -Slurm job scheduler. The script template, \texttt{template.sh}, -provides the essentials: +For \texttt{bash}, start with \verb|#!/encs/bin/bash|.\\ + +Directives that start with \verb|#SBATCH| set the options for the cluster's +SLURM job scheduler. The following provides an example of some essential directives: %\begin{verbatim} %#$ -N @@ -24,92 +22,82 @@ \subsubsection{Directives} %#$ -pe smp %#$ -l h_vmem=G %\end{verbatim} + \begin{verbatim} -#SBATCH --job-name= ## or -J. Give the job a name -#SBATCH --mail-type= ## Set type of email notifications -#SBATCH --chdir= ## or -D, Set working directory where output files will go -#SBATCH --nodes=1 ## or -N, Node count required for the job -#SBATCH --ntasks=1 ## or -n, Number of tasks to be launched -#SBATCH --cpus-per-task= ## or -c, Core count requested, e.g. 8 cores -#SBATCH --mem= ## Assign memory for this job, e.g., 32G memory per node + #SBATCH --job-name= ## or -J. Give the job a name + #SBATCH --mail-type= ## set type of email notifications + #SBATCH --chdir= ## or -D, set working directory for the job + #SBATCH --nodes=1 ## or -N, node count required for the job + #SBATCH --ntasks=1 ## or -n, number of tasks to be launched + #SBATCH --cpus-per-task= ## or -c, core count requested, e.g. 8 cores + #SBATCH --mem= ## assign memory for this job, e.g., 32G memory per node \end{verbatim} -Replace the following to adjust the job script for your project(s) -\begin{enumerate} - \item \verb++ with a job name for the job - \item \verb++ with the fullpath to your job's working directory, e.g., where your code, -source files and where the standard output files will be written to. By default, \verb+--chdir+ -sets the current directory as the job's working directory - \item \verb++ with the type of e-mail notifications you wish to receive. Valid options are: NONE, BEGIN, END, FAIL, REQUEUE, ALL - \item \verb++ with the degree of multithreaded parallelism (i.e., cores) allocated to your job. Up to 32 by default. - \item \verb++ with the amount of memory, in GB, that you want to be allocated per node. Up to 500 depending on the node. - NOTE: All jobs MUST set a value for the \verb|--mem| option. -\end{enumerate} - -Example with short option equivalents: +\noindent Replace the following to adjust the job script for your project(s) +\begin{itemize} + \item \verb++ with a job name for the job. This name will be displayed in the job queue. + \item \verb++ with the fullpath to your job's working directory, e.g., where your code, + source files and where the standard output files will be written to. + By default, \verb+--chdir+ sets the current directory as the job's working directory. + \item \verb++ with the type of e-mail notifications you wish to receive. + Valid options are: NONE, BEGIN, END, FAIL, REQUEUE, ALL. + \item \verb++ with the degree of multithreaded parallelism (i.e., cores) allocated to your job. Up to 32 by default. + \item \verb++ with the amount of memory, in GB, that you want to be allocated per node. Up to 500 depending on the node.\\ + \textbf{Note}: All jobs MUST set a value for the \verb|--mem| option. +\end{itemize} +\noindent Example with short option equivalents: \begin{verbatim} -#SBATCH -J tmpdir ## Job's name set to 'tmpdir' -#SBATCH --mail-type=ALL ## Receive all email type notifications -#SBATCH -D ./ ## Use current directory as working directory -#SBATCH -N 1 ## Node count required for the job -#SBATCH -n 1 ## Number of tasks to be launched -#SBATCH -c 8 ## Request 8 cores -#SBATCH --mem=32G ## Allocate 32G memory per node + #SBATCH -J myjob ## Job's name set to 'myjob' + #SBATCH --mail-type=ALL ## Receive all email type notifications + #SBATCH -D ./ ## Use current directory as working directory + #SBATCH -N 1 ## Node count required for the job + #SBATCH -n 1 ## Number of tasks to be launched + #SBATCH -c 8 ## Request 8 cores + #SBATCH --mem=32G ## Allocate 32G memory per node \end{verbatim} -% -If you are unsure about memory footprints, err on assigning a generous +\noindent \textbf{Tip:} If you are unsure about memory footprints, err on assigning a generous memory space to your job, so that it does not get prematurely terminated. %(the value given to \api{h\_vmem} is a hard memory ceiling). -You can refine -%\api{h\_vmem} -\option{--mem} -values for future jobs by monitoring the size of a job's active +You can refine \option{--mem} values for future jobs by monitoring the size of a job's active memory space on \texttt{speed-submit} with: - %\begin{verbatim} %qstat -j | grep maxvmem %\end{verbatim} \begin{verbatim} -sacct -j -sstat -j + sacct -j + sstat -j \end{verbatim} -\noindent -This can be customized to show specific columns: +\noindent This can be customized to show specific columns: \begin{verbatim} -sacct -o jobid,maxvmsize,ntasks%7,tresusageouttot%25 -j -sstat -o jobid,maxvmsize,ntasks%7,tresusageouttot%25 -j + sacct -o jobid,maxvmsize,ntasks%7,tresusageouttot%25 -j + sstat -o jobid,maxvmsize,ntasks%7,tresusageouttot%25 -j \end{verbatim} -Memory-footprint values are also provided for completed jobs in the final -e-mail notification as ``maxvmsize''. -% +\noindent Memory-footprint values are also provided for completed jobs in the final +email notification as ``maxvmsize''. \emph{Jobs that request a low-memory footprint are more likely to load on a busy -cluster.} +cluster.}\\ -Other essential options are \option{--time}, or \verb|-t|, and \option{--account}, or \verb|-A|. -% +\noindent Other essential options are \option{--time}, or \verb|-t|, and \option{--account}, or \verb|-A|. \begin{itemize} -\item -\option{--time=