Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rob Latham
MPICH-BlueGene
Commits
768e51c6
Commit
768e51c6
authored
Aug 02, 2010
by
Pavan Balaji
Browse files
[svn-r6972] Don't corrupt the environment directly; duplicate it before modifying
it. Based on the suggestion by Yauheni Zelenko @ Cadence.
parent
a4cd5be5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/pm/hydra/tools/bootstrap/external/lsf_query_node_list.c
View file @
768e51c6
...
...
@@ -11,7 +11,7 @@
HYD_status
HYDT_bscd_lsf_query_node_list
(
struct
HYD_node
**
node_list
)
{
char
*
hosts
,
*
hostname
,
*
num_procs_str
;
char
*
hosts
,
*
hostname
,
*
num_procs_str
,
*
thosts
=
NULL
;
int
num_procs
;
HYD_status
status
=
HYD_SUCCESS
;
...
...
@@ -25,6 +25,9 @@ HYD_status HYDT_bscd_lsf_query_node_list(struct HYD_node **node_list)
HYDU_ERR_SETANDJUMP
(
status
,
HYD_INTERNAL_ERROR
,
"No LSF node list found
\n
"
);
}
else
{
hosts
=
HYDU_strdup
(
hosts
);
thosts
=
hosts
;
hostname
=
strtok
(
hosts
,
" "
);
while
(
1
)
{
if
(
hostname
==
NULL
)
...
...
@@ -42,6 +45,9 @@ HYD_status HYDT_bscd_lsf_query_node_list(struct HYD_node **node_list)
hostname
=
strtok
(
NULL
,
" "
);
}
if
(
thosts
)
HYDU_FREE
(
thosts
);
}
fn_exit:
...
...
src/pm/hydra/tools/bootstrap/external/slurm_query_node_list.c
View file @
768e51c6
...
...
@@ -100,7 +100,7 @@ static HYD_status group_to_individual_nodes(char *str, char **list)
HYD_status
HYDT_bscd_slurm_query_node_list
(
struct
HYD_node
**
node_list
)
{
char
*
str
,
*
num_procs
;
char
*
str
,
*
num_procs
,
*
tstr
=
NULL
,
*
tnum_procs
=
NULL
;
char
*
tmp1
[
HYD_NUM_TMP_STRINGS
],
*
tmp2
[
HYD_NUM_TMP_STRINGS
];
struct
HYD_node
*
node
,
*
tnode
;
int
i
,
j
;
...
...
@@ -117,6 +117,9 @@ HYD_status HYDT_bscd_slurm_query_node_list(struct HYD_node **node_list)
*
node_list
=
NULL
;
}
else
{
tstr
=
HYDU_strdup
(
str
);
tnum_procs
=
HYDU_strdup
(
num_procs
);
full_str_to_groups
(
str
,
tmp1
);
num_procs
=
strtok
(
num_procs
,
"("
);
...
...
@@ -142,6 +145,11 @@ HYD_status HYDT_bscd_slurm_query_node_list(struct HYD_node **node_list)
/* node list is provided by the bootstrap server */
HYDT_bscd_slurm_user_node_list
=
0
;
if
(
tstr
)
HYDU_FREE
(
tstr
);
if
(
tnum_procs
)
HYDU_FREE
(
tnum_procs
);
}
fn_exit:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment