George or Brian:
Last week I submitted an RFC for making some changes in the BML layer. However, with further thought, I am thinking of another way to solve my issue. The main idea is that I want to eliminate the use of the cached pointer to the mca_bml_base_btl_t in the descriptor because in the case of failover, the cached pointer may become stale. (George, we talked about this at the last forum)

The idea is that we can use a pointer to the btl module in almost all areas where we currently are using a cached pointer to the mca_bml_base_btl_t. An example of the change I want to make is shown below. First is the old version of the mca_pml_ob1_rget_completion function and then the version I am proposing. Note that the mca_bml_base_btl_t* is no longer used in the second version. And note that we do not need to use des->des_context.

Does anyone have an issue with this change?

OLD:
static void
mca_pml_ob1_rget_completion( mca_btl_base_module_t* btl,
                            struct mca_btl_base_endpoint_t* ep,
                            struct mca_btl_base_descriptor_t* des,
                            int status )
{
mca_pml_ob1_send_request_t* sendreq = (mca_pml_ob1_send_request_t*)des->des_cbdata;
   mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*)des->des_context;
   size_t req_bytes_delivered = 0;

/* count bytes of user data actually delivered and check for request completion */
   MCA_PML_OB1_COMPUTE_SEGMENT_LENGTH( des->des_src, des->des_src_cnt,
                                       0, req_bytes_delivered );
OPAL_THREAD_ADD_SIZE_T(&sendreq->req_bytes_delivered, req_bytes_delivered);

   send_request_pml_complete_check(sendreq);
   /* free the descriptor */
   mca_bml_base_free(bml_btl, des);
   MCA_PML_OB1_PROGRESS_PENDING(bml_btl);
}


NEW:
static void
mca_pml_ob1_rget_completion( mca_btl_base_module_t* btl,
                            struct mca_btl_base_endpoint_t* ep,
                            struct mca_btl_base_descriptor_t* des,
                            int status )
{
mca_pml_ob1_send_request_t* sendreq = (mca_pml_ob1_send_request_t*)des->des_cbdata;
   size_t req_bytes_delivered = 0;

/* count bytes of user data actually delivered and check for request completion */
   MCA_PML_OB1_COMPUTE_SEGMENT_LENGTH( des->des_src, des->des_src_cnt,
                                       0, req_bytes_delivered );
OPAL_THREAD_ADD_SIZE_T(&sendreq->req_bytes_delivered, req_bytes_delivered);

   send_request_pml_complete_check(sendreq);
   /* free the descriptor */
   btl->btl_free(btl, des);
   MCA_PML_OB1_PROGRESS_PENDING(btl);
}

Reply via email to