Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
905453f2
Commit
905453f2
authored
11 years ago
by
Morris Jette
Browse files
Options
Downloads
Patches
Plain Diff
Revert "spank/pbs - Pass stdout env vars to Epilog plugin"
This reverts commit
db1a86d0
.
parent
db1a86d0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contribs/torque/qsub.pl
+2
-8
2 additions, 8 deletions
contribs/torque/qsub.pl
src/plugins/job_submit/pbs/spank_pbs.c
+1
-45
1 addition, 45 deletions
src/plugins/job_submit/pbs/spank_pbs.c
with
3 additions
and
53 deletions
contribs/torque/qsub.pl
+
2
−
8
View file @
905453f2
...
...
@@ -215,15 +215,9 @@ if($interactive) {
$command
=
"
$sbatch
";
if
(
$directive_prefix
)
{
$command
.=
"
-D
$directive_prefix
";
$ENV
{
SBATCH_WORK_DIR
}
=
$directive_prefix
;
}
$command
.=
"
-D
$directive_prefix
"
if
$directive_prefix
;
$command
.=
"
-e
$err_path
"
if
$err_path
;
if
(
$out_path
)
{
$command
.=
"
-o
$out_path
";
$ENV
{
SBATCH_STDOUT
}
=
$out_path
;
}
$command
.=
"
-o
$out_path
"
if
$out_path
;
# The job size specification may be within the batch script,
# Reset task count if node count also specified
...
...
This diff is collapsed.
Click to expand it.
src/plugins/job_submit/pbs/spank_pbs.c
+
1
−
45
View file @
905453f2
...
...
@@ -38,55 +38,11 @@
\*****************************************************************************/
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<unistd.h>
#include
"slurm/spank.h"
SPANK_PLUGIN
(
pbs
,
1
);
/* Set a few environment variables for use by the Epilog script
* SPANK_NCCS_STDOUT_FILE will be set to the job's NCCS_STDOUT_FILE env
* SPANK_SLURM_STDOUT_FILE will be set to the job's stdout file
*
* NOTE: the ac and av represent the argc and argv arguments to the SPANK
* plugin, not those of the user command
*/
int
slurm_spank_init_post_opt
(
spank_t
sp
,
int
ac
,
char
**
av
)
{
char
*
nccs_stdout
,
*
sbatch_stdout
,
*
sbatch_dir
;
char
*
cwd
=
NULL
;
int
i
=
4096
;
if
((
nccs_stdout
=
getenv
(
"NCCS_STDOUT_FILE"
)))
spank_job_control_setenv
(
sp
,
"NCCS_STDOUT_FILE"
,
nccs_stdout
,
1
);
sbatch_stdout
=
getenv
(
"SBATCH_STDOUT"
);
if
(
!
sbatch_stdout
)
sbatch_stdout
=
"slurm-%J.out"
;
sbatch_dir
=
getenv
(
"SBATCH_WORK_DIR"
);
while
(
!
sbatch_dir
)
{
cwd
=
realloc
(
cwd
,
i
);
sbatch_dir
=
getcwd
(
cwd
,
i
);
i
*=
16
;
}
if
(
sbatch_stdout
[
0
]
==
'/'
)
{
spank_job_control_setenv
(
sp
,
"SLURM_STDOUT_FILE"
,
sbatch_stdout
,
1
);
}
else
{
i
=
strlen
(
sbatch_dir
)
+
strlen
(
sbatch_stdout
)
+
2
;
char
*
tmp
=
malloc
(
i
);
snprintf
(
tmp
,
i
,
"%s/%s"
,
sbatch_dir
,
sbatch_stdout
);
spank_job_control_setenv
(
sp
,
"SLURM_STDOUT_FILE"
,
tmp
,
1
);
free
(
tmp
);
}
if
(
cwd
)
free
(
cwd
);
return
ESPANK_SUCCESS
;
}
/* Configure a bunch of PBS_* environment variables based upon the SLURM_*
* environment variables that are set by Slurm. */
int
slurm_spank_task_init
(
spank_t
sp
,
int
ac
,
char
**
av
)
{
char
val
[
30000
];
...
...
@@ -163,5 +119,5 @@ int slurm_spank_task_init(spank_t sp, int ac, char **av)
spank_setenv
(
sp
,
"PBS_TASKNUM"
,
val
,
1
);
}
return
ESPANK_SUCCESS
;
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment