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
746d0584
Commit
746d0584
authored
22 years ago
by
jce
Browse files
Options
Downloads
Patches
Plain Diff
changed print functions to print to a FILE*
fixed a couple of inconsistancies in slurm.h
parent
6687448c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/api/job_info.c
+24
-24
24 additions, 24 deletions
src/api/job_info.c
src/api/node_info.c
+8
-8
8 additions, 8 deletions
src/api/node_info.c
src/api/partition_info.c
+13
-13
13 additions, 13 deletions
src/api/partition_info.c
src/api/slurm.h
+7
-7
7 additions, 7 deletions
src/api/slurm.h
with
52 additions
and
52 deletions
src/api/job_info.c
+
24
−
24
View file @
746d0584
...
@@ -40,58 +40,58 @@
...
@@ -40,58 +40,58 @@
/* print the entire job_info_msg */
/* print the entire job_info_msg */
void
void
slurm_print_job_info_msg
(
job_info_msg_t
*
job_info_msg_ptr
)
slurm_print_job_info_msg
(
FILE
*
out
,
job_info_msg_t
*
job_info_msg_ptr
)
{
{
int
i
;
int
i
;
job_table_t
*
job_ptr
=
job_info_msg_ptr
->
job_array
;
job_table_t
*
job_ptr
=
job_info_msg_ptr
->
job_array
;
printf
(
"Jobs updated at %d, record count %d
\n
"
,
f
printf
(
out
,
"Jobs updated at %d, record count %d
\n
"
,
job_info_msg_ptr
->
last_update
,
job_info_msg_ptr
->
record_count
);
job_info_msg_ptr
->
last_update
,
job_info_msg_ptr
->
record_count
);
for
(
i
=
0
;
i
<
job_info_msg_ptr
->
record_count
;
i
++
)
for
(
i
=
0
;
i
<
job_info_msg_ptr
->
record_count
;
i
++
)
{
{
slurm_print_job_table
(
&
job_ptr
[
i
]
)
;
slurm_print_job_table
(
out
,
&
job_ptr
[
i
]
)
;
}
}
}
}
/* print an individual job_table entry */
/* print an individual job_table entry */
void
void
slurm_print_job_table
(
job_table_t
*
job_ptr
)
slurm_print_job_table
(
FILE
*
out
,
job_table_t
*
job_ptr
)
{
{
int
j
;
int
j
;
printf
(
"JobId=%u UserId=%u "
,
job_ptr
->
job_id
,
job_ptr
->
user_id
);
f
printf
(
out
,
"JobId=%u UserId=%u "
,
job_ptr
->
job_id
,
job_ptr
->
user_id
);
printf
(
"JobState=%u TimeLimit=%u "
,
job_ptr
->
job_state
,
job_ptr
->
time_limit
);
f
printf
(
out
,
"JobState=%u TimeLimit=%u "
,
job_ptr
->
job_state
,
job_ptr
->
time_limit
);
printf
(
"Priority=%u Partition=%s
\n
"
,
job_ptr
->
priority
,
job_ptr
->
partition
);
f
printf
(
out
,
"Priority=%u Partition=%s
\n
"
,
job_ptr
->
priority
,
job_ptr
->
partition
);
printf
(
" Name=%s NodeList=%s "
,
job_ptr
->
name
,
job_ptr
->
nodes
);
f
printf
(
out
,
" Name=%s NodeList=%s "
,
job_ptr
->
name
,
job_ptr
->
nodes
);
printf
(
"StartTime=%x EndTime=%x
\n
"
,
(
uint32_t
)
job_ptr
->
start_time
,
(
uint32_t
)
job_ptr
->
end_time
);
f
printf
(
out
,
"StartTime=%x EndTime=%x
\n
"
,
(
uint32_t
)
job_ptr
->
start_time
,
(
uint32_t
)
job_ptr
->
end_time
);
printf
(
" NodeListIndecies="
);
f
printf
(
out
,
" NodeListIndecies="
);
for
(
j
=
0
;
job_ptr
->
node_inx
;
j
++
)
{
for
(
j
=
0
;
job_ptr
->
node_inx
;
j
++
)
{
if
(
j
>
0
)
if
(
j
>
0
)
printf
(
",%d"
,
job_ptr
->
node_inx
[
j
]);
f
printf
(
out
,
",%d"
,
job_ptr
->
node_inx
[
j
]);
else
else
printf
(
"%d"
,
job_ptr
->
node_inx
[
j
]);
f
printf
(
out
,
"%d"
,
job_ptr
->
node_inx
[
j
]);
if
(
job_ptr
->
node_inx
[
j
]
==
-
1
)
if
(
job_ptr
->
node_inx
[
j
]
==
-
1
)
break
;
break
;
}
}
printf
(
"
\n
"
);
f
printf
(
out
,
"
\n
"
);
printf
(
" ReqProcs=%u ReqNodes=%u "
,
job_ptr
->
num_procs
,
job_ptr
->
num_nodes
);
f
printf
(
out
,
" ReqProcs=%u ReqNodes=%u "
,
job_ptr
->
num_procs
,
job_ptr
->
num_nodes
);
printf
(
"Shared=%u Contiguous=%u "
,
job_ptr
->
shared
,
job_ptr
->
contiguous
);
f
printf
(
out
,
"Shared=%u Contiguous=%u "
,
job_ptr
->
shared
,
job_ptr
->
contiguous
);
printf
(
"MinProcs=%u MinMemory=%u "
,
job_ptr
->
min_procs
,
job_ptr
->
min_memory
);
f
printf
(
out
,
"MinProcs=%u MinMemory=%u "
,
job_ptr
->
min_procs
,
job_ptr
->
min_memory
);
printf
(
"MinTmpDisk=%u
\n
"
,
job_ptr
->
min_tmp_disk
);
f
printf
(
out
,
"MinTmpDisk=%u
\n
"
,
job_ptr
->
min_tmp_disk
);
printf
(
" ReqNodeList=%s Features=%s "
,
job_ptr
->
req_nodes
,
job_ptr
->
features
);
f
printf
(
out
,
" ReqNodeList=%s Features=%s "
,
job_ptr
->
req_nodes
,
job_ptr
->
features
);
printf
(
"JobScript=%s
\n
"
,
job_ptr
->
job_script
);
f
printf
(
out
,
"JobScript=%s
\n
"
,
job_ptr
->
job_script
);
printf
(
" ReqNodeListIndecies="
);
f
printf
(
out
,
" ReqNodeListIndecies="
);
for
(
j
=
0
;
job_ptr
->
req_node_inx
;
j
++
)
{
for
(
j
=
0
;
job_ptr
->
req_node_inx
;
j
++
)
{
if
(
j
>
0
)
if
(
j
>
0
)
printf
(
",%d"
,
job_ptr
->
req_node_inx
[
j
]);
f
printf
(
out
,
",%d"
,
job_ptr
->
req_node_inx
[
j
]);
else
else
printf
(
"%d"
,
job_ptr
->
req_node_inx
[
j
]);
f
printf
(
out
,
"%d"
,
job_ptr
->
req_node_inx
[
j
]);
if
(
job_ptr
->
req_node_inx
[
j
]
==
-
1
)
if
(
job_ptr
->
req_node_inx
[
j
]
==
-
1
)
break
;
break
;
}
}
printf
(
"
\n\n
"
);
f
printf
(
out
,
"
\n\n
"
);
}
}
/* slurm_load_job - load the supplied job information buffer if changed */
/* slurm_load_job - load the supplied job information buffer if changed */
...
...
This diff is collapsed.
Click to expand it.
src/api/node_info.c
+
8
−
8
View file @
746d0584
...
@@ -46,32 +46,32 @@
...
@@ -46,32 +46,32 @@
/* print the entire node_info_msg */
/* print the entire node_info_msg */
void
void
slurm_print_node_info_msg
(
node_info_msg_t
*
node_info_msg_ptr
)
slurm_print_node_info_msg
(
FILE
*
out
,
node_info_msg_t
*
node_info_msg_ptr
)
{
{
int
i
;
int
i
;
node_table_t
*
node_ptr
=
node_info_msg_ptr
->
node_array
;
node_table_t
*
node_ptr
=
node_info_msg_ptr
->
node_array
;
printf
(
"Nodes updated at %d, record count %d
\n
"
,
f
printf
(
out
,
"Nodes updated at %d, record count %d
\n
"
,
node_info_msg_ptr
->
last_update
,
node_info_msg_ptr
->
record_count
);
node_info_msg_ptr
->
last_update
,
node_info_msg_ptr
->
record_count
);
for
(
i
=
0
;
i
<
node_info_msg_ptr
->
record_count
;
i
++
)
for
(
i
=
0
;
i
<
node_info_msg_ptr
->
record_count
;
i
++
)
{
{
slurm_print_node_table
(
&
node_ptr
[
i
]
)
;
slurm_print_node_table
(
out
,
&
node_ptr
[
i
]
)
;
}
}
}
}
/* print an individual node_table entry */
/* print an individual node_table entry */
void
void
slurm_print_node_table
(
node_table_t
*
node_ptr
)
slurm_print_node_table
(
FILE
*
out
,
node_table_t
*
node_ptr
)
{
{
printf
(
"NodeName=%s CPUs=%u "
,
f
printf
(
out
,
"NodeName=%s CPUs=%u "
,
node_ptr
->
name
,
node_ptr
->
cpus
);
node_ptr
->
name
,
node_ptr
->
cpus
);
printf
(
"RealMemory=%u TmpDisk=%u "
,
f
printf
(
out
,
"RealMemory=%u TmpDisk=%u "
,
node_ptr
->
real_memory
,
node_ptr
->
tmp_disk
);
node_ptr
->
real_memory
,
node_ptr
->
tmp_disk
);
printf
(
"State=%u Weight=%u "
,
f
printf
(
out
,
"State=%u Weight=%u "
,
node_ptr
->
node_state
,
node_ptr
->
weight
);
node_ptr
->
node_state
,
node_ptr
->
weight
);
printf
(
"Features=%s Partition=%s
\n\n
"
,
f
printf
(
out
,
"Features=%s Partition=%s
\n\n
"
,
node_ptr
->
features
,
node_ptr
->
partition
);
node_ptr
->
features
,
node_ptr
->
partition
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/api/partition_info.c
+
13
−
13
View file @
746d0584
...
@@ -17,37 +17,37 @@
...
@@ -17,37 +17,37 @@
#include
<src/common/slurm_protocol_api.h>
#include
<src/common/slurm_protocol_api.h>
void
slurm_print_partition_info
(
partition_info_msg_t
*
part_info_ptr
)
void
slurm_print_partition_info
(
FILE
*
out
,
partition_info_msg_t
*
part_info_ptr
)
{
{
int
i
;
int
i
;
partition_table_t
*
part_ptr
=
part_info_ptr
->
partition_array
;
partition_table_t
*
part_ptr
=
part_info_ptr
->
partition_array
;
for
(
i
=
0
;
i
<
part_info_ptr
->
record_count
;
i
++
)
{
for
(
i
=
0
;
i
<
part_info_ptr
->
record_count
;
i
++
)
{
slurm_print_partition_table
(
&
part_ptr
[
i
]
)
;
slurm_print_partition_table
(
out
,
&
part_ptr
[
i
]
)
;
}
}
}
}
void
slurm_print_partition_table
(
partition_table_t
*
part_ptr
)
void
slurm_print_partition_table
(
FILE
*
out
,
partition_table_t
*
part_ptr
)
{
{
int
j
;
int
j
;
printf
(
"PartitionName=%s MaxTime=%u "
,
part_ptr
->
name
,
part_ptr
->
max_time
);
f
printf
(
out
,
"PartitionName=%s MaxTime=%u "
,
part_ptr
->
name
,
part_ptr
->
max_time
);
printf
(
"MaxNodes=%u TotalNodes=%u "
,
part_ptr
->
max_nodes
,
part_ptr
->
total_nodes
);
f
printf
(
out
,
"MaxNodes=%u TotalNodes=%u "
,
part_ptr
->
max_nodes
,
part_ptr
->
total_nodes
);
printf
(
"TotalCPUs=%u Key=%u
\n
"
,
part_ptr
->
total_cpus
,
part_ptr
->
key
);
f
printf
(
out
,
"TotalCPUs=%u Key=%u
\n
"
,
part_ptr
->
total_cpus
,
part_ptr
->
key
);
printf
(
" Default=%u "
,
part_ptr
->
default_part
);
f
printf
(
out
,
" Default=%u "
,
part_ptr
->
default_part
);
printf
(
"Shared=%u StateUp=%u "
,
part_ptr
->
shared
,
part_ptr
->
state_up
);
f
printf
(
out
,
"Shared=%u StateUp=%u "
,
part_ptr
->
shared
,
part_ptr
->
state_up
);
printf
(
"Nodes=%s AllowGroups=%s
\n
"
,
part_ptr
->
nodes
,
part_ptr
->
allow_groups
);
f
printf
(
out
,
"Nodes=%s AllowGroups=%s
\n
"
,
part_ptr
->
nodes
,
part_ptr
->
allow_groups
);
printf
(
" NodeIndecies="
);
f
printf
(
out
,
" NodeIndecies="
);
for
(
j
=
0
;
part_ptr
->
node_inx
;
j
++
)
{
for
(
j
=
0
;
part_ptr
->
node_inx
;
j
++
)
{
if
(
j
>
0
)
if
(
j
>
0
)
printf
(
",%d"
,
part_ptr
->
node_inx
[
j
]);
f
printf
(
out
,
",%d"
,
part_ptr
->
node_inx
[
j
]);
else
else
printf
(
"%d"
,
part_ptr
->
node_inx
[
j
]);
f
printf
(
out
,
"%d"
,
part_ptr
->
node_inx
[
j
]);
if
(
part_ptr
->
node_inx
[
j
]
==
-
1
)
if
(
part_ptr
->
node_inx
[
j
]
==
-
1
)
break
;
break
;
}
}
printf
(
"
\n\n
"
);
f
printf
(
out
,
"
\n\n
"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/api/slurm.h
+
7
−
7
View file @
746d0584
...
@@ -117,27 +117,27 @@ extern void slurm_free_node_info (node_info_msg_t * node_buffer_ptr);
...
@@ -117,27 +117,27 @@ extern void slurm_free_node_info (node_info_msg_t * node_buffer_ptr);
* slurm_print_job_info_msg - prints the job information buffer (if allocated)
* slurm_print_job_info_msg - prints the job information buffer (if allocated)
* NOTE: buffer is loaded by slurm_load_job_info .
* NOTE: buffer is loaded by slurm_load_job_info .
*/
*/
extern
void
slurm_print_job_info_msg
(
job_info_msg_t
*
job_info_msg_ptr
)
;
extern
void
slurm_print_job_info_msg
(
FILE
*
,
job_info_msg_t
*
job_info_msg_ptr
)
;
/* slurm_print_job_table - prints the job table object (if allocated) */
/* slurm_print_job_table - prints the job table object (if allocated) */
extern
void
slurm_print_job_table
(
job_table_t
*
job_ptr
);
extern
void
slurm_print_job_table
(
FILE
*
,
job_table_t
*
job_ptr
);
/*
/*
* slurm_print_node_info_msg - prints the node information buffer (if allocated)
* slurm_print_node_info_msg - prints the node information buffer (if allocated)
* NOTE: buffer is loaded by slurm_load_node_info .
* NOTE: buffer is loaded by slurm_load_node_info .
*/
*/
extern
void
slurm_print_node_info_msg
(
node_info_msg_t
*
node_info_msg_ptr
)
;
extern
void
slurm_print_node_info_msg
(
FILE
*
,
node_info_msg_t
*
node_info_msg_ptr
)
;
/* slurm_print_node_table - prints the node table object (if allocated) */
/* slurm_print_node_table - prints the node table object (if allocated) */
extern
void
slurm_print_node_table
(
node_table_t
*
node_ptr
);
extern
void
slurm_print_node_table
(
FILE
*
,
node_table_t
*
node_ptr
);
/*
/*
* slurm_free_part_info - free the partition information buffer (if allocated)
* slurm_free_part_info - free the partition information buffer (if allocated)
* NOTE: buffer is loaded by load_part.
* NOTE: buffer is loaded by load_part.
*/
*/
extern
void
slurm_free_partition_info
(
partition_info_msg_t
*
part_info_ptr
);
extern
void
slurm_free_partition_info
(
partition_info_msg_t
*
part_info_ptr
);
extern
void
slurm_print_partition_info
(
partition_info_msg_t
*
part_info_ptr
)
;
extern
void
slurm_print_partition_info
(
FILE
*
,
partition_info_msg_t
*
part_info_ptr
)
;
extern
void
slurm_print_partition_table
(
partition_table_t
*
part_ptr
)
;
extern
void
slurm_print_partition_table
(
FILE
*
,
partition_table_t
*
part_ptr
)
;
/*
/*
* slurm_load_build - load the slurm build information buffer for use by info
* slurm_load_build - load the slurm build information buffer for use by info
...
@@ -191,7 +191,7 @@ extern int slurm_load_partitions (time_t update_time, partition_info_msg_t **par
...
@@ -191,7 +191,7 @@ extern int slurm_load_partitions (time_t update_time, partition_info_msg_t **par
* Shared=<YES|NO> TimeLimit=<minutes> TotalNodes=<count>
* Shared=<YES|NO> TimeLimit=<minutes> TotalNodes=<count>
* TotalProcs=<count> Immediate=<YES|NO>
* TotalProcs=<count> Immediate=<YES|NO>
*/
*/
extern
int
slurm_submit
(
char
*
spec
,
uint32
_t
*
job_
i
d
);
extern
int
slurm_submit
_batch_job
(
job_desc_msg
_t
*
job_d
esc_msg
);
/*
/*
* slurm_will_run - determine if a job would execute immediately
* slurm_will_run - determine if a job would execute immediately
...
...
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