Skip to content

Commit 9109c33

Browse files
committed
sessions: add smoke test
and add to mac os github CI Signed-off-by: Howard Pritchard <[email protected]>
1 parent 30b1fb0 commit 9109c33

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

.github/workflows/macos-checks.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
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

examples/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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 $@
130131
spc_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

133136
hello_mpifh: hello_mpifh.f
134137
$(MPIFC) $(FCFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

examples/hello_sessions_c.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
}

0 commit comments

Comments
 (0)