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
877f3759
Commit
877f3759
authored
22 years ago
by
Mark Grondona
Browse files
Options
Downloads
Patches
Plain Diff
o set more env vars in allocate mode so that srun with no args does the "right thing"
parent
a89b57d6
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
+22
-5
22 additions, 5 deletions
src/srun/srun.c
with
22 additions
and
5 deletions
src/srun/srun.c
+
22
−
5
View file @
877f3759
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002 The Regents of the University of California.
* Copyright (C) 2002 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Mark Grondona <grondona@llnl.gov>, Moe Jette <jette1@llnl.gov>, et. al.
* Written by Mark Grondona <grondona@llnl.gov>,
* Moe Jette <jette1@llnl.gov>, et. al.
* UCRL-CODE-2002-040.
* UCRL-CODE-2002-040.
*
*
* This file is part of SLURM, a resource management program.
* This file is part of SLURM, a resource management program.
...
@@ -257,6 +258,7 @@ main(int ac, char **av)
...
@@ -257,6 +258,7 @@ main(int ac, char **av)
(
job
->
out
[
i
]
==
IO_DONE
))
(
job
->
out
[
i
]
==
IO_DONE
))
n
++
;
n
++
;
}
}
verbose
(
"end of job n = %d"
,
n
);
if
(
n
<
opt
.
nprocs
)
if
(
n
<
opt
.
nprocs
)
pthread_join
(
job
->
ioid
,
NULL
);
pthread_join
(
job
->
ioid
,
NULL
);
else
else
...
@@ -798,16 +800,31 @@ existing_allocation( void )
...
@@ -798,16 +800,31 @@ existing_allocation( void )
/* allocation option specified, spawn a script and wait for it to exit */
/* allocation option specified, spawn a script and wait for it to exit */
void
run_job_script
(
uint32_t
job_id
)
void
run_job_script
(
uint32_t
job_id
)
{
{
char
jobid_str
[
16
],
*
shell
=
NULL
;
char
*
shell
=
NULL
;
int
i
;
int
i
;
pid_t
child
;
pid_t
child
;
sprintf
(
jobid_str
,
"%u"
,
job_id
);
if
(
setenvf
(
"SLURM_JOBID=%u"
,
job_id
))
{
if
(
setenv
(
"SLURM_JOBID"
,
jobid_str
,
1
))
{
error
(
"Unable to set SLURM_JOBID environment variable"
);
error
(
"Unable to set SLURM_JOBID environment variable"
);
return
;
return
;
}
}
if
(
setenvf
(
"SLURM_NNODES=%u"
,
opt
.
nodes
))
{
error
(
"Unable to set SLURM_NNODES environment variable"
);
return
;
}
if
(
setenvf
(
"SLURM_NPROCS=%u"
,
opt
.
nprocs
))
{
error
(
"Unable to set SLURM_NPROCS environment variable"
);
return
;
}
if
(
setenvf
(
"SLURM_DISTRIBUTION=%s"
,
opt
.
distribution
==
SRUN_DIST_BLOCK
?
"block"
:
"cyclic"
))
{
error
(
"Unable to set SLURM_DISTRIBUTION environment variable"
);
return
;
}
/* determine shell from script (if any) or user default */
/* determine shell from script (if any) or user default */
if
(
remote_argc
)
{
if
(
remote_argc
)
{
char
**
new_argv
;
char
**
new_argv
;
...
...
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