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
7f4987e9
Commit
7f4987e9
authored
11 years ago
by
Morris Jette
Browse files
Options
Downloads
Patches
Plain Diff
Switch/generic: passing valid switch info down to srun
parent
69670ba4
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/plugins/switch/generic/switch_generic.c
+26
-8
26 additions, 8 deletions
src/plugins/switch/generic/switch_generic.c
with
26 additions
and
8 deletions
src/plugins/switch/generic/switch_generic.c
+
26
−
8
View file @
7f4987e9
...
@@ -273,6 +273,7 @@ _hash_add_nodeinfo(sw_gen_node_info_t *new_node_info)
...
@@ -273,6 +273,7 @@ _hash_add_nodeinfo(sw_gen_node_info_t *new_node_info)
index
=
_hash_index
(
new_node_info
->
node_name
);
index
=
_hash_index
(
new_node_info
->
node_name
);
new_node_info
->
next
=
libstate
->
hash_table
[
index
];
new_node_info
->
next
=
libstate
->
hash_table
[
index
];
libstate
->
hash_table
[
index
]
=
new_node_info
;
libstate
->
hash_table
[
index
]
=
new_node_info
;
libstate
->
node_count
++
;
}
}
/* Add the new node information to our libstate cache, making a copy if
/* Add the new node information to our libstate cache, making a copy if
...
@@ -284,7 +285,6 @@ static void _cache_node_info(sw_gen_node_info_t *new_node_info)
...
@@ -284,7 +285,6 @@ static void _cache_node_info(sw_gen_node_info_t *new_node_info)
uint16_t
ifa_cnt
;
uint16_t
ifa_cnt
;
sw_gen_ifa_t
**
ifa_array
;
sw_gen_ifa_t
**
ifa_array
;
struct
sw_gen_node_info
*
next
;
struct
sw_gen_node_info
*
next
;
char
*
node_name
;
bool
new_alloc
;
/* True if this is new node to be added to cache */
bool
new_alloc
;
/* True if this is new node to be added to cache */
_lock
();
_lock
();
...
@@ -293,25 +293,22 @@ static void _cache_node_info(sw_gen_node_info_t *new_node_info)
...
@@ -293,25 +293,22 @@ static void _cache_node_info(sw_gen_node_info_t *new_node_info)
if
(
new_alloc
)
{
if
(
new_alloc
)
{
(
void
)
switch_p_alloc_node_info
((
switch_node_info_t
**
)
(
void
)
switch_p_alloc_node_info
((
switch_node_info_t
**
)
&
old_node_info
);
&
old_node_info
);
old_node_info
->
node_name
=
xstrdup
(
new_node_info
->
node_name
);
}
}
/* Swap contents */
/* Swap contents */
ifa_cnt
=
old_node_info
->
ifa_cnt
;
ifa_cnt
=
old_node_info
->
ifa_cnt
;
ifa_array
=
old_node_info
->
ifa_array
;
ifa_array
=
old_node_info
->
ifa_array
;
next
=
old_node_info
->
next
;
next
=
old_node_info
->
next
;
node_name
=
old_node_info
->
node_name
;
old_node_info
->
ifa_cnt
=
new_node_info
->
ifa_cnt
;
old_node_info
->
ifa_cnt
=
new_node_info
->
ifa_cnt
;
old_node_info
->
ifa_array
=
new_node_info
->
ifa_array
;
old_node_info
->
ifa_array
=
new_node_info
->
ifa_array
;
old_node_info
->
next
=
new_node_info
->
next
;
old_node_info
->
next
=
new_node_info
->
next
;
old_node_info
->
node_name
=
new_node_info
->
node_name
;
new_node_info
->
ifa_cnt
=
ifa_cnt
;
new_node_info
->
ifa_cnt
=
ifa_cnt
;
new_node_info
->
ifa_array
=
ifa_array
;
new_node_info
->
ifa_array
=
ifa_array
;
new_node_info
->
next
=
next
;
new_node_info
->
next
=
next
;
new_node_info
->
node_name
=
node_name
;
if
(
new_alloc
)
if
(
new_alloc
)
_hash_add_nodeinfo
(
new_node_info
);
_hash_add_nodeinfo
(
old_node_info
);
_unlock
();
_unlock
();
}
}
...
@@ -392,11 +389,12 @@ int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
...
@@ -392,11 +389,12 @@ int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
slurm_step_layout_t
*
step_layout
,
char
*
network
)
slurm_step_layout_t
*
step_layout
,
char
*
network
)
{
{
sw_gen_step_info_t
*
gen_step_info
=
(
sw_gen_step_info_t
*
)
switch_job
;
sw_gen_step_info_t
*
gen_step_info
=
(
sw_gen_step_info_t
*
)
switch_job
;
sw_gen_node_info_t
*
gen_node_info
;
sw_gen_node_t
*
node_ptr
;
sw_gen_node_t
*
node_ptr
;
hostlist_t
hl
=
NULL
;
hostlist_t
hl
=
NULL
;
hostlist_iterator_t
hi
;
hostlist_iterator_t
hi
;
char
*
host
=
NULL
;
char
*
host
=
NULL
;
int
i
;
int
i
,
j
;
if
(
debug_flags
&
DEBUG_FLAG_SWITCH
)
if
(
debug_flags
&
DEBUG_FLAG_SWITCH
)
info
(
"switch_p_build_jobinfo() starting"
);
info
(
"switch_p_build_jobinfo() starting"
);
...
@@ -413,7 +411,22 @@ int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
...
@@ -413,7 +411,22 @@ int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
node_ptr
=
xmalloc
(
sizeof
(
sw_gen_node_t
));
node_ptr
=
xmalloc
(
sizeof
(
sw_gen_node_t
));
gen_step_info
->
node_array
[
i
]
=
node_ptr
;
gen_step_info
->
node_array
[
i
]
=
node_ptr
;
node_ptr
->
node_name
=
xstrdup
(
host
);
node_ptr
->
node_name
=
xstrdup
(
host
);
/* FIXME: Find job's interface info and flesh out data structures */
gen_node_info
=
_find_node
(
host
);
if
(
gen_node_info
)
{
/* Copy node info to this step */
node_ptr
->
ifa_cnt
=
gen_node_info
->
ifa_cnt
;
node_ptr
->
ifa_array
=
xmalloc
(
sizeof
(
sw_gen_node_t
*
)
*
node_ptr
->
ifa_cnt
);
for
(
j
=
0
;
j
<
node_ptr
->
ifa_cnt
;
j
++
)
{
node_ptr
->
ifa_array
[
j
]
=
xmalloc
(
sizeof
(
sw_gen_node_t
));
node_ptr
->
ifa_array
[
j
]
->
ifa_addr
=
xstrdup
(
gen_node_info
->
ifa_array
[
j
]
->
ifa_addr
);
node_ptr
->
ifa_array
[
j
]
->
ifa_family
=
xstrdup
(
gen_node_info
->
ifa_array
[
j
]
->
ifa_family
);
node_ptr
->
ifa_array
[
j
]
->
ifa_name
=
xstrdup
(
gen_node_info
->
ifa_array
[
j
]
->
ifa_name
);
}
}
free
(
host
);
free
(
host
);
}
}
hostlist_iterator_destroy
(
hi
);
hostlist_iterator_destroy
(
hi
);
...
@@ -513,6 +526,11 @@ int switch_p_unpack_jobinfo(switch_jobinfo_t *switch_job, Buf buffer)
...
@@ -513,6 +526,11 @@ int switch_p_unpack_jobinfo(switch_jobinfo_t *switch_job, Buf buffer)
&
uint32_tmp
,
buffer
);
&
uint32_tmp
,
buffer
);
safe_unpackstr_xmalloc
(
&
ifa_ptr
->
ifa_name
,
&
uint32_tmp
,
safe_unpackstr_xmalloc
(
&
ifa_ptr
->
ifa_name
,
&
uint32_tmp
,
buffer
);
buffer
);
if
(
debug_flags
&
DEBUG_FLAG_SWITCH
)
{
info
(
"node=%s name=%s family=%s addr=%s"
,
node_ptr
->
node_name
,
ifa_ptr
->
ifa_name
,
ifa_ptr
->
ifa_family
,
ifa_ptr
->
ifa_addr
);
}
}
}
}
}
...
...
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