|
29 | 29 | #include "algo_common.h" |
30 | 30 | #include "release_gather.h" |
31 | 31 |
|
| 32 | +MPL_STATIC_INLINE_PREFIX bool MPIDI_POSIX_check_release_gather(MPIR_Csel_coll_sig_s * coll_sig) |
| 33 | +{ |
| 34 | + /* Check whether comm is an intranode comm */ |
| 35 | + MPIR_Comm *comm_ptr = coll_sig->comm_ptr; |
| 36 | + MPIR_Assert(comm_ptr->attr & MPIR_COMM_ATTR__HIERARCHY); |
| 37 | + if (comm_ptr->num_external > 1) { |
| 38 | + return false; |
| 39 | + } |
| 40 | + |
| 41 | + /* Check repeats if the algorithm CVAR is not set */ |
| 42 | + if (!(coll_sig->flags & MPIR_COLL_SIG_FLAG__CVAR)) { |
| 43 | + MPIDI_POSIX_COMM(comm_ptr, release_gather).num_collective_calls++; |
| 44 | + if (MPIDI_POSIX_COMM(comm_ptr, release_gather).num_collective_calls < |
| 45 | + MPIR_CVAR_POSIX_NUM_COLLS_THRESHOLD) { |
| 46 | + return false; |
| 47 | + } |
| 48 | + } |
| 49 | + |
| 50 | + return true; |
| 51 | +} |
| 52 | + |
32 | 53 | /* Intra-node bcast is implemented as a release step followed by gather step in release_gather |
33 | 54 | * framework. The actual data movement happens in release step. Gather step makes sure that |
34 | 55 | * the shared bcast buffer can be reused for next bcast call. Release gather framework has |
@@ -59,14 +80,6 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_POSIX_mpi_bcast_release_gather(void *buffer, |
59 | 80 | goto fn_exit; |
60 | 81 | } |
61 | 82 |
|
62 | | - MPIDI_POSIX_COMM(comm_ptr, release_gather).num_collective_calls++; |
63 | | - if (MPIDI_POSIX_COMM(comm_ptr, release_gather).num_collective_calls < |
64 | | - MPIR_CVAR_POSIX_NUM_COLLS_THRESHOLD) { |
65 | | - /* Fallback to pt2pt algorithms if the total number of release_gather collective calls is |
66 | | - * less than the specified threshold */ |
67 | | - goto fallback; |
68 | | - } |
69 | | - |
70 | 83 | /* Lazy initialization of release_gather specific struct */ |
71 | 84 | mpi_errno = |
72 | 85 | MPIDI_POSIX_mpi_release_gather_comm_init(comm_ptr, MPIDI_POSIX_RELEASE_GATHER_OPCODE_BCAST); |
|
0 commit comments