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
01933d12
Commit
01933d12
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Added functions to print job steps to API.
Now print job steps properly.
parent
4ea7e781
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/scontrol/scontrol.c
+19
-32
19 additions, 32 deletions
src/scontrol/scontrol.c
with
19 additions
and
32 deletions
src/scontrol/scontrol.c
+
19
−
32
View file @
01933d12
/*****************************************************************************\
* scontrol - administration tool for slurm.
* provides interface to read, write, update, and configurations.
*
scontrol - administration tool for slurm.
*
provides interface to read, write, update, and configurations.
*****************************************************************************
* Copyright (C) 2002 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
...
...
@@ -485,39 +485,22 @@ print_part (char *partition_name)
void
print_step
(
char
*
job_step_id_str
)
{
int
error_code
,
i
,
print_cnt
=
0
;
uint32_t
job_id
=
0
,
step_id
=
0
;
static
job_info_msg_t
*
old_job_buffer_ptr
=
NULL
;
job_info_msg_t
*
job_buffer_ptr
=
NULL
;
job_info_t
*
job_ptr
=
NULL
;
int
error_code
,
i
,
print_cnt
=
0
;
uint32_t
job_id
=
0
;
uint16_t
step_id
=
0
;
char
*
next_str
;
job_step_info_response_msg_t
*
job_step_info_ptr
;
job_step_info_t
*
job_step_ptr
;
printf
(
"only printing job info at present
\n
"
);
if
(
old_job_buffer_ptr
)
{
error_code
=
slurm_load_jobs
(
old_job_buffer_ptr
->
last_update
,
&
job_buffer_ptr
);
if
(
error_code
==
0
)
slurm_free_job_info_msg
(
old_job_buffer_ptr
);
else
if
(
slurm_get_errno
()
==
SLURM_NO_CHANGE_IN_DATA
)
{
job_buffer_ptr
=
old_job_buffer_ptr
;
error_code
=
0
;
if
(
quiet_flag
==
-
1
)
printf
(
"slurm_free_job_info no change in data
\n
"
);
}
}
else
error_code
=
slurm_load_jobs
((
time_t
)
NULL
,
&
job_buffer_ptr
);
error_code
=
slurm_get_job_steps
(
job_id
,
step_id
,
&
job_step_info_ptr
);
if
(
error_code
)
{
if
(
quiet_flag
!=
1
)
slurm_perror
(
"slurm_
load_job
s error"
);
slurm_perror
(
"slurm_
get_job_step
s error"
);
return
;
}
else
if
(
error_code
==
0
)
old_job_buffer_ptr
=
job_buffer_ptr
;
if
(
quiet_flag
==
-
1
)
printf
(
"last_update_time=%ld
\n
"
,
(
long
)
job_
buffer
_ptr
->
last_update
);
printf
(
"last_update_time=%ld
,
\n
"
,
(
long
)
job_
step_info
_ptr
->
last_update
);
if
(
job_step_id_str
)
{
job_id
=
(
uint32_t
)
strtol
(
job_step_id_str
,
&
next_str
,
10
);
...
...
@@ -525,22 +508,26 @@ printf ("only printing job info at present\n");
step_id
=
(
uint32_t
)
strtol
(
&
next_str
[
1
],
NULL
,
10
);
}
job_ptr
=
job_buffer_ptr
->
job_array
;
for
(
i
=
0
;
i
<
job_buffer_ptr
->
record_count
;
i
++
)
{
if
(
job_step_id_str
&&
job_id
!=
job_ptr
[
i
].
job_id
)
job_step_ptr
=
job_step_info_ptr
->
job_steps
;
for
(
i
=
0
;
i
<
job_step_info_ptr
->
job_step_count
;
i
++
)
{
if
(
job_step_id_str
&&
job_id
!=
job_step_ptr
[
i
].
job_id
)
continue
;
if
(
job_step_id_str
&&
step_id
!=
job_step_ptr
[
i
].
step_id
)
continue
;
print_cnt
++
;
slurm_print_job_info
(
stdout
,
&
job_ptr
[
i
]
)
;
slurm_print_job_
step_
info
(
stdout
,
&
job_
step_
ptr
[
i
]
)
;
if
(
job_step_id_str
)
break
;
}
if
((
print_cnt
==
0
)
&&
(
quiet_flag
!=
1
))
{
if
(
job_
buffer_ptr
->
record
_count
)
if
(
job_
step_info_ptr
->
job_step
_count
)
printf
(
"Job step %u.%u not found
\n
"
,
job_id
,
step_id
);
else
printf
(
"No job steps in the system
\n
"
);
}
slurm_free_job_step_info_response_msg
(
job_step_info_ptr
);
}
...
...
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