1
1

Merge pull request #2052 from alex-mikheev/topic/spml_ikrit_zcopy_fix

OSHMEM: spml ikrit: fixes zero copy
Этот коммит содержится в:
Joshua Ladd 2016-09-12 12:35:32 -04:00 коммит произвёл GitHub
родитель 3b968ec6bb 439456ae96
Коммит d5e65c4860
3 изменённых файлов: 26 добавлений и 6 удалений

Просмотреть файл

@ -902,12 +902,8 @@ int mca_spml_ikrit_get(void *src_addr, size_t size, void *dst_addr, int src)
return OSHMEM_ERROR; return OSHMEM_ERROR;
} }
#if MXM_API < MXM_VERSION(2,0)
sreq.base.flags = MXM_REQ_FLAG_BLOCKING;
#else
sreq.flags = MXM_REQ_SEND_FLAG_BLOCKING;
#endif
sreq.base.completed_cb = NULL; sreq.base.completed_cb = NULL;
sreq.flags = 0;
SPML_IKRIT_MXM_POST_SEND(sreq); SPML_IKRIT_MXM_POST_SEND(sreq);
@ -1161,7 +1157,11 @@ static inline int mca_spml_ikrit_put_internal(void* dst_addr,
put_req->mxm_req.opcode = MXM_REQ_OP_PUT; put_req->mxm_req.opcode = MXM_REQ_OP_PUT;
} }
if (!zcopy) { if (!zcopy) {
if (size < mca_spml_ikrit.put_zcopy_threshold) {
put_req->mxm_req.flags |= MXM_REQ_SEND_FLAG_BLOCKING; put_req->mxm_req.flags |= MXM_REQ_SEND_FLAG_BLOCKING;
} else {
put_req->mxm_req.opcode = MXM_REQ_OP_PUT_SYNC;
}
} }
#endif #endif

Просмотреть файл

@ -106,6 +106,8 @@ struct mca_spml_ikrit_t {
#if MXM_API >= MXM_VERSION(2,0) #if MXM_API >= MXM_VERSION(2,0)
int unsync_conn_max; int unsync_conn_max;
#endif #endif
size_t put_zcopy_threshold; /* enable zcopy in put if message size is
greater than the threshold */
}; };
typedef struct mca_spml_ikrit_t mca_spml_ikrit_t; typedef struct mca_spml_ikrit_t mca_spml_ikrit_t;

Просмотреть файл

@ -167,6 +167,21 @@ static inline void mca_spml_ikrit_param_register_int(const char* param_name,
storage); storage);
} }
static inline void mca_spml_ikrit_param_register_size_t(const char* param_name,
size_t default_value,
const char *help_msg,
size_t *storage)
{
*storage = default_value;
(void) mca_base_component_var_register(&mca_spml_ikrit_component.spmlm_version,
param_name,
help_msg,
MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
storage);
}
static inline void mca_spml_ikrit_param_register_string(const char* param_name, static inline void mca_spml_ikrit_param_register_string(const char* param_name,
char* default_value, char* default_value,
const char *help_msg, const char *help_msg,
@ -230,6 +245,9 @@ static int mca_spml_ikrit_component_register(void)
&mca_spml_ikrit.unsync_conn_max); &mca_spml_ikrit.unsync_conn_max);
#endif #endif
mca_spml_ikrit_param_register_size_t("put_zcopy_threshold", 16384ULL,
"[size_t] Use zero copy put if message size is greater than the threshold",
&mca_spml_ikrit.put_zcopy_threshold);
if (oshmem_num_procs() < mca_spml_ikrit.np) { if (oshmem_num_procs() < mca_spml_ikrit.np) {
SPML_VERBOSE(1, SPML_VERBOSE(1,
"Not enough ranks (%d<%d), disqualifying spml/ikrit", "Not enough ranks (%d<%d), disqualifying spml/ikrit",