1
1

btl: use flag enumerator for btl_*_flags and btl_*_atomic_flags

This commit uses the new flag "enumerator" to support comma-delimited
lists of flags for both the btl and btl atomic flags. After this
commit is is valid to specify something like -mca btl_foo_flags
self,put,get,in-place. All non-deprecated flags are supported by the
enumerator.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Этот коммит содержится в:
Nathan Hjelm 2016-03-21 15:23:37 -06:00
родитель b15a45088c
Коммит 7572c8b74f
2 изменённых файлов: 55 добавлений и 27 удалений

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

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -13,6 +14,8 @@
* Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -30,6 +33,39 @@
#include "opal/mca/btl/btl.h"
#include "opal/mca/btl/base/base.h"
mca_base_var_enum_flag_t *mca_btl_base_flag_enum = NULL;
mca_base_var_enum_flag_t *mca_btl_base_atomic_enum = NULL;
mca_base_var_enum_value_flag_t mca_btl_base_flag_enum_flags[] = {
{MCA_BTL_FLAGS_SEND, "send", 0},
{MCA_BTL_FLAGS_PUT, "put", 0},
{MCA_BTL_FLAGS_GET, "get", 0},
{MCA_BTL_FLAGS_SEND_INPLACE, "inplace", 0},
{MCA_BTL_FLAGS_SIGNALED, "signaled", 0},
{MCA_BTL_FLAGS_ATOMIC_OPS, "atomics", 0},
{MCA_BTL_FLAGS_ATOMIC_FOPS, "fetching-atomics", 0},
{MCA_BTL_FLAGS_SINGLE_ADD_PROCS, "static", 0},
{MCA_BTL_FLAGS_CUDA_PUT, "cuda-put", 0},
{MCA_BTL_FLAGS_CUDA_GET, "cuda-get", 0},
{MCA_BTL_FLAGS_CUDA_COPY_ASYNC_SEND, "cuda-async-send", 0},
{MCA_BTL_FLAGS_CUDA_COPY_ASYNC_RECV, "cuda-async-recv", 0},
{MCA_BTL_FLAGS_FAILOVER_SUPPORT, "failover", 0},
{MCA_BTL_FLAGS_NEED_ACK, "need-ack", 0},
{MCA_BTL_FLAGS_NEED_CSUM, "need-csum", 0},
{MCA_BTL_FLAGS_HETEROGENEOUS_RDMA, "hetero-rdma", 0},
{0, NULL, 0}
};
mca_base_var_enum_value_flag_t mca_btl_base_atomic_enum_flags[] = {
{MCA_BTL_ATOMIC_SUPPORTS_ADD, "add", 0},
{MCA_BTL_ATOMIC_SUPPORTS_AND, "and", 0},
{MCA_BTL_ATOMIC_SUPPORTS_OR, "or", 0},
{MCA_BTL_ATOMIC_SUPPORTS_XOR, "xor", 0},
{MCA_BTL_ATOMIC_SUPPORTS_CSWAP, "compare-and-swap", 0},
{MCA_BTL_ATOMIC_SUPPORTS_GLOB, "global"},
{0, NULL, 0}
};
mca_btl_active_message_callback_t mca_btl_base_active_message_trigger[MCA_BTL_TAG_MAX] = {{0}};
/*
@ -104,6 +140,9 @@ static int mca_btl_base_register(mca_base_register_flag_t flags)
MCA_BASE_VAR_SCOPE_READONLY,
&mca_btl_base_warn_component_unused);
(void) mca_base_var_enum_create_flag ("btl_flags", mca_btl_base_flag_enum_flags, &mca_btl_base_flag_enum);
(void) mca_base_var_enum_create_flag ("btl_atomic_flags", mca_btl_base_atomic_enum_flags, &mca_btl_base_atomic_enum);
return OPAL_SUCCESS;
}
@ -159,6 +198,14 @@ static int mca_btl_base_close(void)
OBJ_DESTRUCT(&mca_btl_base_modules_initialized);
if (mca_btl_base_flag_enum) {
OBJ_RELEASE(mca_btl_base_flag_enum);
}
if (mca_btl_base_atomic_enum) {
OBJ_RELEASE(mca_btl_base_atomic_enum);
}
#if 0
/* restore event processing */
opal_event_enable();

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

@ -14,6 +14,8 @@
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
* reserved.
*
* $COPYRIGHT$
*
@ -34,8 +36,6 @@
int mca_btl_base_param_register(mca_base_component_t *version,
mca_btl_base_module_t *module)
{
char *msg;
/* If this is ever triggered change the uint32_ts in mca_btl_base_module_t to unsigned ints */
assert(sizeof(unsigned int) == sizeof(uint32_t));
@ -46,33 +46,14 @@ int mca_btl_base_param_register(mca_base_component_t *version,
MCA_BASE_VAR_SCOPE_READONLY,
&module->btl_exclusivity);
asprintf(&msg, "BTL bit flags (general flags: SEND=%d, PUT=%d, GET=%d, SEND_INPLACE=%d, HETEROGENEOUS_RDMA=%d, "
"ATOMIC_OPS=%d; flags only used by the \"dr\" PML (ignored by others): ACK=%d, CHECKSUM=%d, "
"RDMA_COMPLETION=%d; flags only used by the \"bfo\" PML (ignored by others): FAILOVER_SUPPORT=%d)",
MCA_BTL_FLAGS_SEND,
MCA_BTL_FLAGS_PUT,
MCA_BTL_FLAGS_GET,
MCA_BTL_FLAGS_SEND_INPLACE,
MCA_BTL_FLAGS_HETEROGENEOUS_RDMA,
MCA_BTL_FLAGS_ATOMIC_OPS,
MCA_BTL_FLAGS_NEED_ACK,
MCA_BTL_FLAGS_NEED_CSUM,
MCA_BTL_FLAGS_RDMA_COMPLETION,
MCA_BTL_FLAGS_FAILOVER_SUPPORT);
(void) mca_base_component_var_register(version, "flags", msg,
MCA_BASE_VAR_TYPE_UNSIGNED_INT, NULL, 0, 0,
OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY,
&module->btl_flags);
free(msg);
(void) mca_base_component_var_register(version, "flags", "BTL bit flags (general flags: send, put, get, in-place, hetero-rdma, "
"atomics, fetching-atomics)", MCA_BASE_VAR_TYPE_UNSIGNED_INT,
&mca_btl_base_flag_enum->super, 0, 0, OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_READONLY, &module->btl_flags);
asprintf (&msg, "BTL atomic bit flags (general flags: ADD=%d, AND=%d, OR=%d, XOR=%d",
MCA_BTL_ATOMIC_SUPPORTS_ADD, MCA_BTL_ATOMIC_SUPPORTS_AND, MCA_BTL_ATOMIC_SUPPORTS_OR,
MCA_BTL_ATOMIC_SUPPORTS_XOR);
(void) mca_base_component_var_register(version, "atomic_flags", msg, MCA_BASE_VAR_TYPE_UNSIGNED_INT,
NULL, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY, OPAL_INFO_LVL_5,
(void) mca_base_component_var_register(version, "atomic_flags", "BTL atomic support flags", MCA_BASE_VAR_TYPE_UNSIGNED_INT,
&mca_btl_base_atomic_enum->super, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY, OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_CONSTANT, &module->btl_atomic_flags);
free(msg);
(void) mca_base_component_var_register(version, "rndv_eager_limit", "Size (in bytes, including header) of \"phase 1\" fragment sent for all large messages (must be >= 0 and <= eager_limit)",
MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, 0,