From e84290b9a27fb248a10913cf8e7deb9a900f5235 Mon Sep 17 00:00:00 2001 From: Kevin Huck Date: Tue, 9 Aug 2022 14:29:54 -0700 Subject: [PATCH] Adding banner at program start to confirm things are working. --- CMakeLists.txt | 4 +++- src/apex/apex.cpp | 12 ++++++++++++ src/apex/banner.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/apex/banner.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 25ddb619..37358287 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") set(APEX_BUILD_EXAMPLES TRUE) endif(NOT DEFINED APEX_BUILD_EXAMPLES) add_definitions(-DDEBUG) - #add_definitions(-DAPEX_DEBUG) + add_definitions(-DCMAKE_BUILD_TYPE=3) endif() IF("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") @@ -97,6 +97,7 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") set(APEX_BUILD_EXAMPLES TRUE) endif(NOT DEFINED APEX_BUILD_EXAMPLES) add_definitions(-DNDEBUG) + add_definitions(-DCMAKE_BUILD_TYPE=2) endif() IF("${CMAKE_BUILD_TYPE}" STREQUAL "Release") @@ -108,6 +109,7 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "Release") if(NOT DEFINED APEX_BUILD_EXAMPLES) set(APEX_BUILD_EXAMPLES FALSE) endif(NOT DEFINED APEX_BUILD_EXAMPLES) + add_definitions(-DCMAKE_BUILD_TYPE=1) endif() if(APEX_WITH_CUDA) diff --git a/src/apex/apex.cpp b/src/apex/apex.cpp index e90a438d..7b03cf78 100644 --- a/src/apex/apex.cpp +++ b/src/apex/apex.cpp @@ -84,6 +84,7 @@ DEFINE_DESTRUCTOR(apex_finalize_static_void) #ifdef APEX_HAVE_TCMALLOC #include "tcmalloc_hooks.hpp" #endif +#include "banner.hpp" #if APEX_DEBUG #define FUNCTION_ENTER printf("enter %lu *** %s:%d!\n", \ @@ -236,6 +237,13 @@ void apex::_initialize() tmp << "-" << GIT_BRANCH ; #endif tmp << std::endl << "Built on: " << __TIME__ << " " << __DATE__; +#if CMAKE_BUILD_TYPE == 1 + tmp << " (Release)"; +#elif CMAKE_BUILD_TYPE == 2 + tmp << " (RelWithDebInfo)"; +#else + tmp << " (Debug)"; +#endif tmp << std::endl << "C++ Language Standard version : " << __cplusplus; #if defined(__clang__) /* Clang/LLVM. ---------------------------------------------- */ @@ -524,6 +532,10 @@ uint64_t init(const char * thread_name, uint64_t comm_rank, if (preload != nullptr) { unsetenv("LD_PRELOAD"); } + if (comm_rank == 0) { + std::cout << banner << std::endl; + std::cout << version() << std::endl; + } FUNCTION_EXIT return APEX_NOERROR; } diff --git a/src/apex/banner.hpp b/src/apex/banner.hpp new file mode 100644 index 00000000..1c0018e7 --- /dev/null +++ b/src/apex/banner.hpp @@ -0,0 +1,38 @@ +/* From https://patorjk.com/software/taag/ */ + +const char * banner_fire = R"( ( ) + ( )\ ) ( /( + )\ (()/( ( )\()) +((((_)( /(_)))\ ((_)\ + )\ _ )\ (_)) ((_) __((_) + (_)_\(_)| _ \| __|\ \/ / + / _ \ | _/| _| > < + /_/ \_\ |_| |___|/_/\_\ +)"; + +const char * banner_doom = R"( ___ ______ _______ __ + / _ \ | ___ \ ___\ \ / / +/ /_\ \| |_/ / |__ \ V / +| _ || __/| __| / \ +| | | || | | |___/ /^\ \ +\_| |_/\_| \____/\/ \/ +)"; + +const char * banner_bloody = R"( ▄▄▄ ██▓███ ▓█████ ▒██ ██▒ +▒████▄ ▓██░ ██▒▓█ ▀ ▒▒ █ █ ▒░ +▒██ ▀█▄ ▓██░ ██▓▒▒███ ░░ █ ░ +░██▄▄▄▄██ ▒██▄█▓▒ ▒▒▓█ ▄ ░ █ █ ▒ + ▓█ ▓██▒▒██▒ ░ ░░▒████▒▒██▒ ▒██▒ + ▒▒ ▓▒█░▒▓▒░ ░ ░░░ ▒░ ░▒▒ ░ ░▓ ░ + ▒ ▒▒ ░░▒ ░ ░ ░ ░░░ ░▒ ░ + ░ ▒ ░░ ░ ░ ░ + ░ ░ ░ ░ ░ ░ +)"; + +#if CMAKE_BUILD_TYPE == 1 +#define banner banner_fire +#elif CMAKE_BUILD_TYPE == 2 +#define banner banner_doom +#else // == 3 +#define banner banner_bloody +#endif