Skip to content

Commit

Permalink
sessions: add smoke test
Browse files Browse the repository at this point in the history
and add to mac os github CI

Signed-off-by: Howard Pritchard <[email protected]>
(cherry picked from commit 9109c33)
  • Loading branch information
hppritcha committed Oct 29, 2024
1 parent e25d3e6 commit aa6bfb0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/macos-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
pushd examples
make
popd
- name: Test ring
- name: Test ring and sessions sanity check
run: |
mpirun --map-by ppr:1:core examples/ring_c
mpirun --map-by ppr:1:core examples/hello_sessions_c
7 changes: 5 additions & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ EXAMPLES = \
oshmem_max_reduction \
oshmem_strided_puts \
oshmem_symmetric_data \
spc_example
spc_example \
hello_sessions_c


# Default target. Always build the C MPI examples. Only build the
# others if we have the appropriate Open MPI / OpenSHMEM language
# bindings.

all: hello_c ring_c connectivity_c spc_example
all: hello_c ring_c connectivity_c spc_example hello_sessions_c
@ if which ompi_info >/dev/null 2>&1 ; then \
$(MAKE) mpi; \
fi
Expand Down Expand Up @@ -129,6 +130,8 @@ connectivity_c: connectivity_c.c
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
spc_example: spc_example.c
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
hello_sessions_c: hello_sessions_c.c
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

hello_mpifh: hello_mpifh.f
$(MPIFC) $(FCFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
Expand Down
24 changes: 24 additions & 0 deletions examples/hello_sessions_c.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "mpi.h"
#include <stdio.h>

/*
* Simple test to demonstrate several aspects of MPI 4 Sessions and related
* functionality. See sections 11.3 and 11.4 of the MPI 4 standard for more
* details.
*/

int main(int argc, char** argv) {
MPI_Info info;
MPI_Session s1, s2;

#if 0
/* need PR https://github.com/open-mpi/ompi/pull/12868 to be merged in
* before this can be uncommented.
*/
MPI_Info_create(&info);
#endif
MPI_Session_init(MPI_INFO_NULL, MPI_ERRORS_RETURN, &s1);
MPI_Session_finalize(&s1);
MPI_Session_init(MPI_INFO_NULL, MPI_ERRORS_RETURN, &s2);
MPI_Session_finalize(&s2);
}

0 comments on commit aa6bfb0

Please sign in to comment.