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
bbf3b764
Commit
bbf3b764
authored
20 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
"srun -A" modified to return exit code of last command executed (Chris Holmes, HP).
parent
cf2140f5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NEWS
+2
-0
2 additions, 0 deletions
NEWS
src/srun/srun.c
+19
-16
19 additions, 16 deletions
src/srun/srun.c
with
21 additions
and
16 deletions
NEWS
+
2
−
0
View file @
bbf3b764
...
...
@@ -15,6 +15,8 @@ documents those changes that are of interest to users and admins.
external scheduler control of RoolOnly partition (Chris Holmes, HP).
-- Modify logic to set process group ID for spawned processes (last
patch from slurm v0.3.11).
-- "srun -A" modified to return exit code of last command executed
(Chris Holmes, HP).
* Changes in SLURM 0.4.7
========================
...
...
This diff is collapsed.
Click to expand it.
src/srun/srun.c
+
19
−
16
View file @
bbf3b764
...
...
@@ -97,18 +97,20 @@ static char *_build_script (char *pathname, int file_type);
static
char
*
_get_shell
(
void
);
static
int
_is_file_text
(
char
*
,
char
**
);
static
int
_run_batch_job
(
void
);
static
void
_run_job_script
(
job_t
*
job
);
static
int
_run_job_script
(
job_t
*
job
);
static
int
_set_batch_script_env
(
job_t
*
job
);
static
int
_set_rlimit_env
(
void
);
static
char
*
_task_count_string
(
job_t
*
job
);
static
void
_switch_standalone
(
job_t
*
job
);
static
int
_become_user
(
void
);
static
int
_print_script_exit_status
(
const
char
*
argv0
,
int
status
);
int
srun
(
int
ac
,
char
**
av
)
{
allocation_resp
*
resp
;
job_t
*
job
;
char
*
task_cnt
,
*
bgl_part_id
=
NULL
;
int
exitcode
=
0
;
log_options_t
logopt
=
LOG_OPTS_STDERR_ONLY
;
...
...
@@ -186,11 +188,11 @@ int srun(int ac, char **av)
job
=
job_create_allocation
(
resp
);
if
(
msg_thr_create
(
job
)
<
0
)
job_fatal
(
job
,
"Unable to create msg thread"
);
_run_job_script
(
job
);
job_destroy
(
job
,
0
);
exitcode
=
_run_job_script
(
job
);
job_destroy
(
job
,
exitcode
);
debug
(
"Spawned srun shell terminated"
);
exit
(
0
);
exit
(
exitcode
);
}
else
if
(
mode
==
MODE_ATTACH
)
{
reattach
();
...
...
@@ -788,14 +790,15 @@ static int _set_rlimit_env(void)
return
rc
;
}
static
void
static
int
_print_script_exit_status
(
const
char
*
argv0
,
int
status
)
{
char
*
corestr
=
""
;
int
exitcode
=
0
;
if
(
status
==
0
)
{
verbose
(
"%s: Done"
,
argv0
);
return
;
return
exitcode
;
}
#ifdef WCOREDUMP
...
...
@@ -803,23 +806,24 @@ _print_script_exit_status(const char *argv0, int status)
corestr
=
" (core dumped)"
;
#endif
if
(
WIFSIGNALED
(
status
))
if
(
WIFSIGNALED
(
status
))
{
error
(
"%s: %s%s"
,
argv0
,
sigstr
(
status
),
corestr
);
else
return
WTERMSIG
(
status
)
+
128
;
}
if
(
WEXITSTATUS
(
status
))
error
(
"%s: Exit %d"
,
argv0
,
WEXITSTATUS
(
status
));
return
;
return
WEXITSTATUS
(
status
);
}
/* allocation option specified, spawn a script and wait for it to exit */
static
void
_run_job_script
(
job_t
*
job
)
static
int
_run_job_script
(
job_t
*
job
)
{
int
status
;
int
status
,
exitcode
;
pid_t
cpid
;
char
**
argv
=
(
remote_argv
[
0
]
?
remote_argv
:
NULL
);
if
(
_set_batch_script_env
(
job
)
<
0
)
return
;
return
1
;
if
(
!
argv
)
{
/*
...
...
@@ -856,13 +860,12 @@ static void _run_job_script (job_t *job)
error
(
"waitpid: %m"
);
}
_print_script_exit_status
(
xbasename
(
argv
[
0
]),
status
);
exitcode
=
_print_script_exit_status
(
xbasename
(
argv
[
0
]),
status
);
if
(
unsetenv
(
"SLURM_JOBID"
))
{
error
(
"Unable to clear SLURM_JOBID environment variable"
);
return
;
}
return
exitcode
;
}
static
int
_become_user
(
void
)
...
...
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