1
1

added MCA parameter to limit number of ptls used

This commit was SVN r3490.
Этот коммит содержится в:
Tim Woodall 2004-11-03 16:08:49 +00:00
родитель 4c5d6417a2
Коммит 7148d50839
4 изменённых файлов: 12 добавлений и 5 удалений

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

@ -28,6 +28,7 @@ struct mca_ptl_mx_component_t {
int mx_debug; /**< debug level */ int mx_debug; /**< debug level */
uint32_t mx_filter; /**< filter assigned to application */ uint32_t mx_filter; /**< filter assigned to application */
uint32_t mx_num_ptls; /**< number of MX NICs available to app */ uint32_t mx_num_ptls; /**< number of MX NICs available to app */
uint32_t mx_max_ptls; /**< max number of MX NICs to use */
struct mca_ptl_mx_module_t** mx_ptls; /**< array of available PTL moduless */ struct mca_ptl_mx_module_t** mx_ptls; /**< array of available PTL moduless */
ompi_free_list_t mx_send_frags; /**< free list of mx send fragments */ ompi_free_list_t mx_send_frags; /**< free list of mx send fragments */
ompi_free_list_t mx_recv_frags; /**< free list of mx recv fragments */ ompi_free_list_t mx_recv_frags; /**< free list of mx recv fragments */

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

@ -102,6 +102,8 @@ int mca_ptl_mx_component_open(void)
mca_ptl_mx_param_register_int("free_list_max", -1); mca_ptl_mx_param_register_int("free_list_max", -1);
mca_ptl_mx_component.mx_free_list_inc = mca_ptl_mx_component.mx_free_list_inc =
mca_ptl_mx_param_register_int("free_list_inc", 256); mca_ptl_mx_param_register_int("free_list_inc", 256);
mca_ptl_mx_component.mx_max_ptls =
(uint32_t)mca_ptl_mx_param_register_int("num_nics", -1);
mca_ptl_mx_module.super.ptl_exclusivity = mca_ptl_mx_module.super.ptl_exclusivity =
mca_ptl_mx_param_register_int("exclusivity", 0); mca_ptl_mx_param_register_int("exclusivity", 0);
mca_ptl_mx_module.super.ptl_first_frag_size = mca_ptl_mx_module.super.ptl_first_frag_size =
@ -154,7 +156,7 @@ mca_ptl_base_module_t** mca_ptl_mx_component_init(
mca_ptl_base_module_t** ptls; mca_ptl_base_module_t** ptls;
*num_ptls = 0; *num_ptls = 0;
*allow_multi_user_threads = true; *allow_multi_user_threads = true;
*have_hidden_threads = OMPI_HAVE_THREADS; *have_hidden_threads = true; /* MX driver/callbacks are multi-threaded */
ompi_free_list_init(&mca_ptl_mx_component.mx_send_frags, ompi_free_list_init(&mca_ptl_mx_component.mx_send_frags,
sizeof(mca_ptl_mx_send_frag_t), sizeof(mca_ptl_mx_send_frag_t),

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

@ -42,7 +42,7 @@ int mca_ptl_mx_module_init(void)
ompi_output(0, "mca_ptl_mx_init: mx_get_info(MX_NIC_COUNT) failed with status=%d\n", status); ompi_output(0, "mca_ptl_mx_init: mx_get_info(MX_NIC_COUNT) failed with status=%d\n", status);
return OMPI_ERR_INIT; return OMPI_ERR_INIT;
} }
/* determine the NIC ids */ /* determine the NIC ids */
size = sizeof(uint64_t) * (mca_ptl_mx_component.mx_num_ptls+1); size = sizeof(uint64_t) * (mca_ptl_mx_component.mx_num_ptls+1);
if(NULL == (nic_addrs = (uint64_t*)malloc(size))) if(NULL == (nic_addrs = (uint64_t*)malloc(size)))
@ -56,6 +56,10 @@ int mca_ptl_mx_module_init(void)
return OMPI_ERR_INIT; return OMPI_ERR_INIT;
} }
/* check for limit on number of ptls */
if(mca_ptl_mx_component.mx_num_ptls > mca_ptl_mx_component.mx_max_ptls)
mca_ptl_mx_component.mx_num_ptls = mca_ptl_mx_component.mx_max_ptls;
/* allocate an array of pointers to ptls */ /* allocate an array of pointers to ptls */
mca_ptl_mx_component.mx_ptls = (mca_ptl_mx_module_t**)malloc( mca_ptl_mx_component.mx_ptls = (mca_ptl_mx_module_t**)malloc(
sizeof(mca_ptl_mx_module_t*) * mca_ptl_mx_component.mx_num_ptls); sizeof(mca_ptl_mx_module_t*) * mca_ptl_mx_component.mx_num_ptls);

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

@ -86,7 +86,7 @@ static inline void MCA_PTL_MX_SEND_FRAG_PROGRESS(mca_ptl_mx_send_frag_t* frag)
MCA_PTL_MX_SEND_FRAG_RETURN(frag); MCA_PTL_MX_SEND_FRAG_RETURN(frag);
return; return;
} }
/* Done when: /* Done when:
* (1) send completes and ack is received * (1) send completes and ack is received
* (2) send completes and ack is not required * (2) send completes and ack is not required
@ -97,13 +97,13 @@ static inline void MCA_PTL_MX_SEND_FRAG_PROGRESS(mca_ptl_mx_send_frag_t* frag)
if((frag_ack == true && frag_progress == 2) || if((frag_ack == true && frag_progress == 2) ||
(frag_ack == false && frag_progress == 1)) { (frag_ack == false && frag_progress == 1)) {
/* update request status */ /* update request status */
frag->frag_send.frag_base.frag_owner->ptl_send_progress( frag->frag_send.frag_base.frag_owner->ptl_send_progress(
frag->frag_send.frag_base.frag_owner, frag->frag_send.frag_base.frag_owner,
request, request,
frag->frag_send.frag_base.frag_size); frag->frag_send.frag_base.frag_size);
/* return any fragment that didnt come from the cache */ /* return any fragment that didnt come from the cache */
if (request->req_cached == false || if (request->req_cached == false ||
frag->frag_send.frag_base.frag_header.hdr_frag.hdr_frag_offset != 0) { frag->frag_send.frag_base.frag_header.hdr_frag.hdr_frag_offset != 0) {