Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IB/DC/TEST: Fix compilation with gcc 7.1 #1776

Merged
merged 3 commits into from
Aug 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/uct/ib/base/ib_md.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,8 @@ static ucs_rcache_ops_t uct_ib_rcache_ops = {

static void uct_ib_make_md_name(char md_name[UCT_MD_NAME_MAX], struct ibv_device *device)
{
snprintf(md_name, UCT_MD_NAME_MAX, "%s/%s", UCT_IB_MD_PREFIX, device->name);
snprintf(md_name, UCT_MD_NAME_MAX, "%s/", UCT_IB_MD_PREFIX);
strncat(md_name, device->name, UCT_MD_NAME_MAX - strlen(device->name) - 1);
}

static ucs_status_t uct_ib_query_md_resources(uct_md_resource_desc_t **resources_p,
Expand Down
6 changes: 3 additions & 3 deletions src/uct/ib/dc/accel/dc_mlx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ uct_dc_mlx5_iface_atomic_post(uct_dc_mlx5_iface_t *iface, uct_dc_mlx5_ep_t *ep,
desc->super.sn = txwq->sw_pi;
uct_rc_mlx5_txqp_dptr_post(&iface->super.super, IBV_EXP_QPT_DC_INI, txqp, txwq,
opcode, desc + 1, length, &desc->lkey,
0, NULL, 0, remote_addr, ib_rkey,
0, desc/*dummy*/, 0, remote_addr, ib_rkey,
compare_mask, compare, swap_add,
&ep->av, uct_ib_mlx5_wqe_av_size(&ep->av),
MLX5_WQE_CTRL_CQ_UPDATE);
Expand Down Expand Up @@ -606,7 +606,7 @@ ucs_status_t uct_dc_mlx5_ep_fc_ctrl(uct_ep_t *tl_ep, unsigned op,

uct_rc_mlx5_txqp_inline_post(&iface->super.super, IBV_EXP_QPT_DC_INI,
txqp, txwq, MLX5_OPCODE_SEND,
NULL, 0, op, sender_ep, 0,
&av /*dummy*/, 0, op, sender_ep, 0,
0, 0,
&av, uct_ib_mlx5_wqe_av_size(&av));
} else {
Expand All @@ -619,7 +619,7 @@ ucs_status_t uct_dc_mlx5_ep_fc_ctrl(uct_ep_t *tl_ep, unsigned op,

uct_rc_mlx5_txqp_inline_post(&iface->super.super, IBV_EXP_QPT_DC_INI,
txqp, txwq, MLX5_OPCODE_SEND_IMM,
NULL, 0, op, sender_ep,
&dc_mlx5_ep->av /*dummy*/, 0, op, sender_ep,
iface->super.rx.dct->dct_num,
0, 0,
&dc_mlx5_ep->av,
Expand Down
2 changes: 2 additions & 0 deletions test/gtest/ucp/test_ucp_tag_match.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,12 @@ UCS_TEST_P(test_ucp_tag_match, send2_nb_recv_medium_wildcard, "RNDV_THRESH=-1")

/* Release sends */
if (sreq1 != NULL) {
wait(sreq1);
EXPECT_TRUE(sreq1->completed);
request_release(sreq1);
}
if (sreq2 != NULL) {
wait(sreq2);
EXPECT_TRUE(sreq2->completed);
request_release(sreq2);
}
Expand Down
42 changes: 24 additions & 18 deletions test/gtest/ucs/test_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,21 @@ extern "C" {
class stats_test : public ucs::test {
public:

template <unsigned N>
struct stats_class {
ucs_stats_class_t cls;
const char *counter_names[N];
};
stats_test() {
size_t size = sizeof(ucs_stats_class_t) +
NUM_COUNTERS * sizeof(m_data_stats_class->counter_names[0]);
m_data_stats_class = (ucs_stats_class_t*)malloc(size);
m_data_stats_class->name = "data";
m_data_stats_class->num_counters = NUM_COUNTERS;
m_data_stats_class->counter_names[0] = "counter0";
m_data_stats_class->counter_names[1] = "counter1";
m_data_stats_class->counter_names[2] = "counter2";
m_data_stats_class->counter_names[3] = "counter3";
}

~stats_test() {
free(m_data_stats_class);
}

virtual void init() {
ucs::test::init();
Expand All @@ -46,21 +56,16 @@ class stats_test : public ucs::test {

void prepare_nodes(ucs_stats_node_t **cat_node,
ucs_stats_node_t *data_nodes[NUM_DATA_NODES]) {
static stats_class<0> category_stats_class = {
{"category", 0, {}}
};

static stats_class<4> data_stats_class = {
{ "data", NUM_COUNTERS, {} },
{ "counter0","counter1","counter2","counter3" }
static ucs_stats_class_t category_stats_class = {
"category", 0, {}
};

ucs_status_t status = UCS_STATS_NODE_ALLOC(cat_node,
&category_stats_class.cls,
&category_stats_class,
ucs_stats_get_root());
ASSERT_UCS_OK(status);
for (unsigned i = 0; i < NUM_DATA_NODES; ++i) {
status = UCS_STATS_NODE_ALLOC(&data_nodes[i], &data_stats_class.cls,
status = UCS_STATS_NODE_ALLOC(&data_nodes[i], m_data_stats_class,
*cat_node, "-%d", i);
ASSERT_UCS_OK(status);

Expand Down Expand Up @@ -109,6 +114,8 @@ class stats_test : public ucs::test {

protected:
static const unsigned NUM_COUNTERS = 4;

ucs_stats_class_t *m_data_stats_class;
};

class stats_udp_test : public stats_test {
Expand Down Expand Up @@ -250,11 +257,10 @@ class stats_on_exit_test : public stats_file_test {
UCS_TEST_F(stats_on_demand_test, null_root) {
ucs_stats_node_t *cat_node;

static stats_class<0> category_stats_class = {
{"category", 0, {}}
static ucs_stats_class_t category_stats_class = {
"category", 0, {}
};
ucs_status_t status = UCS_STATS_NODE_ALLOC(&cat_node,
&category_stats_class.cls,
ucs_status_t status = UCS_STATS_NODE_ALLOC(&cat_node, &category_stats_class,
NULL);

EXPECT_GE(status, UCS_ERR_INVALID_PARAM);
Expand Down
38 changes: 24 additions & 14 deletions test/gtest/ucs/test_stats_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,24 @@ extern "C" {
class stats_filter_test : public ucs::test {
public:

template <unsigned N>
struct stats_class {
ucs_stats_class_t cls;
const char *counter_names[N];
};
stats_filter_test() {
size_t size = sizeof(ucs_stats_class_t) +
NUM_COUNTERS * sizeof(m_data_stats_class->counter_names[0]);
m_data_stats_class = (ucs_stats_class_t*)malloc(size);
m_data_stats_class->name = "data";
m_data_stats_class->num_counters = NUM_COUNTERS;
m_data_stats_class->counter_names[0] = "counter0";
m_data_stats_class->counter_names[1] = "counter1";
m_data_stats_class->counter_names[2] = "counter2";
m_data_stats_class->counter_names[3] = "counter3";

cat_node = NULL;
data_nodes[0] = data_nodes[1] = data_nodes[2] = NULL;
}

~stats_filter_test() {
free(m_data_stats_class);
}

virtual void init() {
ucs::test::init();
Expand All @@ -47,19 +60,15 @@ class stats_filter_test : public ucs::test {
virtual std::string stats_format_config() = 0;

void prepare_nodes() {
static stats_class<0> category_stats_class = {
{"category", 0, {}}
};

static stats_class<4> data_stats_class = {
{ "data", NUM_COUNTERS, {} },
{ "counter0","counter1","counter2","counter3" }
static ucs_stats_class_t category_stats_class = {
"category", 0, {}
};

ucs_status_t status = UCS_STATS_NODE_ALLOC(&cat_node, &category_stats_class.cls, ucs_stats_get_root());
ucs_status_t status = UCS_STATS_NODE_ALLOC(&cat_node, &category_stats_class,
ucs_stats_get_root());
ASSERT_UCS_OK(status);
for (unsigned i = 0; i < NUM_DATA_NODES; ++i) {
status = UCS_STATS_NODE_ALLOC(&data_nodes[i], &data_stats_class.cls,
status = UCS_STATS_NODE_ALLOC(&data_nodes[i], m_data_stats_class,
cat_node, "-%d", i);
ASSERT_UCS_OK(status);

Expand All @@ -81,6 +90,7 @@ class stats_filter_test : public ucs::test {
static const unsigned NUM_DATA_NODES = 3;
static const unsigned NUM_COUNTERS = 4;

ucs_stats_class_t *m_data_stats_class;
ucs_stats_node_t *cat_node;
ucs_stats_node_t *data_nodes[NUM_DATA_NODES];
};
Expand Down