Коммит
0929c32cd8
@ -172,7 +172,7 @@ OPAL_DECLSPEC int opal_common_verbs_qp_test(struct ibv_context *device_context,
|
||||
* Known limitations:
|
||||
* If ibv_fork_init is called after ibv_create_* functions - it will have no effect.
|
||||
* OMPI initializes verbs many times during initialization in the following verbs components:
|
||||
* oob/ud, btl/openib, mtl/mxm, pml/yalla, oshmem/ikrit, oshmem/yoda, ompi/mca/coll/{fca,hcoll}
|
||||
* oob/ud, btl/openib, mtl/mxm, pml/yalla, oshmem/ikrit, ompi/mca/coll/{fca,hcoll}
|
||||
*
|
||||
* So, ibv_fork_init should be called once, in the beginning of the init flow of every verb component
|
||||
* to proper request fork support.
|
||||
|
@ -14,11 +14,8 @@
|
||||
#include "opal/datatype/opal_convertor.h"
|
||||
#include "orte/include/orte/types.h"
|
||||
#include "orte/runtime/orte_globals.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda.h"
|
||||
#include "oshmem/proc/proc.h"
|
||||
#include "oshmem/mca/spml/base/base.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_putreq.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_getreq.h"
|
||||
#include "opal/mca/btl/btl.h"
|
||||
|
||||
#define SPML_BASE_DO_CMP(_res, _addr, _op, _val) \
|
||||
|
@ -144,7 +144,6 @@ static int mca_spml_base_open(mca_base_open_flag_t flags)
|
||||
if( (NULL == default_spml || NULL == default_spml[0] ||
|
||||
0 == strlen(default_spml[0])) || (default_spml[0][0] == '^') ) {
|
||||
opal_pointer_array_add(&mca_spml_base_spml, strdup("ikrit"));
|
||||
opal_pointer_array_add(&mca_spml_base_spml, strdup("yoda"));
|
||||
} else {
|
||||
opal_pointer_array_add(&mca_spml_base_spml, strdup(default_spml[0]));
|
||||
}
|
||||
|
@ -147,12 +147,7 @@ int mca_spml_base_select(bool enable_progress_threads, bool enable_mpi_threads)
|
||||
if (NULL == tmp_val) {
|
||||
continue;
|
||||
}
|
||||
if (0 == strncmp(tmp_val, "yoda", 4) && !mca_bml_base_inited()) {
|
||||
orte_errmgr.abort(1, "SPML %s cannot be selected becasue no btls are available. Please make sure that ob1 pml is selected by ompi (-mca pml ob1)", tmp_val);
|
||||
}
|
||||
else {
|
||||
orte_errmgr.abort(1, "SPML %s cannot be selected", tmp_val);
|
||||
}
|
||||
orte_errmgr.abort(1, "SPML %s cannot be selected", tmp_val);
|
||||
}
|
||||
if (0 == i) {
|
||||
orte_errmgr.abort(2,
|
||||
|
@ -1,45 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
dist_oshmemdata_DATA = \
|
||||
help-oshmem-spml-yoda.txt
|
||||
|
||||
EXTRA_DIST = post_configure.sh
|
||||
|
||||
AM_CFLAGS = $(btl_sm_CPPFLAGS)
|
||||
|
||||
yoda_sources = \
|
||||
spml_yoda.c \
|
||||
spml_yoda.h \
|
||||
spml_yoda_component.c \
|
||||
spml_yoda_component.h \
|
||||
spml_yoda_rdmafrag.h \
|
||||
spml_yoda_putreq.c \
|
||||
spml_yoda_putreq.h \
|
||||
spml_yoda_getreq.c \
|
||||
spml_yoda_getreq.h
|
||||
|
||||
if MCA_BUILD_ompi_pml_ob1_DSO
|
||||
component_noinst =
|
||||
component_install = mca_spml_yoda.la
|
||||
else
|
||||
component_noinst = libmca_spml_yoda.la
|
||||
component_install =
|
||||
endif
|
||||
|
||||
mcacomponentdir = $(oshmemlibdir)
|
||||
mcacomponent_LTLIBRARIES = $(component_install)
|
||||
mca_spml_yoda_la_SOURCES = $(yoda_sources)
|
||||
mca_spml_yoda_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
noinst_LTLIBRARIES = $(component_noinst)
|
||||
libmca_spml_yoda_la_SOURCES = $(yoda_sources)
|
||||
libmca_spml_yoda_la_LDFLAGS = -module -avoid-version
|
@ -1,17 +0,0 @@
|
||||
# -*- text -*-
|
||||
#
|
||||
# Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
# All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
[internal_oom_error]
|
||||
'%s' operation failed. Unable to allocate buffer, need %d bytes.
|
||||
Try increasing 'spml_yoda_bml_alloc_threshold' value or setting it to '0' to
|
||||
force waiting for all puts completion.
|
||||
|
||||
spml_yoda_bml_alloc_threshold: %d
|
||||
|
@ -1,4 +0,0 @@
|
||||
# Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
# All rights reserved
|
||||
# $COPYRIGHT$
|
||||
DIRECT_CALL_HEADER="oshmem/mca/spml/yoda/spml_yoda.h"
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@ -1,150 +0,0 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef MCA_SPML_YODA_H
|
||||
#define MCA_SPML_YODA_H
|
||||
|
||||
#include "oshmem_config.h"
|
||||
#include "oshmem/request/request.h"
|
||||
#include "oshmem/mca/spml/spml.h"
|
||||
#include "oshmem/util/oshmem_util.h"
|
||||
#include "oshmem/mca/spml/base/spml_base_putreq.h"
|
||||
#include "oshmem/proc/proc.h"
|
||||
#include "oshmem/mca/spml/base/spml_base_request.h"
|
||||
#include "oshmem/mca/spml/base/spml_base_getreq.h"
|
||||
|
||||
#include "orte/runtime/orte_globals.h"
|
||||
|
||||
#include "ompi/mca/bml/base/base.h"
|
||||
#include "opal/mca/btl/btl.h"
|
||||
#include "opal/class/opal_free_list.h"
|
||||
|
||||
/* Turn ON/OFF debug output from build (default 0) */
|
||||
#ifndef OSHMEM_WAIT_COMPLETION_DEBUG
|
||||
#define OSHMEM_WAIT_COMPLETION_DEBUG 0
|
||||
#endif
|
||||
|
||||
#define MCA_SPML_YODA_PUT (MCA_BTL_TAG_USR + 0x0A)
|
||||
#define MCA_SPML_YODA_GET (MCA_BTL_TAG_USR + 0x0B)
|
||||
#define MCA_SPML_YODA_GET_RESPONSE (MCA_BTL_TAG_USR + 0x0C)
|
||||
|
||||
#define SPML_YODA_SEND_CONTEXT_SIZE (sizeof(size_t) + 3*sizeof(void*) + sizeof(int))
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/**
|
||||
* YODA SPML module
|
||||
*/
|
||||
|
||||
enum {
|
||||
YODA_BTL_UNKNOWN = -1,
|
||||
YODA_BTL_SELF = 0,
|
||||
YODA_BTL_SM,
|
||||
YODA_BTL_OPENIB,
|
||||
YODA_BTL_VADER,
|
||||
YODA_BTL_UGNI,
|
||||
YODA_BTL_MAX
|
||||
};
|
||||
|
||||
struct yoda_btl {
|
||||
mca_btl_base_module_t *btl;
|
||||
mca_bml_base_btl_t *bml_btl;
|
||||
int btl_type;
|
||||
int use_cnt;
|
||||
};
|
||||
|
||||
struct mca_spml_yoda_t {
|
||||
mca_spml_base_module_t super;
|
||||
|
||||
int priority;
|
||||
int free_list_num; /* initial size of free list */
|
||||
int free_list_max; /* maximum size of free list */
|
||||
int free_list_inc; /* number of elements to grow free list */
|
||||
int bml_alloc_threshold; /* number of puts to wait
|
||||
in case of put/get temporary buffer allocation failture */
|
||||
|
||||
/* lock queue access */
|
||||
opal_mutex_t lock;
|
||||
|
||||
/* free lists */
|
||||
opal_free_list_t rdma_frags;
|
||||
/* number of outstanding put requests */
|
||||
int32_t n_active_puts;
|
||||
int32_t n_active_gets;
|
||||
bool enabled;
|
||||
struct yoda_btl *btl_type_map;
|
||||
int n_btls;
|
||||
};
|
||||
typedef struct mca_spml_yoda_t mca_spml_yoda_module_t;
|
||||
|
||||
struct mca_spml_yoda_context_t {
|
||||
mca_btl_base_descriptor_t* btl_src_descriptor;
|
||||
mca_btl_base_registration_handle_t *registration;
|
||||
};
|
||||
typedef struct mca_spml_yoda_context_t mca_spml_yoda_context_t;
|
||||
|
||||
extern mca_spml_yoda_module_t mca_spml_yoda;
|
||||
|
||||
extern int mca_spml_yoda_enable(bool enable);
|
||||
extern int mca_spml_yoda_get(void* dst_addr,
|
||||
size_t size,
|
||||
void* src_addr,
|
||||
int src);
|
||||
extern int mca_spml_yoda_get_nb(void* dst_addr,
|
||||
size_t size,
|
||||
void* src_addr,
|
||||
int dst,
|
||||
void **handle);
|
||||
extern int mca_spml_yoda_put(void* dst_addr,
|
||||
size_t size,
|
||||
void* src_addr,
|
||||
int dst);
|
||||
extern int mca_spml_yoda_put_nb(void* dst_addr,
|
||||
size_t size,
|
||||
void* src_addr,
|
||||
int dst,
|
||||
void **handle);
|
||||
extern int mca_spml_yoda_recv(void* buf, size_t size, int src);
|
||||
extern int mca_spml_yoda_send(void* buf,
|
||||
size_t size,
|
||||
int dst,
|
||||
mca_spml_base_put_mode_t mode);
|
||||
extern sshmem_mkey_t *mca_spml_yoda_register(void* addr,
|
||||
size_t size,
|
||||
uint64_t shmid,
|
||||
int *count);
|
||||
extern int mca_spml_yoda_deregister(sshmem_mkey_t *mkeys);
|
||||
extern int mca_spml_yoda_add_procs(ompi_proc_t** procs,
|
||||
size_t nprocs);
|
||||
extern int mca_spml_yoda_del_procs(ompi_proc_t** procs,
|
||||
size_t nprocs);
|
||||
extern int mca_spml_yoda_fence(void);
|
||||
extern void* mca_spml_yoda_get_remote_context(void*);
|
||||
extern void mca_spml_yoda_set_remote_context(void**, void*);
|
||||
extern int mca_spml_yoda_get_remote_context_size(void*);
|
||||
extern void mca_spml_yoda_set_remote_context_size(void**, int);
|
||||
extern int mca_spml_yoda_wait_gets(void);
|
||||
|
||||
#if OSHMEM_WAIT_COMPLETION_DEBUG == 1
|
||||
extern void condition_dbg_init(void);
|
||||
extern void condition_dbg_finalize(void);
|
||||
#endif
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -1,140 +0,0 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "oshmem_config.h"
|
||||
#include "oshmem/runtime/params.h"
|
||||
#include "oshmem/mca/spml/spml.h"
|
||||
#include "spml_yoda_component.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_rdmafrag.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_putreq.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda.h"
|
||||
|
||||
static int mca_spml_yoda_component_register(void);
|
||||
static int mca_spml_yoda_component_open(void);
|
||||
static int mca_spml_yoda_component_close(void);
|
||||
static mca_spml_base_module_t*
|
||||
mca_spml_yoda_component_init(int* priority,
|
||||
bool enable_progress_threads,
|
||||
bool enable_mpi_threads);
|
||||
static int mca_spml_yoda_component_fini(void);
|
||||
|
||||
mca_spml_base_component_2_0_0_t mca_spml_yoda_component = {
|
||||
|
||||
/* First, the mca_base_component_t struct containing meta
|
||||
information about the component itself */
|
||||
|
||||
.spmlm_version = {
|
||||
MCA_SPML_BASE_VERSION_2_0_0,
|
||||
|
||||
.mca_component_name = "yoda",
|
||||
MCA_BASE_MAKE_VERSION(component, OSHMEM_MAJOR_VERSION, OSHMEM_MINOR_VERSION,
|
||||
OSHMEM_RELEASE_VERSION),
|
||||
.mca_open_component = mca_spml_yoda_component_open,
|
||||
.mca_close_component = mca_spml_yoda_component_close,
|
||||
.mca_register_component_params = mca_spml_yoda_component_register,
|
||||
},
|
||||
.spmlm_data = {
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
},
|
||||
|
||||
.spmlm_init = mca_spml_yoda_component_init,
|
||||
.spmlm_finalize = mca_spml_yoda_component_fini,
|
||||
};
|
||||
|
||||
static inline void mca_spml_yoda_param_register_int(const char *param_name,
|
||||
int default_value,
|
||||
const char *help_msg,
|
||||
int *storage)
|
||||
{
|
||||
*storage = default_value;
|
||||
(void) mca_base_component_var_register(&mca_spml_yoda_component.spmlm_version,
|
||||
param_name,
|
||||
help_msg,
|
||||
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
|
||||
OPAL_INFO_LVL_9,
|
||||
MCA_BASE_VAR_SCOPE_READONLY,
|
||||
storage);
|
||||
}
|
||||
|
||||
static int mca_spml_yoda_component_register(void)
|
||||
{
|
||||
mca_spml_yoda_param_register_int("free_list_num", 1024,
|
||||
0,
|
||||
&mca_spml_yoda.free_list_num);
|
||||
mca_spml_yoda_param_register_int("free_list_max", 1024,
|
||||
0,
|
||||
&mca_spml_yoda.free_list_max);
|
||||
mca_spml_yoda_param_register_int("free_list_inc", 16,
|
||||
0,
|
||||
&mca_spml_yoda.free_list_inc);
|
||||
mca_spml_yoda_param_register_int("bml_alloc_threshold", 3,
|
||||
"number of puts to wait \
|
||||
in case of put/get temporary buffer \
|
||||
allocation failture",
|
||||
&mca_spml_yoda.bml_alloc_threshold);
|
||||
mca_spml_yoda_param_register_int("priority", 10,
|
||||
"[integer] yoda priority",
|
||||
&mca_spml_yoda.priority);
|
||||
return OSHMEM_SUCCESS;
|
||||
}
|
||||
|
||||
static int mca_spml_yoda_component_open(void)
|
||||
{
|
||||
return OSHMEM_SUCCESS;
|
||||
}
|
||||
|
||||
static int mca_spml_yoda_component_close(void)
|
||||
{
|
||||
return OSHMEM_SUCCESS;
|
||||
}
|
||||
|
||||
static mca_spml_base_module_t*
|
||||
mca_spml_yoda_component_init(int* priority,
|
||||
bool enable_progress_threads,
|
||||
bool enable_mpi_threads)
|
||||
{
|
||||
SPML_VERBOSE( 10, "in yoda, my priority is %d\n", mca_spml_yoda.priority);
|
||||
|
||||
*priority = mca_spml_yoda.priority;
|
||||
if ((*priority) > mca_spml_yoda.priority) {
|
||||
return NULL ;
|
||||
}
|
||||
|
||||
/* We use BML/BTL and need to start it */
|
||||
if (!mca_bml_base_inited()) {
|
||||
SPML_VERBOSE(10, "can not select yoda because ompi has no bml component");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mca_spml_yoda.n_active_puts = 0;
|
||||
mca_spml_yoda.n_active_gets = 0;
|
||||
|
||||
return &mca_spml_yoda.super;
|
||||
}
|
||||
|
||||
int mca_spml_yoda_component_fini(void)
|
||||
{
|
||||
if (!mca_spml_yoda.enabled) {
|
||||
return OSHMEM_SUCCESS; /* never selected.. return success.. */
|
||||
}
|
||||
mca_spml_yoda.enabled = false; /* not anymore */
|
||||
|
||||
OBJ_DESTRUCT(&mca_spml_yoda.lock);
|
||||
#if OSHMEM_WAIT_COMPLETION_DEBUG == 1
|
||||
condition_dbg_finalize();
|
||||
#endif
|
||||
|
||||
return OSHMEM_SUCCESS;
|
||||
}
|
||||
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef MCA_SPML_YODA_COMPONENT_H
|
||||
#define MCA_SPML_YODA_COMPONENT_H
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/*
|
||||
* SPML module functions.
|
||||
*/
|
||||
OSHMEM_MODULE_DECLSPEC extern mca_spml_base_component_2_0_0_t mca_spml_yoda_component;
|
||||
END_C_DECLS
|
||||
|
||||
#endif
|
@ -1,128 +0,0 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "oshmem_config.h"
|
||||
#include "opal/prefetch.h"
|
||||
#include "oshmem/constants.h"
|
||||
#include "oshmem/mca/spml/spml.h"
|
||||
#include "opal/mca/btl/btl.h"
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
#include "opal/mca/mpool/mpool.h"
|
||||
#include "ompi/mca/bml/base/base.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_putreq.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_getreq.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_rdmafrag.h"
|
||||
|
||||
/*
|
||||
* The free call mark the final stage in a request life-cycle. Starting from this
|
||||
* point the request is completed at both SPML and user level, and can be used
|
||||
* for others one sided communications. Therefore, in the case of the YODA SPML it should
|
||||
* be added to the free request list.
|
||||
*/
|
||||
static int mca_spml_yoda_get_request_free(struct oshmem_request_t** request)
|
||||
{
|
||||
mca_spml_yoda_get_request_t* getreq =
|
||||
*(mca_spml_yoda_get_request_t**) request;
|
||||
|
||||
assert( false == getreq->req_get.req_base.req_free_called);
|
||||
|
||||
OPAL_THREAD_LOCK(&oshmem_request_lock);
|
||||
getreq->req_get.req_base.req_free_called = true;
|
||||
|
||||
opal_free_list_return (&mca_spml_base_get_requests,
|
||||
(opal_free_list_item_t*)getreq);
|
||||
|
||||
OPAL_THREAD_UNLOCK(&oshmem_request_lock);
|
||||
|
||||
*request = SHMEM_REQUEST_NULL; /*MPI_REQUEST_NULL;*/
|
||||
return OSHMEM_SUCCESS;
|
||||
}
|
||||
|
||||
static int mca_spml_yoda_get_request_cancel(struct oshmem_request_t* request,
|
||||
int complete)
|
||||
{
|
||||
/* we dont cancel get requests by now */
|
||||
return OSHMEM_SUCCESS;
|
||||
}
|
||||
|
||||
static void mca_spml_yoda_get_request_construct(mca_spml_yoda_get_request_t* req)
|
||||
{
|
||||
req->req_get.req_base.req_type = MCA_SPML_REQUEST_GET;
|
||||
req->req_get.req_base.req_oshmem.req_free = mca_spml_yoda_get_request_free;
|
||||
req->req_get.req_base.req_oshmem.req_cancel =
|
||||
mca_spml_yoda_get_request_cancel;
|
||||
}
|
||||
|
||||
static void mca_spml_yoda_get_request_destruct(mca_spml_yoda_get_request_t* req)
|
||||
{
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE( mca_spml_yoda_get_request_t,
|
||||
mca_spml_base_get_request_t,
|
||||
mca_spml_yoda_get_request_construct,
|
||||
mca_spml_yoda_get_request_destruct);
|
||||
|
||||
void mca_spml_yoda_get_completion (struct mca_btl_base_module_t* module,
|
||||
struct mca_btl_base_endpoint_t* endpoint,
|
||||
void *local_address,
|
||||
struct mca_btl_base_registration_handle_t *local_handle,
|
||||
void *context, void *cbdata, int status)
|
||||
{
|
||||
mca_spml_yoda_rdma_frag_t* frag =
|
||||
(mca_spml_yoda_rdma_frag_t*) cbdata;
|
||||
mca_spml_yoda_get_request_t* getreq =
|
||||
(mca_spml_yoda_get_request_t*) frag->rdma_req;
|
||||
mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*) context;
|
||||
|
||||
/* check completion status */
|
||||
if (OPAL_UNLIKELY(OPAL_SUCCESS != status)) {
|
||||
/* shmem has no way to propagate errors. cry&die */
|
||||
SPML_ERROR("FATAL get completion error");
|
||||
abort();
|
||||
}
|
||||
|
||||
if (getreq->parent) {
|
||||
OPAL_THREAD_ADD32(&getreq->parent->active_count, -1);
|
||||
}
|
||||
getreq->req_get.req_base.req_spml_complete = true;
|
||||
oshmem_request_complete(&getreq->req_get.req_base.req_oshmem, 1);
|
||||
oshmem_request_free((oshmem_request_t**) &getreq);
|
||||
|
||||
if (bml_btl->btl->btl_register_mem && frag->local_handle) {
|
||||
bml_btl->btl->btl_deregister_mem (bml_btl->btl, frag->local_handle);
|
||||
}
|
||||
|
||||
OPAL_THREAD_ADD32(&mca_spml_yoda.n_active_gets, -1);
|
||||
}
|
||||
|
||||
void mca_spml_yoda_get_response_completion(mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* ep,
|
||||
struct mca_btl_base_descriptor_t* des,
|
||||
int status)
|
||||
{
|
||||
mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*) des->des_context;
|
||||
|
||||
/* check completion status */
|
||||
if (OPAL_UNLIKELY(OSHMEM_SUCCESS != status)) {
|
||||
/* shmem has no way to propagate errors. cry&die */
|
||||
SPML_ERROR("FATAL get completion error");
|
||||
abort();
|
||||
}
|
||||
|
||||
mca_bml_base_free(bml_btl, des);
|
||||
|
||||
OPAL_THREAD_ADD32(&mca_spml_yoda.n_active_gets, -1);
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef OSHMEM_SPML_YODA_GET_REQUEST_H
|
||||
#define OSHMEM_SPML_YODA_GET_REQUEST_H
|
||||
|
||||
#include "opal/mca/btl/btl.h"
|
||||
#include "oshmem/mca/spml/base/spml_base_putreq.h"
|
||||
#include "opal/mca/mpool/base/base.h"
|
||||
#include "ompi/mca/bml/bml.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_rdmafrag.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda.h"
|
||||
#include "orte/runtime/orte_globals.h"
|
||||
#include "oshmem/mca/spml/base/spml_base_getreq.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
struct mca_spml_yoda_getreq_parent {
|
||||
int32_t active_count;
|
||||
};
|
||||
|
||||
struct mca_spml_yoda_get_request_t {
|
||||
mca_spml_base_get_request_t req_get;
|
||||
uint64_t *p_dst;
|
||||
struct mca_spml_yoda_getreq_parent *parent;
|
||||
mca_spml_yoda_rdma_frag_t get_frag;
|
||||
};
|
||||
|
||||
typedef struct mca_spml_yoda_get_request_t mca_spml_yoda_get_request_t;
|
||||
OBJ_CLASS_DECLARATION(mca_spml_yoda_get_request_t);
|
||||
|
||||
static inline mca_spml_yoda_get_request_t *mca_spml_yoda_getreq_alloc(int dst)
|
||||
{
|
||||
opal_free_list_item_t *item;
|
||||
mca_spml_yoda_get_request_t *getreq;
|
||||
|
||||
item = opal_free_list_wait (&mca_spml_base_get_requests);
|
||||
getreq = (mca_spml_yoda_get_request_t*) item;
|
||||
assert(getreq);
|
||||
getreq->req_get.req_base.req_free_called = false;
|
||||
getreq->req_get.req_base.req_oshmem.req_complete = false;
|
||||
|
||||
return getreq;
|
||||
}
|
||||
|
||||
void mca_spml_yoda_get_completion (struct mca_btl_base_module_t* module,
|
||||
struct mca_btl_base_endpoint_t* endpoint,
|
||||
void *local_address,
|
||||
struct mca_btl_base_registration_handle_t *local_handle,
|
||||
void *context, void *cbdata, int status);
|
||||
|
||||
void mca_spml_yoda_get_response_completion(mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* ep,
|
||||
struct mca_btl_base_descriptor_t* des,
|
||||
int status);
|
||||
|
||||
END_C_DECLS
|
||||
#endif /* OSHMEM_SPML_YODA_GET_REQUEST_H */
|
@ -1,113 +0,0 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "oshmem_config.h"
|
||||
#include "opal/prefetch.h"
|
||||
#include "oshmem/constants.h"
|
||||
#include "oshmem/mca/spml/spml.h"
|
||||
#include "opal/mca/btl/btl.h"
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
#include "opal/mca/mpool/mpool.h"
|
||||
#include "ompi/mca/bml/base/base.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_putreq.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_rdmafrag.h"
|
||||
#include "oshmem/runtime/runtime.h"
|
||||
/*
|
||||
* The free call mark the final stage in a request life-cycle. Starting from this
|
||||
* point the request is completed at both SPML and user level, and can be used
|
||||
* for others p2p communications. Therefore, in the case of the YODA SPML it should
|
||||
* be added to the free request list.
|
||||
*/
|
||||
static int mca_spml_yoda_put_request_free(struct oshmem_request_t** request)
|
||||
{
|
||||
mca_spml_yoda_put_request_t* putreq =
|
||||
*(mca_spml_yoda_put_request_t**) request;
|
||||
|
||||
assert( false == putreq->req_put.req_base.req_free_called);
|
||||
|
||||
OPAL_THREAD_LOCK(&oshmem_request_lock);
|
||||
putreq->req_put.req_base.req_free_called = true;
|
||||
opal_free_list_return (&mca_spml_base_put_requests,
|
||||
(opal_free_list_item_t*)putreq);
|
||||
OPAL_THREAD_UNLOCK(&oshmem_request_lock);
|
||||
|
||||
*request = SHMEM_REQUEST_NULL;
|
||||
return OSHMEM_SUCCESS;
|
||||
}
|
||||
|
||||
static int mca_spml_yoda_put_request_cancel(struct oshmem_request_t* request,
|
||||
int complete)
|
||||
{
|
||||
/* we dont cancel put requests by now */
|
||||
return OSHMEM_SUCCESS;
|
||||
}
|
||||
|
||||
static void mca_spml_yoda_put_request_construct(mca_spml_yoda_put_request_t* req)
|
||||
{
|
||||
req->req_put.req_base.req_type = MCA_SPML_REQUEST_PUT;
|
||||
req->req_put.req_base.req_oshmem.req_free = mca_spml_yoda_put_request_free;
|
||||
req->req_put.req_base.req_oshmem.req_cancel =
|
||||
mca_spml_yoda_put_request_cancel;
|
||||
}
|
||||
|
||||
static void mca_spml_yoda_put_request_destruct(mca_spml_yoda_put_request_t* req)
|
||||
{
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE( mca_spml_yoda_put_request_t,
|
||||
mca_spml_base_put_request_t,
|
||||
mca_spml_yoda_put_request_construct,
|
||||
mca_spml_yoda_put_request_destruct);
|
||||
|
||||
void mca_spml_yoda_put_completion(mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* ep,
|
||||
struct mca_btl_base_descriptor_t* des,
|
||||
int status)
|
||||
{
|
||||
mca_spml_yoda_rdma_frag_t* frag =
|
||||
(mca_spml_yoda_rdma_frag_t*) des->des_cbdata;
|
||||
mca_spml_yoda_put_request_t* putreq =
|
||||
(mca_spml_yoda_put_request_t*) frag->rdma_req;
|
||||
mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*) des->des_context;
|
||||
|
||||
OPAL_THREAD_ADD32(&mca_spml_yoda.n_active_puts, -1);
|
||||
/* check completion status */
|
||||
if (OPAL_UNLIKELY(OSHMEM_SUCCESS != status)) {
|
||||
/* no way to propagete errors. die */
|
||||
SPML_ERROR("FATAL put completion error");
|
||||
oshmem_shmem_abort(-1);
|
||||
}
|
||||
|
||||
putreq->req_put.req_base.req_spml_complete = true;
|
||||
oshmem_request_complete(&putreq->req_put.req_base.req_oshmem, 1);
|
||||
oshmem_request_free((oshmem_request_t**) &putreq);
|
||||
mca_bml_base_free(bml_btl, des);
|
||||
}
|
||||
|
||||
void mca_spml_yoda_put_completion_rdma (struct mca_btl_base_module_t* module,
|
||||
struct mca_btl_base_endpoint_t* endpoint,
|
||||
void *local_address,
|
||||
struct mca_btl_base_registration_handle_t *local_handle,
|
||||
void *context, void *cbdata, int status)
|
||||
{
|
||||
mca_btl_base_descriptor_t *des = (mca_btl_base_descriptor_t *) cbdata;
|
||||
mca_bml_base_btl_t *bml_btl = (mca_bml_base_btl_t *) context;
|
||||
des->des_context = context;
|
||||
|
||||
if (bml_btl->btl->btl_register_mem) {
|
||||
bml_btl->btl->btl_deregister_mem (bml_btl->btl, local_handle);
|
||||
}
|
||||
|
||||
des->des_cbfunc (module, endpoint, des, status);
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef OSHMEM_SPML_YODA_PUT_REQUEST_H
|
||||
#define OSHMEM_SPML_YODA_PUT_REQUEST_H
|
||||
|
||||
#include "opal/mca/btl/btl.h"
|
||||
#include "oshmem/mca/spml/base/base.h"
|
||||
#include "oshmem/mca/spml/base/spml_base_putreq.h"
|
||||
#include "opal/mca/mpool/base/base.h"
|
||||
#include "ompi/mca/bml/bml.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda_rdmafrag.h"
|
||||
#include "oshmem/mca/spml/yoda/spml_yoda.h"
|
||||
#include "orte/runtime/orte_globals.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
struct mca_spml_yoda_put_request_t {
|
||||
mca_spml_base_put_request_t req_put;
|
||||
mca_spml_yoda_rdma_frag_t put_frag;
|
||||
};
|
||||
|
||||
typedef struct mca_spml_yoda_put_request_t mca_spml_yoda_put_request_t;
|
||||
|
||||
OBJ_CLASS_DECLARATION(mca_spml_yoda_put_request_t);
|
||||
|
||||
static inline mca_spml_yoda_put_request_t *mca_spml_yoda_putreq_alloc(int dst) {
|
||||
opal_free_list_item_t *item;
|
||||
mca_spml_yoda_put_request_t *putreq;
|
||||
|
||||
item = opal_free_list_wait (&mca_spml_base_put_requests);
|
||||
putreq = (mca_spml_yoda_put_request_t*) item;
|
||||
assert(putreq);
|
||||
putreq->req_put.req_base.req_free_called = false;
|
||||
putreq->req_put.req_base.req_oshmem.req_complete = false;
|
||||
|
||||
return putreq;
|
||||
}
|
||||
|
||||
void mca_spml_yoda_put_completion(mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* ep,
|
||||
struct mca_btl_base_descriptor_t* des,
|
||||
int status);
|
||||
|
||||
void mca_spml_yoda_put_completion_rdma (struct mca_btl_base_module_t* module,
|
||||
struct mca_btl_base_endpoint_t* endpoint,
|
||||
void *local_address,
|
||||
struct mca_btl_base_registration_handle_t *local_handle,
|
||||
void *context, void *cbdata, int status);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* OSHMEM_SPML_YODA_PUT_REQUEST_H */
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef MCA_SPML_YODA_RDMAFRAG_H
|
||||
#define MCA_SPML_YODA_RDMAFRAG_H
|
||||
|
||||
#include "opal/mca/btl/btl.h"
|
||||
#include "opal/types.h"
|
||||
#include "opal/util/arch.h"
|
||||
#include "oshmem/proc/proc.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
typedef enum {
|
||||
MCA_SPML_YODA_RDMA_PUT,
|
||||
MCA_SPML_YODA_RDMA_GET
|
||||
} mca_spml_yoda_rdma_state_t;
|
||||
|
||||
typedef union mca_spml_yoda_segment_t {
|
||||
mca_btl_base_segment_t base_seg;
|
||||
} mca_spml_yoda_segment_t;
|
||||
|
||||
struct mca_spml_yoda_rdma_frag_t {
|
||||
mca_spml_yoda_segment_t rdma_segs[2];
|
||||
mca_btl_base_registration_handle_t *local_handle;
|
||||
void *rdma_req;
|
||||
int allocated;
|
||||
int use_send;
|
||||
int size;
|
||||
};
|
||||
|
||||
typedef struct mca_spml_yoda_rdma_frag_t mca_spml_yoda_rdma_frag_t;
|
||||
END_C_DECLS
|
||||
#endif
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user