Skip to content

Commit 3483da5

Browse files
authored
Merge pull request #76 from openpmix/master
Fork Sync: Update from parent repository
2 parents 262a67f + 8070277 commit 3483da5

22 files changed

+175
-59
lines changed

src/mca/ess/base/ess_base_bootstrap.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ int prte_ess_base_bootstrap(void)
125125
prte_process_info.nodename, path, line);
126126
free(path);
127127
fclose(fp);
128-
return PRTE_ERR_SILENT;
128+
rc = PRTE_ERR_SILENT;
129+
goto cleanup;
129130
}
130131
*ptr = '\0';
131132
if (0 == strlen(line)) { // missing the field name
@@ -135,33 +136,44 @@ int prte_ess_base_bootstrap(void)
135136
prte_process_info.nodename, path, ptr);
136137
free(path);
137138
fclose(fp);
138-
return PRTE_ERR_SILENT;
139+
rc = PRTE_ERR_SILENT;
140+
goto cleanup;
139141
}
140142
++ptr;
141-
if (NULL == ptr) { // missing the value
143+
if ('\0' == *ptr) { // missing the value
142144
pmix_show_help("help-prte-runtime.txt", "bootstrap-missing-value", true,
143145
prte_process_info.nodename, path, line);
144146
free(path);
145147
fclose(fp);
146-
return PRTE_ERR_SILENT;
148+
rc = PRTE_ERR_SILENT;
149+
goto cleanup;
147150
}
151+
148152
/* identify and cache the option */
149153
if (0 == strcmp(line, "ClusterName")) {
150154
cluster = strdup(ptr);
155+
151156
} else if (0 == strcmp(line, "DVMControllerHost")) {
152157
ctrlhost = strdup(ptr);
158+
153159
} else if (0 == strcmp(line, "DVMControllerPort")) {
154160
ctrlport = strtoul(ptr, NULL, 10);
161+
155162
} else if (0 == strcmp(line, "PRTEDPort")) {
156163
prtedport = strtoul(ptr, NULL, 10);
164+
157165
} else if (0 == strcmp(line, "DVMNodes")) {
158166
dvmnodes = strdup(ptr);
167+
159168
} else if (0 == strcmp(line, "DVMTempDir")) {
160169
dvmtmpdir = strdup(ptr);
170+
161171
} else if (0 == strcmp(line, "SessionTmpDir")) {
162172
sessiontmpdir = strdup(ptr);
173+
163174
} else if (0 == strcmp(line, "ControllerLogPath")) {
164175
ctrllogpath = strdup(ptr);
176+
165177
} else if (0 == strcmp(line, "PRTEDLogPath")) {
166178
prtedlogpath = strdup(ptr);
167179
}

src/mca/ess/base/ess_base_std_prted.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "src/event/event-internal.h"
4444
#include "src/hwloc/hwloc-internal.h"
4545
#include "src/pmix/pmix-internal.h"
46+
#include "src/util/pmix_if.h"
4647
#include "src/util/pmix_os_path.h"
4748
#include "src/util/pmix_environ.h"
4849

@@ -299,6 +300,10 @@ int prte_ess_base_prted_setup(void)
299300
goto error;
300301
}
301302

303+
/* add network aliases to our list of alias hostnames - must
304+
* wait until after we init PMIx before getting them */
305+
pmix_ifgetaliases(&prte_process_info.aliases);
306+
302307
/* Setup the communication infrastructure */
303308
if (PRTE_SUCCESS
304309
!= (ret = pmix_mca_base_framework_open(&prte_prtereachable_base_framework,

src/mca/ess/hnp/ess_hnp_module.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ static int rte_init(int argc, char **argv)
221221
node->daemon = proc;
222222
PRTE_FLAG_SET(node, PRTE_NODE_FLAG_DAEMON_LAUNCHED);
223223
node->state = PRTE_NODE_STATE_UP;
224-
/* get our aliases - will include all the interface aliases captured in prte_init */
225-
node->aliases = PMIX_ARGV_COPY_COMPAT(prte_process_info.aliases);
226224
/* record that the daemon job is running */
227225
jdata->num_procs = 1;
228226
jdata->state = PRTE_JOB_STATE_RUNNING;
@@ -252,6 +250,13 @@ static int rte_init(int argc, char **argv)
252250
goto error;
253251
}
254252

253+
/* add network aliases to our list of alias hostnames - must
254+
* wait until after we init PMIx before getting them */
255+
pmix_ifgetaliases(&prte_process_info.aliases);
256+
257+
/* get our aliases - will include all the interface aliases captured in prte_init */
258+
node->aliases = PMIX_ARGV_COPY_COMPAT(prte_process_info.aliases);
259+
255260
/* if we are using xml for output, put a start tag */
256261
if (prte_xml_output) {
257262
fprintf(stdout, "<%s>\n", prte_tool_basename);

src/mca/odls/base/odls_base_default_fns.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,8 @@ int prte_odls_base_default_construct_child_list(pmix_data_buffer_t *buffer, pmix
708708
goto REPORT_ERROR;
709709
}
710710
/* connect the proc to its node object */
711-
if (NULL
712-
== (dmn = (prte_proc_t *) pmix_pointer_array_get_item(daemons->procs,
713-
pptr->parent))) {
711+
dmn = (prte_proc_t *) pmix_pointer_array_get_item(daemons->procs, pptr->parent);
712+
if (NULL == dmn) {
714713
PRTE_ERROR_LOG(PRTE_ERR_NOT_FOUND);
715714
rc = PRTE_ERR_NOT_FOUND;
716715
goto REPORT_ERROR;
@@ -753,6 +752,11 @@ int prte_odls_base_default_construct_child_list(pmix_data_buffer_t *buffer, pmix
753752
}
754753
/* mark that this app_context is being used on this node */
755754
app = (prte_app_context_t *) pmix_pointer_array_get_item(jdata->apps, pptr->app_idx);
755+
if (NULL == app) {
756+
PRTE_ERROR_LOG(PRTE_ERR_NOT_FOUND);
757+
rc = PRTE_ERR_NOT_FOUND;
758+
goto REPORT_ERROR;
759+
}
756760
PRTE_FLAG_SET(app, PRTE_APP_FLAG_USED_ON_NODE);
757761
}
758762
}

src/mca/plm/base/plm_base_frame.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,13 @@ static void launch_daemons(int fd, short args, void *cbdata)
256256
if (!prte_managed_allocation || prte_set_slots_override) {
257257
// set the number of slots on our node
258258
node = (prte_node_t *) pmix_pointer_array_get_item(prte_node_pool, 0);
259+
if (NULL == node) {
260+
// should never happen
261+
PRTE_ERROR_LOG(PRTE_ERR_NOT_FOUND);
262+
PRTE_ACTIVATE_JOB_STATE(state->jdata, PRTE_JOB_STATE_FAILED_TO_START);
263+
PMIX_RELEASE(state);
264+
return;
265+
}
259266
prte_plm_base_set_slots(node);
260267
state->jdata->total_slots_alloc = node->slots;
261268
} else {

src/mca/plm/base/plm_base_launch_support.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,6 +1745,9 @@ void prte_plm_base_daemon_callback(int status, pmix_proc_t *sender, pmix_data_bu
17451745
}
17461746
idx = 1;
17471747
ret = PMIx_Data_unpack(NULL, buffer, &dname, &idx, PMIX_PROC);
1748+
if (PMIX_SUCCESS != ret) {
1749+
break;
1750+
}
17481751
continue;
17491752
}
17501753

@@ -1801,6 +1804,9 @@ void prte_plm_base_daemon_callback(int status, pmix_proc_t *sender, pmix_data_bu
18011804
}
18021805
idx = 1;
18031806
ret = PMIx_Data_unpack(NULL, buffer, &dname, &idx, PMIX_PROC);
1807+
if (PMIX_SUCCESS != ret) {
1808+
break;
1809+
}
18041810
continue;
18051811
}
18061812
}
@@ -1819,6 +1825,9 @@ void prte_plm_base_daemon_callback(int status, pmix_proc_t *sender, pmix_data_bu
18191825

18201826
idx = 1;
18211827
ret = PMIx_Data_unpack(NULL, buffer, &dname, &idx, PMIX_PROC);
1828+
if (PMIX_SUCCESS != ret) {
1829+
break;
1830+
}
18221831
}
18231832

18241833
if (PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != ret) {

src/mca/plm/ssh/plm_ssh_module.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,17 @@ static int setup_launch(int *argcptr, char ***argvptr, char *nodename, int *node
651651
full_orted_cmd = strdup(orted_cmd);
652652
}
653653
free(orted_cmd);
654+
} else {
655+
/* use our standard one and add the prefix */
656+
value = pmix_basename(prte_install_dirs.bindir);
657+
if ('/' == prefix_dir[strlen(prefix_dir)-1]) {
658+
pmix_asprintf(&tmp, "%s%s", prefix_dir, value);
659+
} else {
660+
pmix_asprintf(&tmp, "%s/%s", prefix_dir, value);
661+
}
662+
free(value);
663+
pmix_asprintf(&full_orted_cmd, "%s/prted", tmp);
664+
free(tmp);
654665
}
655666
} else {
656667
full_orted_cmd = orted_cmd;

src/mca/rmaps/base/rmaps_base_frame.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,6 @@ int prte_rmaps_base_set_mapping_policy(prte_job_t *jdata, char *inspec)
651651
true, "mapping", ck[0]);
652652
PMIX_ARGV_FREE_COMPAT(ck);
653653
free(cptr);
654-
if (NULL != val) {
655-
free(val);
656-
}
657654
return PRTE_ERR_SILENT;
658655
}
659656
/* Verify the list is composed of comma-delimited ranges */

src/mca/rmaps/base/rmaps_base_map_job.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ void prte_rmaps_base_map_job(int fd, short args, void *cbdata)
8686
PRTE_HIDE_UNUSED_PARAMS(fd, args);
8787

8888
PMIX_ACQUIRE_OBJECT(caddy);
89+
// init options
90+
memset(&options, 0, sizeof(prte_rmaps_options_t));
91+
options.stream = prte_rmaps_base_framework.framework_output;
92+
options.verbosity = 5; // usual value for base-level functions
93+
// set and check convenience vars
8994
jdata = caddy->jdata;
9095
schizo = (prte_schizo_base_module_t*)jdata->schizo;
9196
if (NULL == schizo) {
@@ -98,9 +103,6 @@ void prte_rmaps_base_map_job(int fd, short args, void *cbdata)
98103
jdata->map = PMIX_NEW(prte_job_map_t);
99104
}
100105
jdata->state = PRTE_JOB_STATE_MAP;
101-
memset(&options, 0, sizeof(prte_rmaps_options_t));
102-
options.stream = prte_rmaps_base_framework.framework_output;
103-
options.verbosity = 5; // usual value for base-level functions
104106
fptr = &flag;
105107

106108
/* check and set some general options */

src/mca/rmaps/base/rmaps_base_support_fns.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,20 @@ int prte_rmaps_base_get_target_nodes(pmix_list_t *allocated_nodes,
133133
* However, if it is a managed allocation AND the hostfile or the hostlist was
134134
* provided, those take precedence, so process them and filter as we normally do.
135135
*/
136-
if (prte_get_attribute(&app->attributes, PRTE_APP_DASH_HOST, (void **) &hosts, PMIX_STRING) ||
137-
prte_get_attribute(&app->attributes, PRTE_APP_HOSTFILE, (void **) &hosts, PMIX_STRING)) {
136+
hosts = NULL;
137+
if ((prte_get_attribute(&app->attributes, PRTE_APP_DASH_HOST, (void **) &hosts, PMIX_STRING) ||
138+
prte_get_attribute(&app->attributes, PRTE_APP_HOSTFILE, (void **) &hosts, PMIX_STRING)) &&
139+
NULL != hosts) {
138140
needhosts = true;
141+
free(hosts);
139142
}
140143
if (!prte_managed_allocation ||
141144
(prte_managed_allocation && needhosts)) {
142145
PMIX_CONSTRUCT(&nodes, pmix_list_t);
143146
/* if the app provided a dash-host, then use those nodes */
144147
hosts = NULL;
145-
if (prte_get_attribute(&app->attributes, PRTE_APP_DASH_HOST, (void **) &hosts, PMIX_STRING)) {
148+
if (prte_get_attribute(&app->attributes, PRTE_APP_DASH_HOST, (void **) &hosts, PMIX_STRING) &&
149+
NULL != hosts) {
146150
PMIX_OUTPUT_VERBOSE((5, prte_rmaps_base_framework.framework_output,
147151
"%s using dash_host %s", PRTE_NAME_PRINT(PRTE_PROC_MY_NAME),
148152
hosts));
@@ -152,7 +156,8 @@ int prte_rmaps_base_get_target_nodes(pmix_list_t *allocated_nodes,
152156
return rc;
153157
}
154158
free(hosts);
155-
} else if (prte_get_attribute(&app->attributes, PRTE_APP_HOSTFILE, (void **) &hosts, PMIX_STRING)) {
159+
} else if (prte_get_attribute(&app->attributes, PRTE_APP_HOSTFILE, (void **) &hosts, PMIX_STRING) &&
160+
NULL != hosts) {
156161
/* otherwise, if the app provided a hostfile, then use that */
157162
PMIX_OUTPUT_VERBOSE((5, prte_rmaps_base_framework.framework_output,
158163
"%s using hostfile %s", PRTE_NAME_PRINT(PRTE_PROC_MY_NAME),
@@ -450,9 +455,12 @@ int prte_rmaps_base_get_target_nodes(pmix_list_t *allocated_nodes,
450455
if (node->slots > node->slots_inuse) {
451456
int32_t s;
452457
/* check for any -host allocations */
453-
if (prte_get_attribute(&app->attributes, PRTE_APP_DASH_HOST, (void **) &hosts,
454-
PMIX_STRING)) {
458+
hosts = NULL;
459+
if (prte_get_attribute(&app->attributes, PRTE_APP_DASH_HOST,
460+
(void **) &hosts, PMIX_STRING) &&
461+
NULL != hosts) {
455462
s = prte_util_dash_host_compute_slots(node, hosts);
463+
free(hosts);
456464
} else {
457465
s = node->slots - node->slots_inuse;
458466
}

0 commit comments

Comments
 (0)