This source file includes following definitions.
- pvar_handle_stop
- MPI_T_pvar_stop
1
2
3
4
5
6
7
8
9
10
11
12
13
14 #include "ompi/mpi/tool/mpit-internal.h"
15
16 #if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
17 #pragma weak MPI_T_pvar_stop = PMPI_T_pvar_stop
18 #endif
19
20 #if OMPI_PROFILING_DEFINES
21 #include "ompi/mpi/tool/profile/defines.h"
22 #endif
23
24
25 static int pvar_handle_stop (mca_base_pvar_handle_t *handle)
26 {
27 if (OPAL_SUCCESS != mca_base_pvar_handle_stop (handle)) {
28 return MPI_T_ERR_PVAR_NO_STARTSTOP;
29 }
30
31 return MPI_SUCCESS;
32 }
33
34 int MPI_T_pvar_stop(MPI_T_pvar_session session, MPI_T_pvar_handle handle)
35 {
36 int ret = MPI_SUCCESS;
37
38 if (!mpit_is_initialized ()) {
39 return MPI_T_ERR_NOT_INITIALIZED;
40 }
41
42 ompi_mpit_lock ();
43
44 if (MPI_T_PVAR_ALL_HANDLES == handle) {
45 OPAL_LIST_FOREACH(handle, &session->handles, mca_base_pvar_handle_t) {
46
47
48 if (mca_base_pvar_handle_is_running (handle) && !mca_base_pvar_is_continuous (handle->pvar) &&
49 MPI_SUCCESS != pvar_handle_stop (handle)) {
50
51
52 ret = MPI_T_ERR_PVAR_NO_STARTSTOP;
53 }
54 }
55 } else {
56 ret = pvar_handle_stop (handle);
57 }
58
59 ompi_mpit_unlock ();
60
61 return ompit_opal_to_mpit_error (ret);
62 }