Skip to content

Commit c0b27e4

Browse files
authored
Merge pull request open-mpi#7236 from mcoil1/pr/v4.0.x/several-fixes
v4.0.x/several fixes
2 parents af04a9d + 07a54b7 commit c0b27e4

File tree

5 files changed

+26
-15
lines changed

5 files changed

+26
-15
lines changed

ompi/dpm/dpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root,
405405
}
406406
if (0 < opal_list_get_size(&ilist)) {
407407
uint32_t *peer_ranks = NULL;
408-
int prn, nprn;
408+
int prn, nprn = 0;
409409
char *val, *mycpuset;
410410
uint16_t u16;
411411
opal_process_name_t wildcard_rank;

ompi/mca/coll/libnbc/nbc_ialltoall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static int nbc_alltoall_init(const void* sendbuf, int sendcount, MPI_Datatype se
7070
enum {NBC_A2A_LINEAR, NBC_A2A_PAIRWISE, NBC_A2A_DISS, NBC_A2A_INPLACE} alg;
7171
void *tmpbuf = NULL;
7272
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
73-
ptrdiff_t span, gap;
73+
ptrdiff_t span, gap = 0;
7474

7575
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
7676

ompi/mca/io/romio321/romio/adio/common/ad_read_coll.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -826,17 +826,17 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node
826826
if (recv_size[i]) recv_buf[i] =
827827
(char *) ADIOI_Malloc(recv_size[i]);
828828

829-
j = 0;
830-
for (i=0; i < nprocs; i++)
831-
if (recv_size[i]) {
832-
MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i,
833-
myrank+i+100*iter, fd->comm, requests+j);
834-
j++;
829+
j = 0;
830+
for (i=0; i < nprocs; i++)
831+
if (recv_size[i]) {
832+
MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i,
833+
myrank+i+100*iter, fd->comm, requests+j);
834+
j++;
835835
#ifdef RDCOLL_DEBUG
836-
DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n",
837-
myrank, recv_size[i], myrank+i+100*iter);
836+
DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n",
837+
myrank, recv_size[i], myrank+i+100*iter);
838838
#endif
839-
}
839+
}
840840
}
841841

842842
/* create derived datatypes and send data */

opal/mca/memory/patcher/memory_patcher_component.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ static void *_intercept_shmat(int shmid, const void *shmaddr, int shmflg)
440440

441441
if (!original_shmat) {
442442
#if defined(SYS_shmat)
443-
result = memory_patcher_syscall(SYS_shmat, shmid, shmaddr, shmflg);
443+
result = (void*) memory_patcher_syscall(SYS_shmat, shmid, shmaddr, shmflg);
444444
#else // IPCOP_shmat
445445
unsigned long ret;
446446
ret = memory_patcher_syscall(SYS_ipc, IPCOP_shmat,

orte/mca/odls/default/odls_default_module.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,22 @@ static int do_child(orte_odls_spawn_caddy_t *cd, int write_fd)
454454

455455
/* Exec the new executable */
456456
execve(cd->cmd, cd->argv, cd->env);
457-
getcwd(dir, sizeof(dir));
457+
/* If we get here, an error has occurred. */
458+
(void) getcwd(dir, sizeof(dir));
459+
struct stat stats;
460+
char* msg;
461+
/* If errno is ENOENT, that indicates either cd->cmd does not exist, or
462+
* cd->cmd is a script, but has a bad interpreter specified. */
463+
if (ENOENT == errno && 0 == stat(cd->app->app, &stats)) {
464+
asprintf(&msg, "%s has a bad interpreter on the first line.",
465+
cd->app->app);
466+
} else {
467+
msg = strdup(strerror(errno));
468+
}
458469
send_error_show_help(write_fd, 1,
459470
"help-orte-odls-default.txt", "execve error",
460-
orte_process_info.nodename, dir, cd->app->app, strerror(errno));
461-
/* Does not return */
471+
orte_process_info.nodename, dir, cd->app->app, msg);
472+
free(msg);
462473
}
463474

464475

0 commit comments

Comments
 (0)