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
91748b8f
Commit
91748b8f
authored
21 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Add support for sorting output by job name.
parent
180b4414
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/squeue/opts.c
+1
-0
1 addition, 0 deletions
src/squeue/opts.c
src/squeue/print.c
+11
-0
11 additions, 0 deletions
src/squeue/print.c
src/squeue/print.h
+3
-0
3 additions, 0 deletions
src/squeue/print.h
with
15 additions
and
0 deletions
src/squeue/opts.c
+
1
−
0
View file @
91748b8f
...
...
@@ -501,6 +501,7 @@ _print_options()
printf
(
"step_flag %d
\n
"
,
params
.
step_flag
);
printf
(
"jobs %s
\n
"
,
params
.
jobs
);
printf
(
"partitions %s
\n
"
,
params
.
partitions
)
;
printf
(
"sort %s
\n
"
,
params
.
sort
)
;
printf
(
"states %s
\n
"
,
params
.
states
)
;
printf
(
"steps %s
\n
"
,
params
.
steps
);
printf
(
"users %s
\n
"
,
params
.
users
);
...
...
This diff is collapsed.
Click to expand it.
src/squeue/print.c
+
11
−
0
View file @
91748b8f
...
...
@@ -107,6 +107,8 @@ int print_jobs_array(job_info_t * jobs, int size, List format)
continue
;
else
if
(
params
.
sort
[
i
]
==
'i'
)
sort_job_by_job_id
(
job_list
);
else
if
(
params
.
sort
[
i
]
==
'j'
)
sort_job_by_job_name
(
job_list
);
else
if
(
params
.
sort
[
i
]
==
'p'
)
sort_job_by_priority
(
job_list
);
else
if
(
params
.
sort
[
i
]
==
'P'
)
...
...
@@ -948,6 +950,15 @@ int _sort_job_by_id(void *void1, void *void2)
return
job1
->
job_id
-
job2
->
job_id
;
}
/* sort lower to higher */
int
_sort_job_by_name
(
void
*
void1
,
void
*
void2
)
{
job_info_t
*
job1
=
(
job_info_t
*
)
void1
;
job_info_t
*
job2
=
(
job_info_t
*
)
void2
;
return
strcmp
(
job1
->
name
,
job2
->
name
);
}
/* sort higher to lower */
int
_sort_job_by_priority
(
void
*
void1
,
void
*
void2
)
{
...
...
This diff is collapsed.
Click to expand it.
src/squeue/print.h
+
3
−
0
View file @
91748b8f
...
...
@@ -216,6 +216,8 @@ int _print_step_nodes(job_step_info_t * step, int width,
*****************************************************************************/
#define sort_job_by_job_id(list) \
list_sort(list,_sort_job_by_id)
#define sort_job_by_job_name(list) \
list_sort(list,_sort_job_by_name)
#define sort_job_by_priority(list) \
list_sort(list,_sort_job_by_priority)
#define sort_job_by_partition(list) \
...
...
@@ -226,6 +228,7 @@ int _print_step_nodes(job_step_info_t * step, int width,
list_sort(list,_sort_job_by_user)
int
_sort_job_by_id
(
void
*
void1
,
void
*
void2
);
int
_sort_job_by_name
(
void
*
void1
,
void
*
void2
);
int
_sort_job_by_priority
(
void
*
void1
,
void
*
void2
);
int
_sort_job_by_partition
(
void
*
void1
,
void
*
void2
);
int
_sort_job_by_state
(
void
*
void1
,
void
*
void2
);
...
...
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