Skip to content

Commit 1b5bffb

Browse files
authored
Merge pull request pmodels#7351 from hzhou/2503_xpmem_thresh
ch4/ipc: adjust xpmem threshold Approved-by: Ken Raffenetti
2 parents c61d0fb + ad92d77 commit 1b5bffb

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/mpid/ch4/shm/ipc/xpmem/xpmem_post.h

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- name : MPIR_CVAR_CH4_IPC_XPMEM_P2P_THRESHOLD
2727
category : CH4
2828
type : int
29-
default : 1024
29+
default : 65536
3030
class : none
3131
verbosity : MPI_T_VERBOSITY_USER_BASIC
3232
scope : MPI_T_SCOPE_ALL_EQ
@@ -35,6 +35,20 @@
3535
bytes), then enable XPMEM-based single copy protocol for intranode communication. The
3636
environment variable is valid only when the XPMEM submodule is enabled.
3737
38+
- name : MPIR_CVAR_CH4_IPC_XPMEM_P2P_UPPER_THRESHOLD
39+
category : CH4
40+
type : int
41+
default : -1
42+
class : none
43+
verbosity : MPI_T_VERBOSITY_USER_BASIC
44+
scope : MPI_T_SCOPE_ALL_EQ
45+
description : >-
46+
If a send message size is greater than or equal to MPIR_CVAR_CH4_IPC_XPMEM_P2P_UPPER_THRESHOLD (in
47+
bytes), then skip XPMEM-based single copy protocol for intranode communication. The
48+
environment variable is valid only when the XPMEM submodule is enabled. The default is -1, which
49+
does not limit the upper threshold.
50+
51+
3852
=== END_MPI_T_CVAR_INFO_BLOCK ===
3953
*/
4054

@@ -53,7 +67,9 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_XPMEM_get_ipc_attr(const void *buf, MPI_Aint
5367
MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr, true_lb);
5468

5569
if (!MPIR_CVAR_CH4_XPMEM_ENABLE || buf == MPI_BOTTOM ||
56-
data_sz < MPIR_CVAR_CH4_IPC_XPMEM_P2P_THRESHOLD) {
70+
data_sz < MPIR_CVAR_CH4_IPC_XPMEM_P2P_THRESHOLD ||
71+
(MPIR_CVAR_CH4_IPC_XPMEM_P2P_UPPER_THRESHOLD > 0 &&
72+
data_sz > MPIR_CVAR_CH4_IPC_XPMEM_P2P_UPPER_THRESHOLD)) {
5773
goto fn_exit;
5874
} else {
5975
ipc_attr->ipc_type = MPIDI_IPCI_TYPE__XPMEM;

0 commit comments

Comments
 (0)