Add a makefile and logging functions

This commit is contained in:
Changho Hwang
2023-02-03 12:29:27 +00:00
parent 6f1cc9f896
commit 82fe0b667d
6 changed files with 208 additions and 1 deletions

20
src/include/debug.h Normal file
View File

@@ -0,0 +1,20 @@
#ifndef MSCCLPP_DEBUG_H_
#define MSCCLPP_DEBUG_H_
extern int mscclDebugLevel;
typedef enum {
MSCCLPP_LOG_NONE = 0,
MSCCLPP_LOG_INFO = 1,
MSCCLPP_LOG_DEBUG = 2,
MSCCLPP_LOG_ABORT = 3,
} mscclDebugLogLevel;
void mscclppDebugLog(mscclDebugLogLevel level, const char *filefunc, int line,
const char *fmt, ...);
#define INFO(...) mscclppDebugLog(MSCCLPP_LOG_INFO, __FILE__, __LINE__, __VA_ARGS__)
#define DEBUG(...) mscclppDebugLog(MSCCLPP_LOG_DEBUG, __FILE__, __LINE__, __VA_ARGS__)
#define ABORT(...) mscclppDebugLog(MSCCLPP_LOG_ABORT, __FILE__, __LINE__, __VA_ARGS__)
#endif // MSCCLPP_DEBUG_H_

View File

@@ -1,3 +1,6 @@
#ifndef MSCCLPP_H_
#define MSCCLPP_H_
#define MSCCLPP_MAJOR 0
#define MSCCLPP_MINOR 1
@@ -15,4 +18,6 @@ typedef enum { mscclppSuccess = 0,
mscclppResult_t mscclppGetUniqueId(mscclppUniqueId* uniqueId);
//mscclppResult_t mscclppCommInitRank(mscclppComm_t* comm, int nranks, mscclppUniqueId commId, int rank);
//mscclppResult_t mscclppCommDestroy(mscclppComm_t comm);
//mscclppResult_t mscclppCommDestroy(mscclppComm_t comm);
#endif // MSCCLPP_H_