File tree Expand file tree Collapse file tree 3 files changed +31
-3
lines changed Expand file tree Collapse file tree 3 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 4040 pushd examples
4141 make
4242 popd
43- - name : Test ring
43+ - name : Test ring and sessions sanity check
4444 run : |
4545 mpirun --map-by ppr:1:core examples/ring_c
46+ mpirun --map-by ppr:1:core examples/hello_sessions_c
Original file line number Diff line number Diff line change @@ -65,14 +65,15 @@ EXAMPLES = \
6565 oshmem_max_reduction \
6666 oshmem_strided_puts \
6767 oshmem_symmetric_data \
68- spc_example
68+ spc_example \
69+ hello_sessions_c
6970
7071
7172# Default target. Always build the C MPI examples. Only build the
7273# others if we have the appropriate Open MPI / OpenSHMEM language
7374# bindings.
7475
75- all : hello_c ring_c connectivity_c spc_example
76+ all : hello_c ring_c connectivity_c spc_example hello_sessions_c
7677 @ if which ompi_info > /dev/null 2>&1 ; then \
7778 $(MAKE ) mpi; \
7879 fi
@@ -129,6 +130,8 @@ connectivity_c: connectivity_c.c
129130 $(MPICC ) $(CFLAGS ) $(LDFLAGS ) $? $(LDLIBS ) -o $@
130131spc_example : spc_example.c
131132 $(MPICC ) $(CFLAGS ) $(LDFLAGS ) $? $(LDLIBS ) -o $@
133+ hello_sessions_c : hello_sessions_c.c
134+ $(MPICC ) $(CFLAGS ) $(LDFLAGS ) $? $(LDLIBS ) -o $@
132135
133136hello_mpifh : hello_mpifh.f
134137 $(MPIFC ) $(FCFLAGS ) $(LDFLAGS ) $? $(LDLIBS ) -o $@
Original file line number Diff line number Diff line change 1+ #include "mpi.h"
2+ #include <stdio.h>
3+
4+ /*
5+ * Simple test to demonstrate several aspects of MPI 4 Sessions and related
6+ * functionality. See sections 11.3 and 11.4 of the MPI 4 standard for more
7+ * details.
8+ */
9+
10+ int main (int argc , char * * argv ) {
11+ MPI_Info info ;
12+ MPI_Session s1 , s2 ;
13+
14+ #if 0
15+ /* need PR https://github.com/open-mpi/ompi/pull/12868 to be merged in
16+ * before this can be uncommented.
17+ */
18+ MPI_Info_create (& info );
19+ #endif
20+ MPI_Session_init (MPI_INFO_NULL , MPI_ERRORS_RETURN , & s1 );
21+ MPI_Session_finalize (& s1 );
22+ MPI_Session_init (MPI_INFO_NULL , MPI_ERRORS_RETURN , & s2 );
23+ MPI_Session_finalize (& s2 );
24+ }
You can’t perform that action at this time.
0 commit comments