Skip to content

Commit

Permalink
Code style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tvegas1 committed May 16, 2024
1 parent 49307d1 commit ab41c10
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 31 deletions.
12 changes: 5 additions & 7 deletions include/ucx_uct_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
#ifndef NCCL_UCX_UCT_LIB_H_
#define NCCL_UCX_UCT_LIB_H_

#include <assert.h>
#include <stdint.h>
#include <unistd.h>
#include <assert.h>

#include "p2p_plugin.h"
#include "socket.h"

#include <uct/api/uct.h>


#define NCCL_UCX_UCT_MAX_RECVS NCCL_NET_IB_MAX_RECVS
#define NCCL_UCT_LISTEN_HANDLE_MAGIC 0x43cf19ed91abdb85
#define NCCL_UCT_REG_ALIGN 4096
Expand Down Expand Up @@ -182,7 +181,6 @@ typedef struct nccl_uct_context {
nccl_uct_worker_t *worker_list;
} nccl_uct_context_t;


#define UCXCHECK(statement, failure_action, message, ...) \
do { \
ucs_status_t _status = statement; \
Expand All @@ -196,8 +194,8 @@ typedef struct nccl_uct_context {
extern nccl_uct_context_t context;

/* Library functions */
ncclResult_t nccl_uct_iface_set_handler(nccl_uct_iface_t *uct_iface,
int id, uct_am_callback_t callback);
ncclResult_t nccl_uct_iface_set_handler(nccl_uct_iface_t *uct_iface, int id,
uct_am_callback_t callback);
ncclResult_t nccl_uct_devices(int *ndev);
ncclResult_t nccl_uct_comm_init(nccl_uct_comm_t *comm,
nccl_uct_context_t *context,
Expand All @@ -219,8 +217,8 @@ ncclResult_t nccl_uct_close_listen(void *listen_comm);
ncclResult_t nccl_uct_reg_mr_dmabuf(void *reg_comm, void *data, size_t size,
int type, uint64_t offset, int fd,
void **mhandle);
ncclResult_t nccl_uct_reg_mr(void *reg_comm, void *data, size_t size,
int type, void **mhandle);
ncclResult_t nccl_uct_reg_mr(void *reg_comm, void *data, size_t size, int type,
void **mhandle);
ncclResult_t nccl_uct_dereg_mr(void *dereg_comm, void *mhandle);

/* Compatibility callback */
Expand Down
36 changes: 14 additions & 22 deletions src/ucx_uct_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,7 @@ ncclResult_t nccl_uct_devices(int *ndev) {
return ncclSuccess;
}

ncclResult_t nccl_uct_listen(int dev, void *listen_handle,
void **listen_comm) {
ncclResult_t nccl_uct_listen(int dev, void *listen_handle, void **listen_comm) {
nccl_uct_listen_handle_t *handle = listen_handle;
nccl_uct_listen_comm_t *l_comm = calloc(1, sizeof(*l_comm));
nccl_uct_comm_t *accept_comm;
Expand Down Expand Up @@ -518,8 +517,7 @@ static ncclResult_t nccl_uct_comm_gpu_flush_init(nccl_uct_comm_t *comm) {
return ncclSystemError;
}

ncclResult_t nccl_uct_connect(int dev, void *listen_handle,
void **send_comm,
ncclResult_t nccl_uct_connect(int dev, void *listen_handle, void **send_comm,
ncclNetDeviceHandle_t **sendDevComm) {
int ready = 0;
nccl_uct_listen_handle_t *handle = listen_handle;
Expand Down Expand Up @@ -661,8 +659,8 @@ ncclResult_t nccl_uct_accept(void *listen_comm, void **recv_comm,
return ncclSuccess;
}

ncclResult_t nccl_uct_reg_mr(void *reg_comm, void *data, size_t size,
int type, void **mhandle) {
ncclResult_t nccl_uct_reg_mr(void *reg_comm, void *data, size_t size, int type,
void **mhandle) {
nccl_uct_comm_t *comm = reg_comm;
uct_component_h comp = comm->uct_iface->comp;
uct_md_h md = comm->uct_iface->md;
Expand Down Expand Up @@ -695,9 +693,8 @@ ncclResult_t nccl_uct_reg_mr(void *reg_comm, void *data, size_t size,
return ncclSuccess;
}

ncclResult_t nccl_uct_reg_mr_dmabuf(void *reg_comm, void *data,
size_t size, int type,
uint64_t offset, int fd,
ncclResult_t nccl_uct_reg_mr_dmabuf(void *reg_comm, void *data, size_t size,
int type, uint64_t offset, int fd,
void **mhandle) {
return nccl_uct_reg_mr(reg_comm, data, size, type, mhandle);
}
Expand All @@ -720,8 +717,7 @@ ncclResult_t nccl_uct_dereg_mr(void *dereg_comm, void *mhandle) {
return ncclSuccess;
}

int nccl_uct_flush_index(nccl_uct_comm_t *base, int *sizes, int n)
{
int nccl_uct_flush_index(nccl_uct_comm_t *base, int *sizes, int n) {
int last = -1;
int i;

Expand Down Expand Up @@ -751,8 +747,7 @@ ncclResult_t nccl_uct_flush(nccl_uct_comm_t *base_comm, void *data, int size,
assert(size >= iov.length);

status = uct_ep_get_zcopy(base_comm->gpu_flush.uct_ep->ep, &iov, 1,
(uint64_t)data, uct_memh->bundle.rkey,
completion);
(uint64_t)data, uct_memh->bundle.rkey, completion);
if (status != UCS_INPROGRESS) {
*request = NULL;
if (status != UCS_OK) {
Expand Down Expand Up @@ -799,9 +794,7 @@ void nccl_uct_comm_deinit(nccl_uct_comm_t *comm) {
nccl_uct_worker_put(comm->uct_worker);
}


ncclResult_t nccl_uct_get_properties(int dev,
ncclNetProperties_t *props) {
ncclResult_t nccl_uct_get_properties(int dev, ncclNetProperties_t *props) {
return nccl_p2p_ib_get_properties(ncclIbDevs, dev, props);
}

Expand All @@ -828,13 +821,13 @@ ncclResult_t nccl_uct_get_properties_v7(int dev,
return ncclSuccess;
}

ncclResult_t nccl_uct_reg_mr_v7(void *comm, void *data, int size,
int type, void **mhandle) {
ncclResult_t nccl_uct_reg_mr_v7(void *comm, void *data, int size, int type,
void **mhandle) {
return nccl_uct_reg_mr(comm, data, (size_t)size, type, mhandle);
}

ncclResult_t
nccl_uct_get_properties_v6(int dev, ncclNetProperties_v6_t *props_v6) {
ncclResult_t nccl_uct_get_properties_v6(int dev,
ncclNetProperties_v6_t *props_v6) {
ncclNetProperties_t props;
ncclResult_t ret = nccl_uct_get_properties(dev, &props);
if (ret != ncclSuccess) {
Expand All @@ -854,8 +847,7 @@ nccl_uct_get_properties_v6(int dev, ncclNetProperties_v6_t *props_v6) {
return ncclSuccess;
}

ncclResult_t nccl_uct_connect_v6(int dev, void *handle,
void **send_comm) {
ncclResult_t nccl_uct_connect_v6(int dev, void *handle, void **send_comm) {
ncclNetDeviceHandle_t *dev_handle = NULL;
return nccl_uct_connect(dev, handle, send_comm, &dev_handle);
}
Expand Down
3 changes: 1 addition & 2 deletions src/ucx_uct_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ static void nccl_uct_send_atp(nccl_uct_wr_comm_t *comm,
}

status = uct_ep_am_short(comm->base.uct_ep->ep, NCCL_UCT_AM_ATP,
(uint64_t)comm->base.remote.comm, &atp,
sizeof(atp));
(uint64_t)comm->base.remote.comm, &atp, sizeof(atp));
if (status == UCS_OK) {
rdesc->send_atp = 0;
}
Expand Down

0 comments on commit ab41c10

Please sign in to comment.