Skip to content

Commit 45a57f2

Browse files
committed
EH: CS-791 SGE_ROOT should be available in prolog / epilog configuration in any case
1 parent ad03543 commit 45a57f2

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed

Diff for: doc/markdown/man/man5/sge_conf.md

+6
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ The default for *prolog* is the special value NONE, which prevents from executio
111111
The following special variables expanded at runtime can be used (besides any other strings which have to be
112112
interpreted by the procedure) to constitute a command line:
113113

114+
* \$sge_root
115+
The product root directory.
116+
117+
* \$sge_cell
118+
The name of the cell directory.
119+
114120
* \$host
115121
The name of the host on which the prolog or epilog procedures are started.
116122

Diff for: doc/markdown/man/man5/sge_pe.md

+6
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ being the job's identification number. Likewise, the standard error output is re
6868
The following special variables being expanded at runtime can be used (besides any other strings which have to
6969
be interpreted by the start and stop procedures) to constitute a command line:
7070

71+
* $sge_root
72+
The product root directory.
73+
74+
* $sge_cell
75+
The name of the cell directory.
76+
7177
* $pe_hostfile
7278
The pathname of a file containing a detailed description of the layout of the parallel environment to be setup by
7379
the start-up procedure. Each line of the file refers to a host on which parallel processes are to be run. The first

Diff for: doc/markdown/man/man5/sge_queue_conf.md

+6
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,12 @@ with its arguments is started by xxQS_NAMExx to perform the appropriate action.
325325
are expanded at runtime and can be used (besides any other strings which have to be interpreted by the procedures)
326326
to constitute a command line:
327327

328+
* $sge_root
329+
The product root directory.
330+
331+
* $sge_cell
332+
The name of the cell directory.
333+
328334
* $host
329335
The name of the host on which the procedure is started.
330336

Diff for: source/daemons/execd/exec_job.cc

+5
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,11 @@ int sge_exec_job(lListElem *jep, lListElem *jatep, lListElem *petep, char *err_s
10211021
DRETURN(-2);
10221022
}
10231023

1024+
// add sge_root and sge_cell to the config file
1025+
// they can be used as special variables in prolog/epilog/pe/ckpt configuration
1026+
fprintf(fp, "sge_root=%s\n", sge_root);
1027+
fprintf(fp, "sge_cell=%s\n", default_cell);
1028+
10241029
#ifdef COMPILE_DC
10251030

10261031
# if defined(SOLARIS) || defined(LINUX) || defined(FREEBSD) || defined(DARWIN)

Diff for: source/libs/uti/config_file.cc

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ static config_entry *config_list = nullptr;
7070

7171
/* these variables may get used to replace variables in pe_start */
7272
const char *pe_variables[] = {
73+
"sge_root",
74+
"sge_cell",
7375
"pe_hostfile",
7476
"host",
7577
"job_owner",
@@ -100,6 +102,8 @@ const char *pe_variables[] = {
100102

101103
/* these variables may get used to replace variables in prolog/epilog */
102104
const char *prolog_epilog_variables[] = {
105+
"sge_root",
106+
"sge_cell",
103107
"host",
104108
"job_owner",
105109
"job_id",
@@ -136,6 +140,8 @@ const char *pe_alloc_rule_variables[] = {
136140
};
137141

138142
const char *ckpt_variables[] = {
143+
"sge_root",
144+
"sge_cell",
139145
"host",
140146
"job_owner",
141147
"job_id",
@@ -148,6 +154,8 @@ const char *ckpt_variables[] = {
148154
};
149155

150156
const char *ctrl_method_variables[] = {
157+
"sge_root",
158+
"sge_cell",
151159
"host",
152160
"job_owner",
153161
"job_id",

0 commit comments

Comments
 (0)