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

[Huawei]HMPI: Fix some bugs #35

Open
wants to merge 3 commits into
base: huawei
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion contrib/platform/mellanox/optimized.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
# See "ompi_info --param all all" for a full listing of Open MPI MCA
# parameters available and their default values.
#rmaps_base_mapping_policy = dist:auto
#rmaps_base_ranking_policy = core
rmaps_base_ranking_policy = core
coll = ^ml
hwloc_base_binding_policy = core
btl = self
Expand Down
12 changes: 6 additions & 6 deletions ompi/mca/coll/ucg/coll_ucg.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
* All rights reserved.
* All rights reserved.
* COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -123,7 +123,7 @@ typedef struct {

mca_coll_base_module_allgatherv_init_fn_t previous_allgatherv_init;
mca_coll_base_module_t *previous_allgatherv_init_module;
}mca_coll_ucg_module_t;
} mca_coll_ucg_module_t;
OBJ_CLASS_DECLARATION(mca_coll_ucg_module_t);

int mca_coll_ucg_init_query(bool enable_progress_threads, bool enable_mpi_threads);
Expand Down Expand Up @@ -153,7 +153,7 @@ int mca_coll_ucg_allreduce_init(const void *sbuf, void *rbuf, int count, ompi_da
ompi_op_t *op, ompi_communicator_t *comm, ompi_info_t *info,
ompi_request_t **request, mca_coll_base_module_t *module);

/* bcast*/
/* bcast */
int mca_coll_ucg_bcast(void *buff, int count, ompi_datatype_t *datatype,
int root, ompi_communicator_t *comm,
mca_coll_base_module_t *module);
Expand All @@ -174,7 +174,7 @@ int mca_coll_ucg_bcast_init(void *buffer, int count, MPI_Datatype datatype, int
ompi_communicator_t *comm, ompi_info_t *info,
ompi_request_t **request, mca_coll_base_module_t *module);

/* alltoallv*/
/* alltoallv */
int mca_coll_ucg_alltoallv(const void *sbuf, const int *scounts, const int *sdispls,
ompi_datatype_t *sdtype, void *rbuf, const int *rcounts,
const int *rdispls, ompi_datatype_t *rdtype,
Expand Down Expand Up @@ -203,7 +203,7 @@ int mca_coll_ucg_alltoallv_init(const void *sbuf, const int *scounts, const int
ompi_communicator_t *comm, ompi_info_t *info,
ompi_request_t **request, mca_coll_base_module_t *module);

/*barrier*/
/*barrier */
int mca_coll_ucg_barrier(ompi_communicator_t *comm, mca_coll_base_module_t *module);

int mca_coll_ucg_barrier_cache(ompi_communicator_t *comm, mca_coll_base_module_t *module);
Expand All @@ -217,7 +217,7 @@ int mca_coll_ucg_ibarrier_cache(ompi_communicator_t *comm, ompi_request_t **requ
int mca_coll_ucg_barrier_init(ompi_communicator_t *comm, ompi_info_t *info,
ompi_request_t **request, mca_coll_base_module_t *module);

/*scatterv*/
/*scatterv */
int mca_coll_ucg_scatterv(const void *sbuf, const int *scounts, const int *disps,
ompi_datatype_t *sdtype, void *rbuf, int rcount,
ompi_datatype_t *rdtype, int root,
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/ucg/coll_ucg_allreduce.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
* All rights reserved.
* All rights reserved.
* COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -28,7 +28,7 @@ static int mca_coll_ucg_request_allreduce_init(mca_coll_ucg_req_t *coll_req,
return rc;
}

//TODO: Check the memory type of buffer if possible
// TODO: Check the memory type of buffer if possible
ucg_request_h ucg_req;
const void *tmp_sbuf = sbuf == MPI_IN_PLACE ? UCG_IN_PLACE : sbuf;
ucg_status_t status = ucg_request_allreduce_init(tmp_sbuf, rbuf, count, ucg_dt, ucg_op,
Expand Down Expand Up @@ -227,6 +227,6 @@ int mca_coll_ucg_allreduce_init(const void *sbuf, void *rbuf, int count, ompi_da

fallback:
UCG_DEBUG("fallback allreduce init");
return ucg_module->previous_allreduce_init(sbuf, rbuf, count,datatype, op, comm, info,
return ucg_module->previous_allreduce_init(sbuf, rbuf, count, datatype, op, comm, info,
request, ucg_module->previous_allreduce_module);
}
4 changes: 2 additions & 2 deletions ompi/mca/coll/ucg/coll_ucg_alltoallv.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
* All rights reserved.
* All rights reserved.
* COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -35,7 +35,7 @@ static int mca_coll_ucg_request_alltoallv_init(mca_coll_ucg_req_t *coll_req,
return rc;
}

//TODO: Check the memory type of buffer if possible
// TODO: Check the memory type of buffer if possible
ucg_request_h ucg_req;
const void *tmp_sbuf = sbuf == MPI_IN_PLACE ? UCG_IN_PLACE : sbuf;
ucg_status_t status = ucg_request_alltoallv_init(tmp_sbuf, scounts, sdispls, ucg_send_dt,
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/ucg/coll_ucg_barrier.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
* All rights reserved.
* All rights reserved.
* COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
4 changes: 2 additions & 2 deletions ompi/mca/coll/ucg/coll_ucg_bcast.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
* All rights reserved.
* All rights reserved.
* COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -26,7 +26,7 @@ static int mca_coll_ucg_request_bcast_init(mca_coll_ucg_req_t *coll_req,
return rc;
}

//TODO: Check the memory type of buffer if possible
// TODO: Check the memory type of buffer if possible
ucg_request_h ucg_req;
ucg_status_t status = ucg_request_bcast_init(buff, count, ucg_dt, root,
module->group, &coll_req->info, &ucg_req);
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/ucg/coll_ucg_component.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
* All rights reserved.
* All rights reserved.
* COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/ucg/coll_ucg_debug.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
* All rights reserved.
* All rights reserved.
* COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
16 changes: 8 additions & 8 deletions ompi/mca/coll/ucg/coll_ucg_dt.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
* All rights reserved.
* All rights reserved.
* COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -69,7 +69,7 @@ static ucg_status_t mca_coll_ucg_conv_pack(void *conv, uint64_t offset, void *bu

iov_count = 1;
iov.iov_base = buffer;
iov.iov_len = *length;
iov.iov_len = *length;

opal_convertor_set_position(&convertor->opal_conv, &offset);
pack_length = *length;
Expand Down Expand Up @@ -115,7 +115,7 @@ static ucg_status_t mca_coll_ucg_conv_unpack(void *conv, uint64_t offset, const

iov_count = 1;
iov.iov_base = (void*)buffer;
iov.iov_len = *length;
iov.iov_len = *length;

/* in case if unordered message arrived - create separate convertor to
* unpack data. */
Expand Down Expand Up @@ -206,7 +206,7 @@ static inline ucg_dt_type_t ompi_dt_2_ucg_dt_type(ompi_datatype_t *ompi_dt)

static inline ucg_op_type_t ompi_op_2_ucg_op_type(ompi_op_t *ompi_op)
{
switch (ompi_op->op_type){
switch (ompi_op->op_type) {
case OMPI_OP_MAX:
return UCG_OP_TYPE_MAX;
case OMPI_OP_MIN:
Expand Down Expand Up @@ -260,7 +260,7 @@ static int mca_coll_ucg_type_create_user_dt(ompi_datatype_t *ompi_dt, ucg_dt_h *
params.conv.finish = mca_coll_ucg_conv_finish;
}
ucg_status_t status = ucg_dt_create(&params, ucg_dt);
if (status != UCG_OK){
if (status != UCG_OK) {
UCG_ERROR("Failed to create user-defined dt");
return OMPI_ERROR;
}
Expand Down Expand Up @@ -296,7 +296,7 @@ static int mca_coll_ucg_type_create_dt()
for (; type < UCG_DT_TYPE_PREDEFINED_LAST; ++type) {
params.type = type;
ucg_status_t status = ucg_dt_create(&params, &ucg_type_table.predefined_dt[type]);
if (status != UCG_OK){
if (status != UCG_OK) {
goto err_destroy_dt;
}
}
Expand Down Expand Up @@ -341,7 +341,7 @@ static int mca_coll_ucg_type_create_op()
for (; type < UCG_OP_TYPE_PREDEFINED_LAST; ++type) {
params.type = type;
ucg_status_t status = ucg_op_create(&params, &ucg_type_table.predefined_op[type]);
if (status != UCG_OK){
if (status != UCG_OK) {
goto err_destroy_op;
}
}
Expand Down Expand Up @@ -403,7 +403,7 @@ static int mca_coll_ucg_type_adapt_op(ompi_op_t *ompi_op,
params.user_func = mca_coll_ucg_op_reduce;
params.commutative = ompi_op_is_commute(ompi_op);
ucg_status_t status = ucg_op_init(&params, *ucg_op, UCG_OP_SIZE);
if (status != UCG_OK){
if (status != UCG_OK) {
UCG_ERROR("Failed to initialize ucg op: %d", status);
return OMPI_ERROR;
}
Expand Down
22 changes: 11 additions & 11 deletions ompi/mca/coll/ucg/coll_ucg_dt.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
* All rights reserved.
* All rights reserved.
* COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -16,21 +16,21 @@

typedef struct {
opal_free_list_t flist;
}mca_coll_ucg_conv_pool_t;

typedef struct mca_coll_ucg_convertor{
opal_free_list_item_t super;
ompi_datatype_t *datatype;
opal_convertor_t opal_conv;
size_t offset;
}mca_coll_ucg_convertor_t;
} mca_coll_ucg_conv_pool_t;

typedef struct mca_coll_ucg_convertor {
opal_free_list_item_t super;
ompi_datatype_t *datatype;
opal_convertor_t opal_conv;
size_t offset;
} mca_coll_ucg_convertor_t;
OBJ_CLASS_DECLARATION(mca_coll_ucg_convertor_t);

typedef struct mca_coll_ucg_type_table {
ucg_dt_h predefined_dt[UCG_DT_TYPE_PREDEFINED_LAST];
ucg_op_h predefined_op[UCG_OP_TYPE_PREDEFINED_LAST];
int attr_key;/*key of saving user-defined ucg dt */
}mca_coll_ucg_type_table_t;
int attr_key; /* key of saving user-defined ucg dt */
} mca_coll_ucg_type_table_t;

/* Initialize the convertor pool */
int mca_coll_ucg_conv_pool_init(void);
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/ucg/coll_ucg_gatherv.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
* All rights reserved.
* All rights reserved.
* COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
Loading