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
d82df18e
Commit
d82df18e
authored
18 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Add example to man page.
parent
4385b639
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
doc/man/man3/slurm_step_launch.3
+64
-11
64 additions, 11 deletions
doc/man/man3/slurm_step_launch.3
with
64 additions
and
11 deletions
doc/man/man3/slurm_step_launch.3
+
64
−
11
View file @
d82df18e
...
@@ -100,29 +100,83 @@ SLURM controller.
...
@@ -100,29 +100,83 @@ SLURM controller.
.SH "EXAMPLE
.SH "EXAMPLE
.LP
.LP
#include <signal.h>
.br
#include <stdio.h>
#include <stdio.h>
.br
.br
#include <stdlib.h>
#include <stdlib.h>
.br
.br
#include <s
tring
.h>
#include <s
lurm/slurm
.h>
.br
.br
#include <unistd.h>
#include <slurm/slurm_errno.h>
.LP
static void _task_start(launch_tasks_response_msg_t *msg)
.br
.br
#include <sys/types.h>
printf("task startup completed\\n");
.br
.br
#include <slurm/slurm.h>
}
.br
.br
#include <slurm/slurm_errno.h>
static void _task_finish(task_exit_msg_t *msg)
.br
printf("tasks completed\\n");
.br
}
.LP
.LP
int main (int argc, char *argv[])
int main (int argc, char *argv[])
.br
.br
{
{
.br
.br
/* To be done */
job_step_create_request_msg_t step_req;
.br
slurm_step_ctx step_ctx;
.br
slurm_job_step_launch_t params;
.br
slurm_job_step_launch_callbacks_t callbacks;
.br
.LP
/* Set up step_req here */
.br
step_ctx = slurm_step_ctx_create(&step_req);
.br
if (step_ctx == NULL) {
.br
slurm_perror("slurm_step_ctx_create");
.br
exit(1);
.br
}
.LP
slurm_job_step_launch_t_init(¶ms);
.br
/* Set params values here */
.br
callbacks.task_start = _task_start;
.br
callbacks.task_finish = _task_finish;
.br
if (slurm_step_launch(step_ctx, ¶ms, &callbacks)
.br
!= SLURM_SUCCESS) {
.br
slurm_perror("slurm_step_launch");
.br
exit(1);
.br
}
.br
if (slurm_step_launch_wait_start(step_ctx) != SLURM_SUCCESS) {
.br
slurm_perror("slurm_step_launch_wait_start");
.br
exit(1);
.br
}
.br
slurm_step_launch_wait_finish(step_ctx);
.br
slurm_step_ctx_destroy(step_ctx);
.br
.br
exit
(0);
exit(0);
.br
.br
}
}
...
@@ -150,7 +204,6 @@ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
...
@@ -150,7 +204,6 @@ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
details.
.SH "SEE ALSO"
.SH "SEE ALSO"
.LP
.LP
\fBslurm_allocate_resources\fR(3), \fBslurm_job_step_create\fR(3),
\fBslurm_step_ctx_create\fR(3), \fBslurm_step_ctx_destroy\fR(3),
\fBslurm_kill_job\fR(3),
\fBslurm_get_errno\fR(3), \fBslurm_perror\fR(3), \fBslurm_strerror\fR(3),
\fBslurm_get_errno\fR(3), \fBslurm_perror\fR(3), \fBslurm_strerror\fR(3),
\fBsalloc\fR(1), \fBsrun\fR(1)
\fBsalloc\fR(1), \fBsrun\fR(1)
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