b221128eca
Add support for network collectives. Add support for XML topology dump/injection. Add text values for GDR and P2P Levels, including "NVL". Add speed detection for PCI, Infiniband and Ethernet cards. Add CPU detection for ARM and AMD CPUs. Add support for adaptive routing on Infiniband. Change NET plugin API to v3 : merge PCI path and GPU pointer capability into a single structure and add other properties.
44 строки
1.3 KiB
C++
44 строки
1.3 KiB
C++
/*************************************************************************
|
|
* Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* See LICENSE.txt for license information
|
|
************************************************************************/
|
|
|
|
#ifndef NCCL_DEBUG_H_
|
|
#define NCCL_DEBUG_H_
|
|
|
|
#include "core.h"
|
|
|
|
#include <stdio.h>
|
|
#include <chrono>
|
|
|
|
#include <sys/syscall.h>
|
|
#include <limits.h>
|
|
#include <string.h>
|
|
#include "nccl_net.h"
|
|
|
|
#define gettid() (pid_t) syscall(SYS_gettid)
|
|
|
|
extern int ncclDebugLevel;
|
|
extern uint64_t ncclDebugMask;
|
|
extern pthread_mutex_t ncclDebugOutputLock;
|
|
extern FILE *ncclDebugFile;
|
|
extern ncclResult_t getHostName(char* hostname, int maxlen, const char delim);
|
|
|
|
void ncclDebugLog(ncclDebugLogLevel level, unsigned long flags, const char *filefunc, int line, const char *fmt, ...);
|
|
|
|
// Let code temporarily downgrade WARN into INFO
|
|
extern thread_local int ncclDebugNoWarn;
|
|
|
|
#define WARN(...) ncclDebugLog(NCCL_LOG_WARN, NCCL_ALL, __FILE__, __LINE__, __VA_ARGS__)
|
|
#define INFO(FLAGS, ...) ncclDebugLog(NCCL_LOG_INFO, (FLAGS), __func__, __LINE__, __VA_ARGS__)
|
|
|
|
#ifdef ENABLE_TRACE
|
|
#define TRACE(FLAGS, ...) ncclDebugLog(NCCL_LOG_TRACE, (FLAGS), __func__, __LINE__, __VA_ARGS__)
|
|
extern std::chrono::high_resolution_clock::time_point ncclEpoch;
|
|
#else
|
|
#define TRACE(...)
|
|
#endif
|
|
|
|
#endif
|