From c2a26d79c8aedde5eb4306506a5157e25586308c Mon Sep 17 00:00:00 2001
From: Teun Docter <teun.docter@brightcomputing.com>
Date: Thu, 5 Dec 2013 12:38:33 -0800
Subject: [PATCH] Documentation about PrologFlags

---
 doc/html/configurator.html.in |  1 +
 doc/html/cray.shtml           | 22 ++++++++++++++++++++++
 doc/html/power_save.shtml     |  8 ++++++--
 doc/html/prolog_epilog.shtml  |  4 +++-
 doc/man/man5/slurm.conf.5     | 16 ++++++++++++++++
 5 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/doc/html/configurator.html.in b/doc/html/configurator.html.in
index e7df6c9f4ab..18e3e5d9283 100644
--- a/doc/html/configurator.html.in
+++ b/doc/html/configurator.html.in
@@ -163,6 +163,7 @@ function displayfile()
    "#PrivateData=jobs <br>" +
    "ProctrackType=proctrack/" + get_radio_value(document.config.proctrack_type) + "<br>" +
    get_field("Prolog",document.config.prolog) + "<br>" +
+   "#PrologFlags= <br>" +
    "#PrologSlurmctld= <br>" +
    "#PropagatePrioProcess=0 <br>" +
    "#PropagateResourceLimits= <br>" +
diff --git a/doc/html/cray.shtml b/doc/html/cray.shtml
index b6e73a8c1f2..464734d465f 100644
--- a/doc/html/cray.shtml
+++ b/doc/html/cray.shtml
@@ -666,6 +666,28 @@ sdb: # /etc/init.d/slurm start
 login: # /etc/init.d/slurm start
 </pre>
 
+<h3>Cluster Compatibility Mode</h3>
+
+<p>It is possible to use SLURM to allocate resources for jobs
+that run in Cray's Cluster Compatibility Mode (CCM). In order
+to set this up, first install the CCM packages according to Cray
+documentation. As part of the CCM packages, a prologue and epilogue
+script will be installed. Add/change the following flags in slurm.conf
+to enable the scripts:</p>
+
+<pre>
+PrologFlags=Alloc
+Prolog=/opt/cray/ccm/default/etc/slurm.prolog.frontend
+Epilog=/opt/cray/ccm/default/etc/slurm.epilog.frontend
+</pre>
+
+<p>To run jobs in CCM, a SLURM partition should be created in slurm.conf.
+The name of that partition should be put into the CCM_QUEUES variable in
+this file: /etc/opt/cray/ccm/ccm.conf</p>
+
+<p>Any job that requests resources from said partition will then run in
+Cluster Compatibility Mode.</p>
+
 <h3>launch/aprun plugin configuration</h3>
 
 <p>By default the launch plugin on a Cray is on set
diff --git a/doc/html/power_save.shtml b/doc/html/power_save.shtml
index 9bd2a203e3e..c9bc61cc426 100644
--- a/doc/html/power_save.shtml
+++ b/doc/html/power_save.shtml
@@ -212,8 +212,12 @@ for use.</p>
 <p>The <i>salloc</i> and <i>srun</i> commands which create a resource
 allocation automatically wait for the nodes to power up in SLURM version 2.2.
 When using earlier versions of SLURM, <i>salloc</i> will return immediately
-after a resource allocation is made and one can execute "<i>srun /bin/true</i>"
-to insure that all nodes are booted and ready for use.</p>
+after a resource allocation is made, and one can execute "<i>srun /bin/true</i>"
+to ensure that all nodes are booted and ready for use.</p>
+
+<p>Execution of the <i>salloc</i> command also triggers execution of the <i>Prolog</i>
+script if the <i>Alloc</i> flag is set in <i>PrologFlags</i>. In this case <i>salloc</i>
+waits for script termination before returning control to the user.</p>
 
 <h2>Fault Tolerance</h2>
 
diff --git a/doc/html/prolog_epilog.shtml b/doc/html/prolog_epilog.shtml
index 1f185af570a..1540a1210cb 100644
--- a/doc/html/prolog_epilog.shtml
+++ b/doc/html/prolog_epilog.shtml
@@ -54,7 +54,9 @@ allocations, when and where they run.</p>
 			</td>
 			<td width="40%">
 				<p align="LEFT"><font style="font-size: 8pt" size="1">
-				First job or job step initiation on that node</font></p>
+				First job or job step initiation on that node (by default);
+				PrologFlags=Alloc will force the script to be executed at
+				job allocation</font></p>
 			</td>
 		</tr>
 		<tr>
diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5
index b22aee3383e..20b0faf2bad 100644
--- a/doc/man/man5/slurm.conf.5
+++ b/doc/man/man5/slurm.conf.5
@@ -1519,6 +1519,22 @@ If the prolog fails (returns a non\-zero exit code), this will result in the
 node being set to a DOWN state and the job requeued to executed on another node.
 See \fBProlog and Epilog Scripts\fR for more information.
 
+.TP
+\fBPrologFlags\fR
+Flags to control the Prolog behavior. By default no flags are set.
+Currently the only option defined is:
+.RS
+.TP 6
+\fBAlloc\fR
+If set, the Prolog script will be executed at job allocation. By default,
+Prolog is executed just before the task is launched. Therefore, when salloc
+is started, no Prolog is executed. \fBAlloc\fR is useful for preparing things
+before a user starts to use any allocated resources.
+In particular, this flag is needed on a Cray system when cluster compatibility
+mode is enabled.
+.TP
+.RE
+
 .TP
 \fBPrologSlurmctld\fR
 Fully qualified pathname of a program for the slurmctld daemon to execute
-- 
GitLab