From e666782026874f91cc8d5dc2ddf0f151661baaa1 Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Tue, 13 Dec 2022 15:58:17 +0100 Subject: [PATCH] fix - make all comments C format Signed-off-by: Tomasz Gromadzki --- prov/sharp/src/sharp.h | 24 ++++++++--------- prov/sharp/src/sharp_attr.c | 2 +- prov/sharp/src/sharp_coll.c | 4 +-- prov/sharp/src/sharp_cq.c | 2 +- prov/sharp/src/sharp_domain.c | 47 +++++++++++++++++++++------------ prov/sharp/src/sharp_ep.c | 4 +-- prov/sharp/src/sharp_fabric.c | 7 +++-- prov/sharp/src/sharp_init.c | 4 ++- prov/sharp/src/sharp_progress.c | 12 --------- 9 files changed, 55 insertions(+), 51 deletions(-) diff --git a/prov/sharp/src/sharp.h b/prov/sharp/src/sharp.h index 5fdb722b3dd..55c00d389a3 100644 --- a/prov/sharp/src/sharp.h +++ b/prov/sharp/src/sharp.h @@ -49,24 +49,16 @@ #include #include #include -//#include -//#include -//#include #include #include #include #include #include -//#include #include #include -//#include #include -//#include -//#include #include -//#include #define SHARP_IOV_LIMIT 1 #define SHARP_TX_OP_FLAGS (0) @@ -84,7 +76,9 @@ struct sharp_env { extern struct sharp_env sharp_env; -/// XXX temporary solution +/* +XXX temporary solution +*/ #ifdef sharp_coll_context #define sharp_coll_context_t struct sharp_coll_context #else @@ -95,7 +89,7 @@ struct sharp_domain { struct util_domain util_domain; struct fid_domain *peer_domain; sharp_coll_context_t *sharp_context; - ofi_atomic32_t ref; // mr count + ofi_atomic32_t ref; /* mr count XXX - to be handled in mr create and del */ ofi_spin_t lock; }; @@ -119,17 +113,21 @@ struct sharp_ep { struct fid_ep *peer_ep; struct fi_info *peer_info; - ofi_atomic32_t ref; // mc count + ofi_atomic32_t ref; /* mc count XXX to be added to mc handling*/ ofi_spin_t lock; }; -// XXX to be reused from coll provider +/* +XXX to be reused from coll provider +*/ struct sharp_av { struct util_av util_av; struct fid_peer_av *peer_av; }; -/// XXX temporary solution +/* +XXX temporary solution +*/ #ifdef sharp_coll_comm #define sharp_coll_comm_t struct sharp_coll_comm #else diff --git a/prov/sharp/src/sharp_attr.c b/prov/sharp/src/sharp_attr.c index a379f894160..03997f55c81 100644 --- a/prov/sharp/src/sharp_attr.c +++ b/prov/sharp/src/sharp_attr.c @@ -77,7 +77,7 @@ struct fi_domain_attr sharp_domain_attr = { .resource_mgmt = FI_RM_ENABLED, .av_type = FI_AV_UNSPEC, .mr_mode = 0, - .mr_key_size = sizeof_field(struct fi_rma_iov, key), //XXX + .mr_key_size = sizeof_field(struct fi_rma_iov, key), /* XXX */ .cq_data_size = sizeof_field(struct ofi_op_hdr, data), .cq_cnt = 1024, .ep_cnt = 1, diff --git a/prov/sharp/src/sharp_coll.c b/prov/sharp/src/sharp_coll.c index 468cea3cb38..5bfad0018e6 100644 --- a/prov/sharp/src/sharp_coll.c +++ b/prov/sharp/src/sharp_coll.c @@ -46,9 +46,9 @@ int sharp_query_collective(struct fid_domain *domain, switch (coll) { case FI_BARRIER: - return FI_SUCCESS; //XXX to be integrated w/ sharp_query + return FI_SUCCESS; /* XXX to be integrated w/ sharp_query */ case FI_ALLREDUCE: - return FI_SUCCESS; //XXX to be integrated w/ sharp_query + return FI_SUCCESS; /* XXX to be integrated w/ sharp_query */ case FI_ALLGATHER: case FI_SCATTER: case FI_BROADCAST: diff --git a/prov/sharp/src/sharp_cq.c b/prov/sharp/src/sharp_cq.c index 2eeebb51706..120c5d208df 100644 --- a/prov/sharp/src/sharp_cq.c +++ b/prov/sharp/src/sharp_cq.c @@ -31,7 +31,7 @@ */ #include "sharp.h" -#include "ofi_coll.h" //for coll_cq_init +#include "ofi_coll.h" /* for coll_cq_init */ static int sharp_cq_close(struct fid *fid) diff --git a/prov/sharp/src/sharp_domain.c b/prov/sharp/src/sharp_domain.c index 76a66779fa5..d470577e53d 100644 --- a/prov/sharp/src/sharp_domain.c +++ b/prov/sharp/src/sharp_domain.c @@ -35,22 +35,21 @@ #include "sharp.h" -#include "../../coll/src/coll.h" //for coll_av_open +#include "../../coll/src/coll.h" /* for coll_av_open */ struct sharp_mr { struct fid_mr mr_fid; - void *mr_handle; //obtained from sharp_coll_reg_mr - // alternatively mr_fid.mem_desc stores result of sharp_coll_reg_mr + void *mr_handle; /* obtained from sharp_coll_reg_mr */ struct sharp_domain *domain; }; static int sharp_mr_close(fid_t fid) { #if 0 +/* XXX to be replaced with SHARP implementation */ struct fid_mr mr_fid; struct sharp_mr *sharp_mr = container_of(fid, struct sharp_mr, mr_fid.fid); #endif -// XXX return 0; } static struct fi_ops sharp_mr_fi_ops = { @@ -77,8 +76,10 @@ static int sharp_mr_reg(struct fid *fid, const void *buf, size_t len, return -FI_ENOMEM; void *sharp_coll_mr = NULL; - // maped to sharp_coll_reg_mr - // Only one outstanding registration supported. no registration cache. + /* + XXX to be maped to sharp_coll_reg_mr + Only one outstanding registration supported. no registration cache. + */ sharp_mr->mr_fid.fid.fclass = FI_CLASS_MR; sharp_mr->mr_fid.fid.context = context; @@ -87,7 +88,9 @@ static int sharp_mr_reg(struct fid *fid, const void *buf, size_t len, sharp_mr->mr_fid.key = FI_KEY_NOTAVAIL; *mr = &sharp_mr->mr_fid; - // XXX do we need to track mrs inside domain + /* + XXX do we need to track mrs inside domain + */ return 0; } @@ -115,17 +118,23 @@ static struct fi_ops_domain sharp_domain_ops = { static int sharp_domain_close(fid_t fid) { - int ret; struct sharp_domain *domain; + const struct fi_provider *prov; + int ret; - domain = container_of(fid, struct sharp_domain, util_domain.domain_fid.fid); - /// mapped to int sharp_coll_finalize(struct sharp_coll_context *context); + domain = container_of(fid, struct sharp_domain, + util_domain.domain_fid.fid); + prov = domain->util_domain.fabric->prov; + /* + XXX to be mapped to: + int sharp_coll_finalize(struct sharp_coll_context *context); + */ ret = ofi_domain_close(&domain->util_domain); - if (ret) - return ret; free(domain); - return 0; + if (ret) + FI_WARN(prov, FI_LOG_DOMAIN, "Unable to close domain\n"); + return ret; } static struct fi_ops sharp_domain_fi_ops = { @@ -187,19 +196,23 @@ int sharp_domain2(struct fid_fabric *fabric, struct fi_info *info, domain->util_domain.threading = FI_THREAD_UNSPEC; #if 0 - // XXX + /* + XXX *domain_fid = &domain->util_domain.domain_fid; (*domain_fid)->fid.ops = &sharp_domain_fi_ops; (*domain_fid)->ops = &sharp_domain_ops; (*domain_fid)->mr = &sharp_domain_mr_ops; + */ #endif fid_domain_init(domain_fid, &domain->util_domain, &sharp_domain_fi_ops, &sharp_domain_ops, &sharp_domain_mr_ops); -// XXX maped to -// int sharp_coll_init(struct sharp_coll_init_spec *sharp_coll_spec, -// struct sharp_coll_context **sharp_coll_context); +/* +XXX maped to +int sharp_coll_init(struct sharp_coll_init_spec *sharp_coll_spec, + struct sharp_coll_context **sharp_coll_context); +*/ #if 0 struct sharp_coll_init_spec { uint64_t job_id; /**< Job unique ID */ diff --git a/prov/sharp/src/sharp_ep.c b/prov/sharp/src/sharp_ep.c index 51476d58bc4..346d5b3f2e8 100644 --- a/prov/sharp/src/sharp_ep.c +++ b/prov/sharp/src/sharp_ep.c @@ -67,7 +67,7 @@ static struct fi_ops_cm sharp_ep_cm_ops = { .setname = fi_no_setname, .getname = sharp_getname, .getpeer = fi_no_getpeer, - .connect = fi_no_connect, //XXX + .connect = fi_no_connect, /* XXX */ .listen = fi_no_listen, .accept = fi_no_accept, .reject = fi_no_reject, @@ -137,7 +137,7 @@ static struct fi_ops_collective sharp_ep_collective_ops = { }; static struct fi_ops_ep sharp_ep_ops = { .size = sizeof(struct fi_ops_ep), - .cancel = fi_no_cancel, //XXX + .cancel = fi_no_cancel, /* XXX */ .getopt = fi_no_getopt, .setopt = fi_no_setopt, .tx_ctx = fi_no_tx_ctx, diff --git a/prov/sharp/src/sharp_fabric.c b/prov/sharp/src/sharp_fabric.c index 99c4e6e3a5d..996d0be4a25 100644 --- a/prov/sharp/src/sharp_fabric.c +++ b/prov/sharp/src/sharp_fabric.c @@ -68,7 +68,9 @@ static struct fi_ops sharp_fabric_fi_ops = { .ops_open = fi_no_ops_open, }; -/// XXX to be added to fabric.h later +/* +XXX to be added to fabric.h later +*/ static inline void fid_fabric_init(struct fid_fabric **fabric_fid, struct util_fabric *util_fabric, struct fi_ops *fid_ops, @@ -95,7 +97,8 @@ int sharp_fabric(struct fi_fabric_attr *attr, struct fid_fabric **fabric_fid, goto err; #if 0 - *fabric_fid = &fabric->util_fabric.fabric_fid; ///XXX to be removed later + /* XXX to be removed later */ + *fabric_fid = &fabric->util_fabric.fabric_fid; (*fabric_fid)->fid.ops = &sharp_fabric_fi_ops; (*fabric_fid)->ops = &sharp_fabric_ops; #endif diff --git a/prov/sharp/src/sharp_init.c b/prov/sharp/src/sharp_init.c index 17d0fbce690..523719eda7c 100644 --- a/prov/sharp/src/sharp_init.c +++ b/prov/sharp/src/sharp_init.c @@ -74,7 +74,9 @@ struct fi_provider sharp_prov = { .cleanup = sharp_fini }; -/// @brief XXX to be moved to sharp_attr.c +/* +XXX to be moved to sharp_attr.c +*/ struct util_prov sharp_util_prov = { .prov = &sharp_prov, .info = &sharp_info, diff --git a/prov/sharp/src/sharp_progress.c b/prov/sharp/src/sharp_progress.c index 46d849fbef9..1a54550b014 100644 --- a/prov/sharp/src/sharp_progress.c +++ b/prov/sharp/src/sharp_progress.c @@ -39,15 +39,3 @@ #include "ofi_atom.h" #include "ofi_mr.h" #include "sharp.h" -#if 0 -/// @brief to be moved to sharp_coll.c XXX -/// @param util_ep -void sharp_ep_progress(struct util_ep *util_ep) -{ -#if 0 - struct sharp_ep *ep; - - ep = container_of(util_ep, struct sharp_ep, util_ep); -#endif -} -#endif \ No newline at end of file