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
16bbb9c4
Commit
16bbb9c4
authored
18 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Restore some code removed in v1.2.
Required for test1.57 and moab use.
parent
3914f7e0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/srun/allocate.c
+26
-1
26 additions, 1 deletion
src/srun/allocate.c
src/srun/allocate.h
+8
-0
8 additions, 0 deletions
src/srun/allocate.h
src/srun/srun.c
+2
-1
2 additions, 1 deletion
src/srun/srun.c
with
36 additions
and
2 deletions
src/srun/allocate.c
+
26
−
1
View file @
16bbb9c4
...
...
@@ -114,7 +114,7 @@ allocate_nodes(void)
/* Do not re-use existing job id when submitting new job
* from within a running job */
if
(
getenv
(
"SLURM_JOBID"
)
!=
NULL
)
{
if
(
(
j
->
job_id
!=
NO_VAL
)
&&
!
opt
.
jobid_set
)
{
info
(
"WARNING: Creating SLURM job allocation from within "
"another allocation"
);
info
(
"WARNING: You are attempting to initiate a second job"
);
...
...
@@ -158,6 +158,31 @@ allocate_nodes(void)
return
resp
;
}
resource_allocation_response_msg_t
*
existing_allocation
(
void
)
{
uint32_t
old_job_id
;
resource_allocation_response_msg_t
*
resp
=
NULL
;
if
((
old_job_id
=
jobid_from_env
())
==
0
)
return
NULL
;
if
(
slurm_allocation_lookup
(
old_job_id
,
&
resp
)
<
0
)
{
if
(
opt
.
parallel_debug
||
opt
.
jobid_set
)
return
NULL
;
/* create new allocation as needed */
if
(
errno
==
ESLURM_ALREADY_DONE
)
error
(
"SLURM job %u has expired."
,
old_job_id
);
else
error
(
"Unable to confirm allocation for job %u: %m"
,
old_job_id
);
info
(
"Check SLURM_JOBID environment variable "
"for expired or invalid job."
);
exit
(
1
);
}
return
resp
;
}
/*
* Returns jobid if SLURM_JOBID was set in the user's environment
* or if --jobid option was given, else returns 0
...
...
This diff is collapsed.
Click to expand it.
src/srun/allocate.h
+
8
−
0
View file @
16bbb9c4
...
...
@@ -72,6 +72,14 @@ job_desc_msg_t * job_desc_msg_create_from_opts (char *script);
*/
void
job_desc_msg_destroy
(
job_desc_msg_t
*
j
);
/*
* Check for SLURM_JOBID environment variable, and if it is a valid
* jobid, return a pseudo allocation response pointer.
*
* Returns NULL if SLURM_JOBID is not present or is invalid.
*/
resource_allocation_response_msg_t
*
existing_allocation
(
void
);
/*
* Return the jobid number stored in SLURM_JOBID env var
*
...
...
This diff is collapsed.
Click to expand it.
src/srun/srun.c
+
2
−
1
View file @
16bbb9c4
...
...
@@ -238,7 +238,8 @@ int srun(int ac, char **av)
xfree
(
env
);
exit
(
exitcode
);
}
else
if
((
job_id
=
jobid_from_env
()))
{
}
else
if
((
resp
=
existing_allocation
()))
{
slurm_free_resource_allocation_response_msg
(
resp
);
if
(
opt
.
allocate
)
{
error
(
"job %u already has an allocation"
,
job_id
);
...
...
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