1
1
openmpi/ompi/mca/btl/smcuda/btl_smcuda_frag.c

81 строка
2.6 KiB
C
Исходник Обычный вид История

/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2009 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 NVIDIA Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "btl_smcuda_frag.h"
static inline void mca_btl_smcuda_frag_common_constructor(mca_btl_smcuda_frag_t* frag)
{
frag->hdr = (mca_btl_smcuda_hdr_t*)frag->base.super.ptr;
if(frag->hdr != NULL) {
frag->hdr->frag = (mca_btl_smcuda_frag_t*)((uintptr_t)frag |
MCA_BTL_SMCUDA_FRAG_ACK);
frag->segment.base.seg_addr.pval = ((char*)frag->hdr) +
sizeof(mca_btl_smcuda_hdr_t);
frag->hdr->my_smp_rank = mca_btl_smcuda_component.my_smp_rank;
}
frag->segment.base.seg_len = frag->size;
Per RFC: Remove des_src and des_dst members from the mca_btl_base_segment_t and replace them with des_local and des_remote This change also updates the BTL version to 3.0.0. This commit does not represent the final version of BTL 3.0.0. More changes are coming. In making this change I updated all of the BTLs as well as BTL user's to use the new structure members. Please evaluate your component to ensure the changes are correct. RFC text: This is the first of several BTL interface changes I am proposing for the 1.9/2.0 release series. What: Change naming of btl descriptor members. I propose we change des_src and des_dst (and their associated counts) to be des_local and des_remote. For receive callbacks the des_local member will be used to communicate the segment information to the callback. The proposed change will include updating all of the doxygen in btl.h as well as updating all BTLs and BTL users to use the new naming scheme. Why: My btl usage makes use of both put and get operations on the same descriptor. With the current naming scheme I need to ensure that there is consistency beteen the segments described in des_src and des_dst depending on whether a put or get operation is executed. Additionally, the current naming prevents BTLs that do not require prepare/RMA matched operations (do not set MCA_BTL_FLAGS_RDMA_MATCHED) from executing multiple simultaneous put AND get operations. At the moment the descriptor can only be used with one or the other. The naming change makes it easier for BTL users to setup/modify descriptors for RMA operations as the local segment and remote segment are always in the same member field. The only issue I forsee with this change is that it will require a little more work to move BTL fixes to the 1.8 release series. This commit was SVN r32196.
2014-07-10 20:31:15 +04:00
frag->base.des_local = &frag->segment.base;
frag->base.des_local_count = 1;
frag->base.des_flags = 0;
#if OPAL_CUDA_SUPPORT
frag->registration = NULL;
#endif /* OPAL_CUDA_SUPPORT */
}
static void mca_btl_smcuda_frag1_constructor(mca_btl_smcuda_frag_t* frag)
{
frag->size = mca_btl_smcuda_component.eager_limit;
frag->my_list = &mca_btl_smcuda_component.sm_frags_eager;
mca_btl_smcuda_frag_common_constructor(frag);
}
static void mca_btl_smcuda_frag2_constructor(mca_btl_smcuda_frag_t* frag)
{
frag->size = mca_btl_smcuda_component.max_frag_size;
frag->my_list = &mca_btl_smcuda_component.sm_frags_max;
mca_btl_smcuda_frag_common_constructor(frag);
}
static void mca_btl_smcuda_user_constructor(mca_btl_smcuda_frag_t* frag)
{
frag->size = 0;
frag->my_list = &mca_btl_smcuda_component.sm_frags_user;
mca_btl_smcuda_frag_common_constructor(frag);
}
OBJ_CLASS_INSTANCE(
mca_btl_smcuda_frag1_t,
mca_btl_base_descriptor_t,
mca_btl_smcuda_frag1_constructor,
NULL);
OBJ_CLASS_INSTANCE(
mca_btl_smcuda_frag2_t,
mca_btl_base_descriptor_t,
mca_btl_smcuda_frag2_constructor,
NULL);
OBJ_CLASS_INSTANCE(
mca_btl_smcuda_user_t,
mca_btl_base_descriptor_t,
mca_btl_smcuda_user_constructor,
NULL);