Skip to content

Commit ad92d77

Browse files
committed
ch4/ipc: add MPIR_CVAR_CH4_IPC_XPMEM_P2P_UPPER_THRESHOLD
Add MPIR_CVAR_CH4_IPC_XPMEM_P2P_UPPER_THRESHOLD so user can limit the larger messages from using xpmem. XPMEM's performance boost diminishes at large message and sometime may not be beneficial. The default is no limit.
1 parent d2298b9 commit ad92d77

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)