/usr/local/lib64/python3.6/site-packages/torch/include/c10d
NameSizeModeActions
comm.hpp41840644editdlrm
default_comm_hooks.hpp14790644editdlrm
FileStore.hpp14030644editdlrm
frontend.hpp92520644editdlrm
frontend_cuda.hpp1420644editdlrm
GlooDeviceFactory.hpp7710644editdlrm
HashStore.hpp11310644editdlrm
logger.hpp39810644editdlrm
NCCLUtils.hpp80460644editdlrm
ParamCommsUtils.hpp18140644editdlrm
PrefixStore.hpp14040644editdlrm
ProcessGroup.hpp124350644editdlrm
ProcessGroupGloo.hpp133950644editdlrm
ProcessGroupMPI.hpp88240644editdlrm
ProcessGroupNCCL.hpp220410644editdlrm
ProcessGroupRoundRobin.hpp39920644editdlrm
ProcessGroupWrapper.hpp49710644editdlrm
reducer.hpp261210644editdlrm
sequence_num.hpp16830644editdlrm
Store.hpp25890644editdlrm
TCPStore.hpp32130644editdlrm
Types.hpp13700644editdlrm
UnixSockUtils.hpp28400644editdlrm
Utils.hpp216010644editdlrm
WinSockUtils.hpp27010644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/c10d/WinSockUtils.hpp (2701B)
#pragma once #include namespace c10d { namespace tcputil { #define AF_SELECTED AF_INET #define CONNECT_SOCKET_OFFSET 1 inline void closeSocket(int socket) { ::closesocket(socket); } inline int setSocketAddrReUse(int socket) { bool optval = false; return ::setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (char *)&optval, sizeof(bool)); } inline int poll(struct pollfd *fdArray, unsigned long fds, int timeout) { return WSAPoll(fdArray, fds, timeout); } inline void addPollfd(std::vector &fds, int socket, short events) { fds.push_back({(SOCKET)socket, events}); } inline void waitSocketConnected( int socket, struct ::addrinfo *nextAddr, std::chrono::milliseconds timeout, std::chrono::time_point startTime) { unsigned long block_mode = 1; SYSCHECK_ERR_RETURN_NEG1(ioctlsocket(socket, FIONBIO, &block_mode)); int ret; do { ret = connect(socket, nextAddr->ai_addr, nextAddr->ai_addrlen); if (ret == SOCKET_ERROR) { int err = WSAGetLastError(); if (err == WSAEISCONN) { break; } else if (err == WSAEALREADY || err == WSAEWOULDBLOCK) { if (timeout != kNoTimeout) { const auto elapsed = std::chrono::high_resolution_clock::now() - startTime; if (elapsed > timeout) { errno = 0; TORCH_CHECK( false, c10::str( kConnectTimeoutMsg, " Original timeout was ", timeout.count(), " ms.")); } } std::this_thread::sleep_for(std::chrono::milliseconds(10)); continue; } throw std::system_error(err, std::system_category(), "Socket connect failed"); } } while (ret == SOCKET_ERROR); block_mode = 0; SYSCHECK_ERR_RETURN_NEG1(ioctlsocket(socket, FIONBIO, &block_mode)); } // All processes (applications or DLLs) that call Winsock // functions must initialize the use of the Windows Sockets // DLL before making other Winsock function calls. // This also makes certain that Winsock is supported on the system. // Ref to // https://docs.microsoft.com/en-us/windows/win32/winsock/initializing-winsock inline void socketInitialize() { static std::once_flag init_flag; std::call_once(init_flag, []() { WSADATA wsa_data; SYSCHECK_ERR_RETURN_NEG1(WSAStartup(MAKEWORD(2, 2), &wsa_data)) }); } inline struct ::pollfd getPollfd(int socket, short events) { struct ::pollfd res = {(SOCKET)socket, events}; return res; } } // namespace tcputil } // namespace c10d