2018-09-24 16:06:59 -07:00
|
|
|
/*************************************************************************
|
|
|
|
|
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* See LICENSE.txt for license information
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef NCCL_INT_NET_H_
|
|
|
|
|
#define NCCL_INT_NET_H_
|
|
|
|
|
|
|
|
|
|
#include "nccl.h"
|
|
|
|
|
#include "nccl_net.h"
|
|
|
|
|
|
2018-11-13 10:37:20 -08:00
|
|
|
extern ncclNet_t* ncclNet;
|
2018-09-24 16:06:59 -07:00
|
|
|
typedef char ncclNetHandle_t[NCCL_NET_HANDLE_MAXSIZE];
|
|
|
|
|
|
|
|
|
|
/* Socket Interface Selection type */
|
|
|
|
|
typedef enum { findSubnetIf = -1,
|
|
|
|
|
dontCareIf = -2
|
|
|
|
|
} ncclSocketIfSl_t;
|
|
|
|
|
|
|
|
|
|
// Translation to external API
|
|
|
|
|
static const char* ncclNetName() { return ncclNet->name; }
|
2018-11-13 10:37:20 -08:00
|
|
|
static ncclResult_t ncclNetDevices(int* ndev) { NCCLCHECK(ncclNet->devices(ndev)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetPciPath(int dev, char** path) { NCCLCHECK(ncclNet->pciPath(dev, path)); return ncclSuccess; }
|
2018-09-24 16:06:59 -07:00
|
|
|
static ncclResult_t ncclNetPtrSupport(int dev, int* supportedTypes) { NCCLCHECK(ncclNet->ptrSupport(dev, supportedTypes)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetListen(int dev, void* handle, void** listenComm) { NCCLCHECK(ncclNet->listen(dev, handle, listenComm)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetConnect(int dev, void* handle, void** sendComm) { NCCLCHECK(ncclNet->connect(dev, handle, sendComm)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetAccept(void* listenComm, void** recvComm) { NCCLCHECK(ncclNet->accept(listenComm, recvComm)); return ncclSuccess; }
|
2018-12-13 15:56:12 -08:00
|
|
|
static ncclResult_t ncclNetRegMr(void* comm, void* data, int size, int type, void** mhandle) { NCCLCHECK(ncclNet->regMr(comm, data, size, type, mhandle)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetDeregMr(void* comm, void* mhandle) { NCCLCHECK(ncclNet->deregMr(comm, mhandle)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetIsend(void* sendComm, void* data, int size, void* mhandle, void** request) { NCCLCHECK(ncclNet->isend(sendComm, data, size, mhandle, request)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetIrecv(void* recvComm, void* data, int size, void* mhandle, void** request) { NCCLCHECK(ncclNet->irecv(recvComm, data, size, mhandle, request)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetFlush(void* recvComm, void* data, int size, void* mhandle) { NCCLCHECK(ncclNet->flush(recvComm, data, size, mhandle)); return ncclSuccess; }
|
2018-09-24 16:06:59 -07:00
|
|
|
static ncclResult_t ncclNetTest(void* request, int* done, int* size) { NCCLCHECK(ncclNet->test(request, done, size)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetCloseSend(void* sendComm) { NCCLCHECK(ncclNet->closeSend(sendComm)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetCloseRecv(void* recvComm) { NCCLCHECK(ncclNet->closeRecv(recvComm)); return ncclSuccess; }
|
|
|
|
|
static ncclResult_t ncclNetCloseListen(void* listenComm) { NCCLCHECK(ncclNet->closeListen(listenComm)); return ncclSuccess; }
|
|
|
|
|
|
|
|
|
|
extern ncclResult_t ncclSocketCreateHandle(void* opaqueHandle, const char* str);
|
|
|
|
|
extern ncclNet_t ncclNetIb;
|
|
|
|
|
extern ncclNet_t ncclNetSocket;
|
|
|
|
|
|
|
|
|
|
#endif
|