Skip to content

Commit c87f646

Browse files
authored
Merge pull request #12893 from hppritcha/pr12871_back_to_v50x
sessions: add smoke test
2 parents 80c7ec4 + be59665 commit c87f646

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
MPI_Info_create(&info);
15+
MPI_Session_init(MPI_INFO_NULL, MPI_ERRORS_RETURN, &s1);
16+
MPI_Session_finalize(&s1);
17+
MPI_Session_init(MPI_INFO_NULL, MPI_ERRORS_RETURN, &s2);
18+
MPI_Session_finalize(&s2);
19+
MPI_Info_free(&info);
20+
return 0;
21+
}

ompi/instance/instance.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -954,13 +954,6 @@ static int ompi_mpi_instance_finalize_common (void)
954954

955955
ompi_mpi_instance_release ();
956956

957-
if (0 == opal_initialized) {
958-
/* if there is no MPI_T_init_thread that has been MPI_T_finalize'd,
959-
* then be gentle to the app and release all the memory now (instead
960-
* of the opal library destructor */
961-
opal_class_finalize ();
962-
}
963-
964957
return OMPI_SUCCESS;
965958
}
966959

0 commit comments

Comments
 (0)