Skip to content

Commit

Permalink
fix - make all comments C format
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Gromadzki <[email protected]>
  • Loading branch information
grom72 committed Dec 13, 2022
1 parent afb3869 commit 08d9e18
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 51 deletions.
24 changes: 11 additions & 13 deletions prov/sharp/src/sharp.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,16 @@
#include <rdma/fi_endpoint.h>
#include <rdma/fi_eq.h>
#include <rdma/fi_errno.h>
//#include <rdma/fi_rma.h>
//#include <rdma/fi_tagged.h>
//#include <rdma/fi_trigger.h>
#include <rdma/providers/fi_prov.h>
#include <rdma/fi_ext.h>

#include <ofi.h>
#include <ofi_enosys.h>
#include <ofi_sharp.h>
//#include <ofi_rbuf.h>
#include <ofi_list.h>
#include <ofi_signal.h>
//#include <ofi_epoll.h>
#include <ofi_util.h>
//#include <ofi_atomic.h>
//#include <ofi_iov.h>
#include <ofi_mr.h>
//#include <ofi_lock.h>

#ifndef _SHARP_H_
#define _SHARP_H_
Expand All @@ -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
Expand All @@ -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;
};

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion prov/sharp/src/sharp_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions prov/sharp/src/sharp_coll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion prov/sharp/src/sharp_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
47 changes: 30 additions & 17 deletions prov/sharp/src/sharp_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions prov/sharp/src/sharp_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 5 additions & 2 deletions prov/sharp/src/sharp_fabric.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion prov/sharp/src/sharp_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 0 additions & 12 deletions prov/sharp/src/sharp_progress.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 08d9e18

Please sign in to comment.