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
b8c7774f
Commit
b8c7774f
authored
18 years ago
by
Christopher J. Morrone
Browse files
Options
Downloads
Patches
Plain Diff
When "srun -b" wraps a non-script command in a script, it will now use
the path to srun as determined by argv[0].
parent
e4a2ae2b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/srun/srun.c
+8
-7
8 additions, 7 deletions
src/srun/srun.c
with
8 additions
and
7 deletions
src/srun/srun.c
+
8
−
7
View file @
b8c7774f
...
...
@@ -104,13 +104,13 @@
* forward declaration of static funcs
*/
static
void
_print_job_information
(
resource_allocation_response_msg_t
*
resp
);
static
char
*
_build_script
(
char
*
pathname
,
int
file_type
);
static
char
*
_build_script
(
const
char
*
argv0
,
char
*
pathname
,
int
file_type
);
static
char
*
_get_shell
(
void
);
static
void
_send_options
(
const
int
argc
,
char
**
argv
);
static
void
_get_options
(
const
char
*
buffer
);
static
char
*
_get_token
(
char
*
buf_ptr
);
static
int
_is_file_text
(
char
*
,
char
**
);
static
int
_run_batch_job
(
void
);
static
int
_run_batch_job
(
const
char
*
argv0
);
static
int
_run_job_script
(
srun_job_t
*
job
,
env_t
*
env
);
static
void
_set_prio_process_env
(
void
);
static
int
_set_rlimit_env
(
void
);
...
...
@@ -206,7 +206,7 @@ int srun(int ac, char **av)
env
->
mem_bind
=
opt
.
mem_bind
;
setup_env
(
env
);
if
(
_run_batch_job
()
<
0
)
if
(
_run_batch_job
(
av
[
0
]
)
<
0
)
exit
(
1
);
exit
(
0
);
...
...
@@ -578,7 +578,7 @@ _print_job_information(resource_allocation_response_msg_t *resp)
/* submit a batch job and return error code */
static
int
_run_batch_job
(
void
)
_run_batch_job
(
const
char
*
argv0
)
{
int
file_type
,
retries
;
int
rc
=
SLURM_SUCCESS
;
...
...
@@ -598,7 +598,8 @@ _run_batch_job(void)
* }
*/
if
((
script
=
_build_script
(
remote_argv
[
0
],
file_type
))
==
NULL
)
{
if
((
script
=
_build_script
(
argv0
,
remote_argv
[
0
],
file_type
))
==
NULL
)
{
error
(
"unable to build script from file %s"
,
remote_argv
[
0
]);
return
SLURM_ERROR
;
}
...
...
@@ -810,7 +811,7 @@ _is_file_text (char *fname, char **shell_ptr)
/* allocate and build a string containing a script for a batch job */
static
char
*
_build_script
(
char
*
fname
,
int
file_type
)
_build_script
(
const
char
*
argv0
,
char
*
fname
,
int
file_type
)
{
cbuf_t
cb
=
cbuf_create
(
512
,
1048576
);
int
fd
=
-
1
;
...
...
@@ -827,7 +828,7 @@ _build_script (char *fname, int file_type)
if
(
file_type
!=
TYPE_SCRIPT
)
{
xstrfmtcat
(
buffer
,
"#!%s
\n
"
,
_get_shell
());
if
(
file_type
==
0
)
{
xstrcat
(
buffer
,
"srun
"
);
xstr
fmt
cat
(
buffer
,
"
%s "
,
argv0
);
/* path to
srun
*/
for
(
i
=
0
;
i
<
remote_argc
;
i
++
)
xstrfmtcat
(
buffer
,
"%s "
,
remote_argv
[
i
]);
xstrcatchar
(
buffer
,
'\n'
);
...
...
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