Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mpid/ch4/netmod/ofi/ofi_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ int MPIDI_OFI_mpi_finalize_hook(void)
/* sockets provider need flush any last lightweight send. */
mpi_errno = flush_send_queue();
MPIR_ERR_CHECK(mpi_errno);
} else if (MPIR_CVAR_NO_COLLECTIVE_FINALIZE) {
} else if (!MPIR_Process.comm_world || MPIR_CVAR_NO_COLLECTIVE_FINALIZE) {
/* skip collective work arounds */
} else if (strcmp("verbs;ofi_rxm", MPIDI_OFI_global.prov_use[0]->fabric_attr->prov_name) == 0
|| strcmp("psm2", MPIDI_OFI_global.prov_use[0]->fabric_attr->prov_name) == 0
Expand Down
2 changes: 1 addition & 1 deletion src/mpid/ch4/netmod/ucx/ucx_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ int MPIDI_UCX_mpi_finalize_hook(void)
int n = MPIDI_UCX_global.num_vcis;
pending = MPL_malloc(sizeof(ucs_status_ptr_t) * MPIR_Process.size * n * n, MPL_MEM_OTHER);

if (!MPIR_CVAR_NO_COLLECTIVE_FINALIZE) {
if (MPIR_Process.comm_world && !MPIR_CVAR_NO_COLLECTIVE_FINALIZE) {
/* if some process are not present, the disconnect may timeout and give errors */
mpi_errno = MPIR_pmi_barrier();
MPIR_ERR_CHECK(mpi_errno);
Expand Down
13 changes: 9 additions & 4 deletions test/mpi/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -1181,10 +1181,6 @@
/init/finalized
/init/initstat
/init/library_version
/init/session
/init/session_mult_init
/init/session_psets
/init/session_self
/init/timeout
/init/version
/io/async
Expand Down Expand Up @@ -1528,6 +1524,15 @@
/rma/wintest
/rma/wintest_shm
/rma/win_zero
/session/session
/session/session_mult_init
/session/session_re_init
/session/session_psets
/session/session_self
/session/session_inter
/session/session_4x4
/session/session_bsend
/session/session_local_only
/spawn/concurrent_spawns
/spawn/disconnect
/spawn/disconnect2
Expand Down
3 changes: 2 additions & 1 deletion test/mpi/session/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ noinst_PROGRAMS = \
session_self \
session_inter \
session_4x4 \
session_bsend
session_bsend \
session_local_only

session_mult_init_SOURCES = session.c
session_mult_init_CPPFLAGS = -DMULT_INIT $(AM_CPPFLAGS)
Expand Down
45 changes: 45 additions & 0 deletions test/mpi/session/session_local_only.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (C) by Argonne National Laboratory
* See COPYRIGHT in top-level directory
*/

#include "mpi.h"
#include "stdio.h"

/*
static char MTEST_Descrip[] = "Test MPI Sessions local-only behavior.
No communication is performed. Intended to run with a minimum of 2 MPI
processes and at least 1 non-MPI process. This verifies the local,
non-collective nature of MPI Sessions initialization and group
construction APIs. Example launch command:

mpiexec -n 2 ./session_local_only : -n 1 true

The world group size will be 3, but only 2 processes will initialize
and make MPI calls. A correct implementation should not hang.
*/

int main(int argc, char *argv[])
{
MPI_Session session;
MPI_Group group;
int rank, size;

MPI_Session_init(MPI_INFO_NULL, MPI_ERRORS_RETURN, &session);

MPI_Group_from_session_pset(session, "mpi://world", &group);
MPI_Group_rank(group, &rank);
MPI_Group_size(group, &size);
if (size < 3) {
/* no communicator so directly call errhandler */
MPI_Session_call_errhandler(session, 1);
}

MPI_Group_free(&group);
MPI_Session_finalize(&session);
if (rank == 0) {
printf("No Errors\n");
}

return 0;
}
2 changes: 2 additions & 0 deletions test/mpi/session/testlist
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ session_self 1
session_inter 5
session_4x4 16
session_bsend 2
# args to session_local_only append ": -n 1 true" to mpiexec
session_local_only 2 timeLimit=10 arg=: arg=-n arg=1 arg=true