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
5e6aa46e
Commit
5e6aa46e
authored
22 years ago
by
Mark Grondona
Browse files
Options
Downloads
Patches
Plain Diff
o factor "wait and qsw_prgdestroy()" code into separate function:
_wait_and_destroy_prg()
parent
e45a4f1f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/slurmd/elan_interconnect.c
+29
-27
29 additions, 27 deletions
src/slurmd/elan_interconnect.c
with
29 additions
and
27 deletions
src/slurmd/elan_interconnect.c
+
29
−
27
View file @
5e6aa46e
...
...
@@ -37,6 +37,34 @@ int launch_tasks ( launch_tasks_request_msg_t * launch_msg )
return
interconnect_init
(
launch_msg
);
}
int
_wait_and_destroy_prg
(
qsw_jobinfo_t
qsw_job
,
pid_t
pid
)
{
int
i
=
0
;
int
sleeptime
=
1
;
if
(
waitpid
(
pid
,
NULL
,
0
)
<
0
)
{
error
(
"waitpid: %m"
);
return
SLURM_ERROR
;
}
while
(
qsw_prgdestroy
(
qsw_job
)
<
0
)
{
i
++
;
error
(
"qsw_prgdestroy: %m"
);
if
(
i
==
1
)
{
debug
(
"sending SIGTERM to remaining tasks"
);
qsw_prgsignal
(
qsw_job
,
SIGTERM
);
}
else
{
debug
(
"sending SIGKILL to remaining tasks"
);
qsw_prgsignal
(
qsw_job
,
SIGKILL
);
}
debug
(
"going to sleep for %d seconds and try again"
);
sleep
(
sleeptime
*=
2
);
}
return
SLURM_SUCCESS
;
}
/* Contains interconnect specific setup instructions and then calls
* fan_out_task_launch */
int
interconnect_init
(
launch_tasks_request_msg_t
*
launch_msg
)
...
...
@@ -52,33 +80,7 @@ int interconnect_init ( launch_tasks_request_msg_t * launch_msg )
case
0
:
/* child falls thru */
break
;
default:
/* parent */
if
(
waitpid
(
pid
,
NULL
,
0
)
<
0
)
{
error
(
"elan interconnect_init waitpid error %m errno: %i"
,
errno
);
return
SLURM_ERROR
;
}
if
(
qsw_prgdestroy
(
launch_msg
->
qsw_job
)
<
0
)
{
qsw_prgsignal
(
launch_msg
->
qsw_job
,
SIGTERM
)
;
if
(
qsw_prgdestroy
(
launch_msg
->
qsw_job
)
<
0
)
{
qsw_prgsignal
(
launch_msg
->
qsw_job
,
SIGKILL
)
;
if
(
qsw_prgdestroy
(
launch_msg
->
qsw_job
)
<
0
)
{
error
(
"elan interconnect_init qsw_prgdestroy error %m errno: %i"
,
errno
);
return
SLURM_ERROR
;
}
else
{
return
SLURM_SUCCESS
;
}
}
else
{
return
SLURM_SUCCESS
;
}
}
else
{
return
SLURM_SUCCESS
;
}
return
_wait_and_destroy_prg
(
launch_msg
->
qsw_job
,
pid
);
}
/* Process 2: */
...
...
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