Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sessions: add smoke test #12871

Merged
merged 1 commit into from
Oct 21, 2024
Merged
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
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);
}
Loading