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
e0178830
Commit
e0178830
authored
20 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Report TORUS partitions in lower-case letters. General code clean-up.
parent
67e9f6d4
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/smap/grid_functions.c
+41
-19
41 additions, 19 deletions
src/smap/grid_functions.c
src/smap/partition_functions.c
+23
-8
23 additions, 8 deletions
src/smap/partition_functions.c
src/smap/smap.h
+5
-4
5 additions, 4 deletions
src/smap/smap.h
with
69 additions
and
31 deletions
src/smap/grid_functions.c
+
41
−
19
View file @
e0178830
...
...
@@ -27,29 +27,39 @@
#include
"src/smap/smap.h"
int
set_grid
(
int
start
,
int
end
,
int
count
)
extern
int
set_grid
(
int
start
,
int
end
,
int
count
)
{
int
x
,
y
,
z
;
for
(
y
=
DIM_SIZE
[
Y
]
-
1
;
y
>=
0
;
y
--
)
for
(
z
=
0
;
z
<
DIM_SIZE
[
Z
];
z
++
)
for
(
y
=
DIM_SIZE
[
Y
]
-
1
;
y
>=
0
;
y
--
)
{
for
(
z
=
0
;
z
<
DIM_SIZE
[
Z
];
z
++
)
{
for
(
x
=
0
;
x
<
DIM_SIZE
[
X
];
x
++
)
{
if
(
pa_system_ptr
->
grid
[
x
][
y
][
z
].
indecies
>=
start
&&
pa_system_ptr
->
grid
[
x
][
y
][
z
].
indecies
<=
end
)
{
if
(
pa_system_ptr
->
grid
[
x
][
y
][
z
].
state
!=
NODE_STATE_DOWN
||
pa_system_ptr
->
grid
[
x
][
y
][
z
].
state
!=
NODE_STATE_DRAINED
||
pa_system_ptr
->
grid
[
x
][
y
][
z
].
state
!=
NODE_STATE_DRAINING
)
{
pa_system_ptr
->
grid
[
x
][
y
][
z
].
letter
=
pa_system_ptr
->
fill_in_value
[
count
].
letter
;
pa_system_ptr
->
grid
[
x
][
y
][
z
].
color
=
pa_system_ptr
->
fill_in_value
[
count
].
color
;
}
}
if
((
pa_system_ptr
->
grid
[
x
][
y
][
z
].
indecies
<
start
)
||
(
pa_system_ptr
->
grid
[
x
][
y
][
z
].
indecies
>
end
))
continue
;
if
((
pa_system_ptr
->
grid
[
x
][
y
][
z
].
state
==
NODE_STATE_DOWN
)
||
(
pa_system_ptr
->
grid
[
x
][
y
][
z
].
state
==
NODE_STATE_DRAINED
)
||
(
pa_system_ptr
->
grid
[
x
][
y
][
z
].
state
==
NODE_STATE_DRAINING
))
continue
;
pa_system_ptr
->
grid
[
x
][
y
][
z
].
letter
=
pa_system_ptr
->
fill_in_value
[
count
].
letter
;
pa_system_ptr
->
grid
[
x
][
y
][
z
].
color
=
pa_system_ptr
->
fill_in_value
[
count
].
color
;
}
}
}
return
1
;
}
int
set_grid_bgl
(
int
startx
,
int
starty
,
int
startz
,
int
endx
,
int
endy
,
int
endz
,
int
count
)
extern
int
set_grid_bgl
(
int
startx
,
int
starty
,
int
startz
,
int
endx
,
int
endy
,
int
endz
,
int
count
,
bool
lower
)
{
int
x
,
y
,
z
;
int
i
=
0
;
int
i
=
0
,
offset
;
assert
(
endx
<
DIM_SIZE
[
X
]);
assert
(
startx
>=
0
);
assert
(
endy
<
DIM_SIZE
[
Y
]);
...
...
@@ -58,19 +68,31 @@ int set_grid_bgl(int startx, int starty, int startz, int endx, int endy,
assert
(
startz
>=
0
);
assert
(
count
<
pa_system_ptr
->
num_of_proc
);
assert
(
count
>=
0
);
for
(
x
=
startx
;
x
<=
endx
;
x
++
)
for
(
y
=
starty
;
y
<=
endy
;
y
++
)
if
(
lower
)
offset
=
32
;
else
offset
=
0
;
for
(
x
=
startx
;
x
<=
endx
;
x
++
)
{
for
(
y
=
starty
;
y
<=
endy
;
y
++
)
{
for
(
z
=
startz
;
z
<=
endz
;
z
++
)
{
pa_system_ptr
->
grid
[
x
][
y
][
z
].
letter
=
pa_system_ptr
->
fill_in_value
[
count
].
letter
;
pa_system_ptr
->
grid
[
x
][
y
][
z
].
color
=
pa_system_ptr
->
fill_in_value
[
count
].
color
;
pa_system_ptr
->
grid
[
x
][
y
][
z
].
letter
=
pa_system_ptr
->
fill_in_value
[
count
].
letter
+
offset
;
pa_system_ptr
->
grid
[
x
][
y
][
z
].
color
=
pa_system_ptr
->
fill_in_value
[
count
].
color
;
i
++
;
}
}
}
return
i
;
}
/*
_
print_grid - print values of every grid point */
void
print_grid
(
void
)
/* print_grid - print values of every grid point */
extern
void
print_grid
(
void
)
{
int
x
,
y
,
z
,
i
=
0
,
offset
=
DIM_SIZE
[
Z
];
int
grid_xcord
,
grid_ycord
=
2
;
...
...
This diff is collapsed.
Click to expand it.
src/smap/partition_functions.c
+
23
−
8
View file @
e0178830
...
...
@@ -78,6 +78,7 @@ void get_part(void)
char
node_entry
[
13
];
int
start
,
startx
,
starty
,
startz
,
endx
,
endy
,
endz
;
db2_block_info_t
*
block_ptr
;
bool
lower
;
if
(
part_info_ptr
)
{
error_code
=
slurm_load_partitions
(
part_info_ptr
->
last_update
,
...
...
@@ -138,17 +139,24 @@ void get_part(void)
endz
=
(
start
%
10
);
j
+=
5
;
block_ptr
=
_find_part_db2
(
part
.
allow_groups
);
lower
=
false
;
if
(
block_ptr
)
{
block_ptr
->
printed
=
true
;
if
(
block_ptr
->
bgl_conn_type
==
SELECT_TORUS
)
lower
=
true
;
}
part
.
total_nodes
=
set_grid_bgl
(
startx
,
starty
,
startz
,
endx
,
endy
,
endz
,
count
);
endy
,
endz
,
count
,
lower
);
part
.
root_only
=
(
int
)
pa_system_ptr
->
fill_in_value
[
count
].
letter
;
if
(
lower
)
part
.
root_only
+=
32
;
wattron
(
pa_system_ptr
->
text_win
,
COLOR_PAIR
(
pa_system_ptr
->
fill_in_value
[
count
].
color
));
block_ptr
=
_find_part_db2
(
part
.
allow_groups
);
if
(
block_ptr
)
block_ptr
->
printed
=
true
;
_print_text_part
(
&
part
,
block_ptr
);
wattroff
(
pa_system_ptr
->
text_win
,
COLOR_PAIR
(
pa_system_ptr
->
...
...
@@ -442,10 +450,17 @@ static int _print_rest(void *object, void *arg)
int
*
count
=
(
int
*
)
arg
;
int
start
,
startx
,
starty
,
startz
,
endx
,
endy
,
endz
;
partition_info_t
part
;
bool
lower
;
if
(
block_ptr
->
printed
)
return
SLURM_SUCCESS
;
/* lower case letters for TORUS connect */
if
(
block_ptr
->
bgl_conn_type
==
SELECT_TORUS
)
lower
=
true
;
else
lower
=
false
;
if
(
block_ptr
->
nodes
[
11
]
==
']'
)
{
/* "bgl[###x###]" */
start
=
atoi
(
block_ptr
->
nodes
+
4
);
startx
=
start
/
100
;
...
...
@@ -456,7 +471,7 @@ static int _print_rest(void *object, void *arg)
endy
=
(
start
%
100
)
/
10
;
endz
=
(
start
%
10
);
set_grid_bgl
(
startx
,
starty
,
startz
,
endx
,
endy
,
endz
,
*
count
);
endx
,
endy
,
endz
,
*
count
,
lower
);
}
else
{
/* any other format */
hostlist_t
hostlist
;
hostlist_iterator_t
host_iter
;
...
...
@@ -472,7 +487,7 @@ static int _print_rest(void *object, void *arg)
starty
=
endy
=
(
start
%
100
)
/
10
;
startz
=
endz
=
(
start
%
10
);
set_grid_bgl
(
startx
,
starty
,
startz
,
endx
,
endy
,
endz
,
*
count
);
endx
,
endy
,
endz
,
*
count
,
lower
);
free
(
host_name
);
}
hostlist_iterator_destroy
(
host_iter
);
...
...
@@ -482,10 +497,10 @@ static int _print_rest(void *object, void *arg)
part
.
name
=
NULL
;
part
.
allow_groups
=
block_ptr
->
nodes
;
part
.
root_only
=
(
int
)
pa_system_ptr
->
fill_in_value
[
*
count
].
letter
;
// if (block_ptr->bgl_conn_type == SELECT_TORUS)
// part.root_only += 32;
wattron
(
pa_system_ptr
->
text_win
,
COLOR_PAIR
(
pa_system_ptr
->
fill_in_value
[
*
count
].
color
));
if
(
lower
)
part
.
root_only
+=
32
;
_print_text_part
(
&
part
,
block_ptr
);
wattroff
(
pa_system_ptr
->
text_win
,
COLOR_PAIR
(
pa_system_ptr
->
fill_in_value
[
*
count
].
color
));
...
...
This diff is collapsed.
Click to expand it.
src/smap/smap.h
+
5
−
4
View file @
e0178830
...
...
@@ -56,6 +56,7 @@
# include "src/common/getopt.h"
#endif
#include
"src/common/macros.h"
#include
<slurm/slurm.h>
#include
"src/common/slurm_protocol_api.h"
...
...
@@ -102,10 +103,10 @@ extern int quiet_flag;
void
init_grid
(
node_info_msg_t
*
node_info_ptr
);
int
set_grid
(
int
start
,
int
end
,
int
count
);
int
set_grid_bgl
(
int
startx
,
int
starty
,
int
startz
,
int
endx
,
int
endy
,
int
endz
,
int
count
);
void
print_grid
();
extern
int
set_grid
(
int
start
,
int
end
,
int
count
);
extern
int
set_grid_bgl
(
int
startx
,
int
starty
,
int
startz
,
int
endx
,
int
endy
,
int
endz
,
int
count
,
bool
lower
);
extern
void
print_grid
(
void
);
void
parse_command_line
(
int
argc
,
char
*
argv
[]);
void
snprint_time
(
char
*
buf
,
size_t
buf_size
,
time_t
time
);
...
...
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