Skip to content

Commit dfb36f7

Browse files
author
Ralph Castain
authored
Merge pull request #6 from rhc54/topic/update
Update to OMPI master
2 parents e058094 + 350e167 commit dfb36f7

File tree

10 files changed

+61
-27
lines changed

10 files changed

+61
-27
lines changed

contrib/travis/test_client.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export PATH=$HOME/bogus/bin:$PATH
66
make client
77

88
psrvr &
9+
# wait a little for the server to start
10+
sleep 2
911
prun --oversubscribe -n 2 ./client
1012
ret=$?
1113

opal/mca/pmix/pmix2x/pmix/VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ greek=
3030
# command, or with the date (if "git describe" fails) in the form of
3131
# "date<date>".
3232

33-
repo_rev=git8684147
33+
repo_rev=git1154ce3
3434

3535
# If tarball_version is not empty, it is used as the version string in
3636
# the tarball filename, regardless of all other versions listed in
@@ -44,7 +44,7 @@ tarball_version=
4444

4545
# The date when this release was created
4646

47-
date="Sep 11, 2017"
47+
date="Sep 12, 2017"
4848

4949
# The shared library version of each of PMIx's public libraries.
5050
# These versions are maintained in accordance with the "Library

opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,17 +281,18 @@ static void _getnb_cbfunc(struct pmix_peer_t *pr,
281281
PMIX_ERROR_LOG(PMIX_ERR_BAD_PARAM);
282282
return;
283283
}
284+
285+
/* cache the proc id */
286+
(void)strncpy(proc.nspace, cb->pname.nspace, PMIX_MAX_NSLEN);
287+
proc.rank = cb->pname.rank;
288+
284289
/* a zero-byte buffer indicates that this recv is being
285290
* completed due to a lost connection */
286291
if (PMIX_BUFFER_IS_EMPTY(buf)) {
287292
ret = PMIX_ERR_UNREACH;
288293
goto done;
289294
}
290295

291-
/* cache the proc id */
292-
(void)strncpy(proc.nspace, cb->pname.nspace, PMIX_MAX_NSLEN);
293-
proc.rank = cb->pname.rank;
294-
295296
/* unpack the status */
296297
cnt = 1;
297298
PMIX_BFROPS_UNPACK(rc, pmix_client_globals.myserver,

opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_spawn.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,20 +218,19 @@ static void wait_cbfunc(struct pmix_peer_t *pr,
218218
"pmix:client recv callback activated with %d bytes",
219219
(NULL == buf) ? -1 : (int)buf->bytes_used);
220220

221-
/* a zero-byte buffer indicates that this recv is being
222-
* completed due to a lost connection */
223-
if (PMIX_BUFFER_IS_EMPTY(buf)) {
224-
ret = PMIX_ERR_UNREACH;
225-
goto report;
226-
}
227-
228221
/* init */
229222
memset(nspace, 0, PMIX_MAX_NSLEN+1);
230223

231224
if (NULL == buf) {
232225
ret = PMIX_ERR_BAD_PARAM;
233226
goto report;
234227
}
228+
/* a zero-byte buffer indicates that this recv is being
229+
* completed due to a lost connection */
230+
if (PMIX_BUFFER_IS_EMPTY(buf)) {
231+
ret = PMIX_ERR_UNREACH;
232+
goto report;
233+
}
235234

236235
/* unpack the returned status */
237236
cnt = 1;

opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
124124
if (PMIX_RANGE_PROC_LOCAL != range) {
125125
/* create the msg object */
126126
msg = PMIX_NEW(pmix_buffer_t);
127-
127+
if (NULL == msg) {
128+
return PMIX_ERR_NOMEM;
129+
}
128130
/* pack the command */
129131
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver, msg, &cmd, 1, PMIX_COMMAND);
130132
if (PMIX_SUCCESS != rc) {
@@ -263,9 +265,7 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
263265
cleanup:
264266
pmix_output_verbose(2, pmix_globals.debug_output,
265267
"client: notifying server - unable to send");
266-
if (NULL != msg) {
267-
PMIX_RELEASE(msg);
268-
}
268+
PMIX_RELEASE(msg);
269269
/* we were unable to send anything, so we just return the error */
270270
return rc;
271271
}

opal/mca/pmix/pmix2x/pmix/src/mca/pdl/pdlopen/pdl_pdlopen_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static int pdlopen_foreachfile(const char *search_path,
191191
char *abs_name = NULL;
192192
ret = asprintf(&abs_name, "%s/%s", dirs[i], de->d_name);
193193
if (0 > ret) {
194-
return PMIX_ERR_NOMEM;
194+
goto error;
195195
}
196196
if (NULL == abs_name) {
197197
ret = PMIX_ERR_IN_ERRNO;

opal/mca/pmix/pmix2x/pmix/src/mca/ptl/ptl_types.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ PMIX_EXPORT extern int pmix_ptl_base_output;
280280
} \
281281
} while (0)
282282

283-
#define CLOSE_THE_SOCKET(socket) \
283+
#define CLOSE_THE_SOCKET(s) \
284284
do { \
285-
if (0 <= socket) { \
286-
shutdown(socket, 2); \
287-
close(socket); \
288-
socket = -1; \
285+
if (0 <= (s)) { \
286+
shutdown((s), 2); \
287+
close((s)); \
288+
(s) = -1; \
289289
} \
290290
} while (0)
291291

opal/mca/pmix/pmix2x/pmix/src/mca/ptl/tcp/ptl_tcp_component.c

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,7 @@ static void process_cbfunc(int sd, short args, void *cbdata)
12401240
pmix_pending_connection_t *pnd = (pmix_pending_connection_t*)cd->cbdata;
12411241
pmix_nspace_t *nptr;
12421242
pmix_rank_info_t *info;
1243+
pmix_peer_t *peer;
12431244
int rc;
12441245
uint32_t u32;
12451246
pmix_info_t ginfo;
@@ -1294,10 +1295,24 @@ static void process_cbfunc(int sd, short args, void *cbdata)
12941295

12951296
/* add this nspace to our pool */
12961297
nptr = PMIX_NEW(pmix_nspace_t);
1298+
if (NULL == nptr) {
1299+
PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
1300+
CLOSE_THE_SOCKET(pnd->sd);
1301+
PMIX_RELEASE(pnd);
1302+
PMIX_RELEASE(cd);
1303+
return;
1304+
}
12971305
nptr->nspace = strdup(cd->proc.nspace);
12981306
pmix_list_append(&pmix_server_globals.nspaces, &nptr->super);
12991307
/* add this tool rank to the nspace */
13001308
info = PMIX_NEW(pmix_rank_info_t);
1309+
if (NULL == info) {
1310+
PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
1311+
CLOSE_THE_SOCKET(pnd->sd);
1312+
PMIX_RELEASE(pnd);
1313+
PMIX_RELEASE(cd);
1314+
return;
1315+
}
13011316
info->pname.nspace = strdup(cd->proc.nspace);
13021317
info->pname.rank = 0;
13031318
/* need to include the uid/gid for validation */
@@ -1306,7 +1321,14 @@ static void process_cbfunc(int sd, short args, void *cbdata)
13061321
pmix_list_append(&nptr->ranks, &info->super);
13071322

13081323
/* setup a peer object for this tool */
1309-
pmix_peer_t *peer = PMIX_NEW(pmix_peer_t);
1324+
peer = PMIX_NEW(pmix_peer_t);
1325+
if (NULL == peer) {
1326+
PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
1327+
CLOSE_THE_SOCKET(pnd->sd);
1328+
PMIX_RELEASE(pnd);
1329+
PMIX_RELEASE(cd);
1330+
return;
1331+
}
13101332
/* mark the peer proc type */
13111333
peer->proc_type = PMIX_PROC_TOOL | pnd->proc_type;
13121334
/* add in the nspace pointer */
@@ -1382,11 +1404,11 @@ static void process_cbfunc(int sd, short args, void *cbdata)
13821404
}
13831405

13841406
/* start the events for this tool */
1385-
pmix_event_assign(&peer->recv_event, pmix_globals.evbase, pnd->sd,
1407+
pmix_event_assign(&peer->recv_event, pmix_globals.evbase, peer->sd,
13861408
EV_READ|EV_PERSIST, pmix_ptl_base_recv_handler, peer);
13871409
pmix_event_add(&peer->recv_event, NULL);
13881410
peer->recv_ev_active = true;
1389-
pmix_event_assign(&peer->send_event, pmix_globals.evbase, pnd->sd,
1411+
pmix_event_assign(&peer->send_event, pmix_globals.evbase, peer->sd,
13901412
EV_WRITE|EV_PERSIST, pmix_ptl_base_send_handler, peer);
13911413
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
13921414
"pmix:server tool %s:%d has connected on socket %d",
@@ -1410,6 +1432,10 @@ static void cnct_cbfunc(pmix_status_t status,
14101432

14111433
/* need to thread-shift this into our context */
14121434
cd = PMIX_NEW(pmix_setup_caddy_t);
1435+
if (NULL == cd) {
1436+
PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
1437+
return;
1438+
}
14131439
cd->status = status;
14141440
(void)strncpy(cd->proc.nspace, proc->nspace, PMIX_MAX_NSLEN);
14151441
cd->cbdata = cbdata;

opal/mca/pmix/pmix2x/pmix/src/util/path.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,12 @@ char* pmix_find_absolute_path( char* app_name )
402402
if( NULL != abs_app_name ) {
403403
char* resolved_path = (char*)malloc(PMIX_PATH_MAX);
404404
if (NULL == realpath( abs_app_name, resolved_path )) {
405+
free(resolved_path);
405406
return NULL;
406407
}
407-
if( abs_app_name != app_name ) free(abs_app_name);
408+
if( abs_app_name != app_name ) {
409+
free(abs_app_name);
410+
}
408411
return resolved_path;
409412
}
410413
return NULL;

opal/mca/pmix/pmix2x/pmix2x_server_north.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,9 @@ static pmix_status_t server_spawn_fn(const pmix_proc_t *p,
670670
if (NULL != apps[n].env) {
671671
app->env = opal_argv_copy(apps[n].env);
672672
}
673+
if (NULL != apps[n].cwd) {
674+
app->cwd = strdup(apps[n].cwd);
675+
}
673676
app->maxprocs = apps[n].maxprocs;
674677
for (k=0; k < apps[n].ninfo; k++) {
675678
oinfo = OBJ_NEW(opal_value_t);

0 commit comments

Comments
 (0)