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
4199ab97
Commit
4199ab97
authored
21 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Change some verbose variable names for greater clarity. No change in logic.
parent
f0288857
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/slurmctld/read_config.c
+60
-70
60 additions, 70 deletions
src/slurmctld/read_config.c
with
60 additions
and
70 deletions
src/slurmctld/read_config.c
+
60
−
70
View file @
4199ab97
...
...
@@ -89,42 +89,41 @@ int node_record_count = 0;
*/
static
int
_build_bitmaps
(
void
)
{
int
i
,
j
,
error_code
;
int
i
,
j
,
error_code
=
SLURM_SUCCESS
;
char
*
this_node_name
;
ListIterator
config_
record_
iterator
;
ListIterator
part_
record_
iterator
;
struct
config_record
*
config_
record_point
;
struct
part_record
*
part_
record_point
;
struct
node_record
*
node_
record_point
;
ListIterator
config_iterator
;
ListIterator
part_iterator
;
struct
config_record
*
config_
ptr
;
struct
part_record
*
part_
ptr
;
struct
node_record
*
node_
ptr
;
bitstr_t
*
all_part_node_bitmap
;
hostlist_t
host_list
;
error_code
=
0
;
last_node_update
=
time
(
NULL
);
last_part_update
=
time
(
NULL
);
/* initialize the idle and up bitmaps */
FREE_NULL_BITMAP
(
idle_node_bitmap
);
FREE_NULL_BITMAP
(
avail_node_bitmap
);
idle_node_bitmap
=
(
bitstr_t
*
)
bit_alloc
(
node_record_count
);
avail_node_bitmap
=
(
bitstr_t
*
)
bit_alloc
(
node_record_count
);
idle_node_bitmap
=
(
bitstr_t
*
)
bit_alloc
(
node_record_count
);
avail_node_bitmap
=
(
bitstr_t
*
)
bit_alloc
(
node_record_count
);
if
((
idle_node_bitmap
==
NULL
)
||
(
avail_node_bitmap
==
NULL
))
fatal
(
"memory allocation failure"
);
/* initialize the configuration bitmaps */
config_
record_
iterator
=
list_iterator_create
(
config_list
);
if
(
config_
record_
iterator
==
NULL
)
config_iterator
=
list_iterator_create
(
config_list
);
if
(
config_iterator
==
NULL
)
fatal
(
"memory allocation failure"
);
while
((
config_
record_point
=
(
struct
config_record
*
)
list_next
(
config_
record_
iterator
)))
{
FREE_NULL_BITMAP
(
config_
record_point
->
node_bitmap
);
config_
record_point
->
node_bitmap
=
while
((
config_
ptr
=
(
struct
config_record
*
)
list_next
(
config_iterator
)))
{
FREE_NULL_BITMAP
(
config_
ptr
->
node_bitmap
);
config_
ptr
->
node_bitmap
=
(
bitstr_t
*
)
bit_alloc
(
node_record_count
);
if
(
config_
record_point
->
node_bitmap
==
NULL
)
if
(
config_
ptr
->
node_bitmap
==
NULL
)
fatal
(
"memory allocation failure"
);
}
list_iterator_destroy
(
config_
record_
iterator
);
list_iterator_destroy
(
config_iterator
);
/* scan all nodes and identify which are up, idle and
* their configuration */
...
...
@@ -156,59 +155,53 @@ static int _build_bitmaps(void)
all_part_node_bitmap
=
(
bitstr_t
*
)
bit_alloc
(
node_record_count
);
if
(
all_part_node_bitmap
==
NULL
)
fatal
(
"memory allocation failure"
);
part_
record_
iterator
=
list_iterator_create
(
part_list
);
if
(
part_
record_
iterator
==
NULL
)
part_iterator
=
list_iterator_create
(
part_list
);
if
(
part_iterator
==
NULL
)
fatal
(
"memory allocation failure"
);
while
((
part_record_point
=
(
struct
part_record
*
)
list_next
(
part_record_iterator
)))
{
FREE_NULL_BITMAP
(
part_record_point
->
node_bitmap
);
part_record_point
->
node_bitmap
=
while
((
part_ptr
=
(
struct
part_record
*
)
list_next
(
part_iterator
)))
{
FREE_NULL_BITMAP
(
part_ptr
->
node_bitmap
);
part_ptr
->
node_bitmap
=
(
bitstr_t
*
)
bit_alloc
(
node_record_count
);
if
(
part_
record_point
->
node_bitmap
==
NULL
)
if
(
part_
ptr
->
node_bitmap
==
NULL
)
fatal
(
"memory allocation failure"
);
/* check for each node in the partition */
if
((
part_record_point
->
nodes
==
NULL
)
||
(
part_record_point
->
nodes
[
0
]
==
'\0'
))
if
((
part_ptr
->
nodes
==
NULL
)
||
(
part_ptr
->
nodes
[
0
]
==
'\0'
))
continue
;
if
((
host_list
=
hostlist_create
(
part_record_point
->
nodes
))
==
NULL
)
{
if
((
host_list
=
hostlist_create
(
part_ptr
->
nodes
))
==
NULL
)
{
error
(
"hostlist_create error for %s, %m"
,
part_
record_point
->
nodes
);
part_
ptr
->
nodes
);
continue
;
}
while
((
this_node_name
=
hostlist_shift
(
host_list
)))
{
node_record_point
=
find_node_record
(
this_node_name
);
if
(
node_record_point
==
NULL
)
{
node_ptr
=
find_node_record
(
this_node_name
);
if
(
node_ptr
==
NULL
)
{
error
(
"_build_bitmaps: invalid node name "
"specified %s"
,
this_node_name
);
free
(
this_node_name
);
continue
;
}
j
=
node_
record_point
-
node_record_table_ptr
;
j
=
node_
ptr
-
node_record_table_ptr
;
if
(
bit_test
(
all_part_node_bitmap
,
j
)
==
1
)
{
error
(
"_build_bitmaps: node %s defined in "
"more than one partition"
,
this_node_name
);
error
(
"_build_bitmaps: only the first "
"specification is honored"
);
}
else
{
bit_set
(
part_
record_point
->
node_bitmap
,
j
);
bit_set
(
part_
ptr
->
node_bitmap
,
j
);
bit_set
(
all_part_node_bitmap
,
j
);
part_record_point
->
total_nodes
++
;
part_record_point
->
total_cpus
+=
node_record_point
->
cpus
;
node_record_point
->
partition_ptr
=
part_record_point
;
part_ptr
->
total_nodes
++
;
part_ptr
->
total_cpus
+=
node_ptr
->
cpus
;
node_ptr
->
partition_ptr
=
part_ptr
;
}
free
(
this_node_name
);
}
hostlist_destroy
(
host_list
);
}
list_iterator_destroy
(
part_
record_
iterator
);
list_iterator_destroy
(
part_iterator
);
bit_free
(
all_part_node_bitmap
);
return
error_code
;
}
...
...
@@ -258,8 +251,8 @@ static int _parse_node_spec(char *in_line)
char
*
this_node_addr
,
*
this_node_name
;
int
error_code
,
first
,
i
;
int
state_val
,
cpus_val
,
real_memory_val
,
tmp_disk_val
,
weight_val
;
struct
node_record
*
node_ptr
;
struct
config_record
*
config_p
oin
t
=
NULL
;
struct
node_record
*
node_ptr
;
struct
config_record
*
config_pt
r
=
NULL
;
hostlist_t
addr_list
=
NULL
,
host_list
=
NULL
;
node_addr
=
node_name
=
state
=
feature
=
(
char
*
)
NULL
;
...
...
@@ -350,22 +343,20 @@ static int _parse_node_spec(char *in_line)
if
(
first
==
1
)
{
first
=
0
;
config_point
=
create_config_record
();
if
(
config_point
->
nodes
)
free
(
config_point
->
nodes
);
config_point
->
nodes
=
node_name
;
config_ptr
=
create_config_record
();
config_ptr
->
nodes
=
node_name
;
if
(
cpus_val
!=
NO_VAL
)
config_p
oin
t
->
cpus
=
cpus_val
;
config_pt
r
->
cpus
=
cpus_val
;
if
(
real_memory_val
!=
NO_VAL
)
config_p
oin
t
->
real_memory
=
config_pt
r
->
real_memory
=
real_memory_val
;
if
(
tmp_disk_val
!=
NO_VAL
)
config_p
oin
t
->
tmp_disk
=
tmp_disk_val
;
config_pt
r
->
tmp_disk
=
tmp_disk_val
;
if
(
weight_val
!=
NO_VAL
)
config_p
oin
t
->
weight
=
weight_val
;
config_pt
r
->
weight
=
weight_val
;
if
(
feature
)
{
xfree
(
config_p
oin
t
->
feature
);
config_p
oin
t
->
feature
=
feature
;
xfree
(
config_pt
r
->
feature
);
config_pt
r
->
feature
=
feature
;
feature
=
NULL
;
}
}
...
...
@@ -379,7 +370,7 @@ static int _parse_node_spec(char *in_line)
}
if
(
node_ptr
==
NULL
)
{
node_ptr
=
create_node_record
(
config_p
oin
t
,
node_ptr
=
create_node_record
(
config_pt
r
,
this_node_name
);
if
((
state_val
!=
NO_VAL
)
&&
(
state_val
!=
NODE_STATE_UNKNOWN
))
...
...
@@ -449,7 +440,7 @@ static int _parse_part_spec(char *in_line)
int
min_nodes_val
=
NO_VAL
,
root_val
=
NO_VAL
,
default_val
=
NO_VAL
;
int
state_val
=
NO_VAL
,
shared_val
=
NO_VAL
;
int
error_code
;
struct
part_record
*
part_
record_point
;
struct
part_record
*
part_
ptr
;
if
((
error_code
=
load_string
(
&
partition_name
,
"PartitionName="
,
in_line
)))
...
...
@@ -580,11 +571,10 @@ static int _parse_part_spec(char *in_line)
return
0
;
}
part_record_point
=
list_find_first
(
part_list
,
&
list_find_part
,
partition_name
);
if
(
part_record_point
==
NULL
)
{
part_record_point
=
create_part_record
();
strcpy
(
part_record_point
->
name
,
partition_name
);
part_ptr
=
list_find_first
(
part_list
,
&
list_find_part
,
partition_name
);
if
(
part_ptr
==
NULL
)
{
part_ptr
=
create_part_record
();
strcpy
(
part_ptr
->
name
,
partition_name
);
}
else
{
info
(
"_parse_node_spec: duplicate entry for partition %s"
,
partition_name
);
...
...
@@ -595,27 +585,27 @@ static int _parse_part_spec(char *in_line)
"from %s to %s"
,
default_part_name
,
partition_name
);
strcpy
(
default_part_name
,
partition_name
);
default_part_loc
=
part_
record_point
;
default_part_loc
=
part_
ptr
;
}
if
(
max_time_val
!=
NO_VAL
)
part_
record_point
->
max_time
=
max_time_val
;
part_
ptr
->
max_time
=
max_time_val
;
if
(
max_nodes_val
!=
NO_VAL
)
part_
record_point
->
max_nodes
=
max_nodes_val
;
part_
ptr
->
max_nodes
=
max_nodes_val
;
if
(
min_nodes_val
!=
NO_VAL
)
part_
record_point
->
min_nodes
=
min_nodes_val
;
part_
ptr
->
min_nodes
=
min_nodes_val
;
if
(
root_val
!=
NO_VAL
)
part_
record_point
->
root_only
=
root_val
;
part_
ptr
->
root_only
=
root_val
;
if
(
state_val
!=
NO_VAL
)
part_
record_point
->
state_up
=
state_val
;
part_
ptr
->
state_up
=
state_val
;
if
(
shared_val
!=
NO_VAL
)
part_
record_point
->
shared
=
shared_val
;
part_
ptr
->
shared
=
shared_val
;
if
(
allow_groups
)
{
xfree
(
part_
record_point
->
allow_groups
);
part_
record_point
->
allow_groups
=
allow_groups
;
xfree
(
part_
ptr
->
allow_groups
);
part_
ptr
->
allow_groups
=
allow_groups
;
allow_groups
=
NULL
;
}
if
(
nodes
)
{
xfree
(
part_
record_point
->
nodes
);
xfree
(
part_
ptr
->
nodes
);
if
(
strcmp
(
nodes
,
"localhost"
)
==
0
)
{
xfree
(
nodes
);
nodes
=
xmalloc
(
128
);
...
...
@@ -623,7 +613,7 @@ static int _parse_part_spec(char *in_line)
fatal
(
"memory allocation failure"
);
getnodename
(
nodes
,
128
);
}
part_
record_point
->
nodes
=
nodes
;
part_
ptr
->
nodes
=
nodes
;
nodes
=
NULL
;
}
xfree
(
partition_name
);
...
...
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