Skip to content

Commit

Permalink
Adding banner at program start to confirm things are working.
Browse files Browse the repository at this point in the history
  • Loading branch information
khuck committed Aug 9, 2022
1 parent 684cef9 commit e84290b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions src/apex/apex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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", \
Expand Down Expand Up @@ -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. ---------------------------------------------- */
Expand Down Expand Up @@ -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;
}
Expand Down
38 changes: 38 additions & 0 deletions src/apex/banner.hpp
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e84290b

Please sign in to comment.