File tree Expand file tree Collapse file tree 4 files changed +50
-1
lines changed Expand file tree Collapse file tree 4 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 15301530/session /session_psets
15311531/session /session_self
15321532/session /session_bsend
1533+ /session /session_local_only
15331534/spawn /concurrent_spawns
15341535/spawn /disconnect
15351536/spawn /disconnect2
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ noinst_PROGRAMS = \
1616 session_re_init \
1717 session_psets \
1818 session_self \
19- session_bsend
19+ session_bsend \
20+ session_local_only
2021
2122session_mult_init_SOURCES = session.c
2223session_mult_init_CPPFLAGS = -DMULT_INIT $(AM_CPPFLAGS )
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (C) by Argonne National Laboratory
3+ * See COPYRIGHT in top-level directory
4+ */
5+
6+ #include "mpi.h"
7+ #include "stdio.h"
8+
9+ /*
10+ static char MTEST_Descrip[] = "Test MPI Sessions local-only behavior.
11+ No communication is performed. Intended to run with a minimum of 2 MPI
12+ processes and at least 1 non-MPI process. This verifies the local,
13+ non-collective nature of MPI Sessions initialization and group
14+ construction APIs. Example launch command:
15+
16+ mpiexec -n 2 ./session_local_only : -n 1 true
17+
18+ The world group size will be 3, but only 2 processes will initialize
19+ and make MPI calls. An correct implementation should not hang.
20+ */
21+
22+ int main (int argc , char * argv [])
23+ {
24+ MPI_Session session ;
25+ MPI_Group group ;
26+ int rank , size ;
27+
28+ MPI_Session_init (MPI_INFO_NULL , MPI_ERRORS_RETURN , & session );
29+
30+ MPI_Group_from_session_pset (session , "mpi://world" , & group );
31+ MPI_Group_rank (group , & rank );
32+ MPI_Group_size (group , & size );
33+ if (size < 3 ) {
34+ /* no communicator so directly call errhandler */
35+ MPI_Session_call_errhandler (session , 1 );
36+ }
37+
38+ MPI_Group_free (& group );
39+ MPI_Session_finalize (& session );
40+ if (rank == 0 ) {
41+ printf ("No Errors\n" );
42+ }
43+
44+ return 0 ;
45+ }
Original file line number Diff line number Diff line change @@ -5,3 +5,5 @@ session_re_init 4
55session_psets 1
66session_self 1
77session_bsend 2
8+ # args to session_local_only append ": -n 1 true" to mpiexec
9+ session_local_only 2 timeLimit=10 arg=: arg=-n arg=1 arg=true
You can’t perform that action at this time.
0 commit comments