12 #include <gitInfo.hpp> 14 #include <Threads.hpp> 15 #include <debug/Crash.hpp> 16 #include <ios/Logger.hpp> 17 #include <ios/MinimalLogger.hpp> 18 #include <ios/TextFormat.hpp> 19 #include <random/TrueRandomGenerator.hpp> 20 #include <system/Memory.hpp> 21 #include <system/Mpi.hpp> 22 #include <system/Timer.hpp> 23 #include <utility/Aliver.hpp> 24 #include <utility/SingleInstance.hpp> 63 (runLog()<<Crasher(path,line,funcName)).printVariadicMessage(format,ap);
69 void ThreadPool::fill(
const pthread_attr_t* attr)
74 runLog()<<
"Filling the thread pool with "<<nThreads<<
" threads";
81 pool.resize(nThreads,0);
87 for(
int threadId=1;threadId<nThreads;threadId++)
93 new ThreadPars{
this,threadId};
95 if(pthread_create(&pool[threadId],attr,threadPoolSwim,pars)!=0)
123 runLog()<<TextColor::BROWN<<
" ▄▄ ▄█▄ ▄▄ \t"<<TextColor::PURPLE<<
" ▄█▄ ";
124 runLog()<<TextColor::BROWN<<
" █░█ █░█ █░█ \t"<<TextColor::PURPLE<<
" █░█ ";
125 runLog()<<TextColor::BROWN<<
" ▄▄ █░█ █░█ █░█ ▄▄ \t"<<TextColor::PURPLE<<
" █░█ ";
126 runLog()<<TextColor::BROWN<<
" █░█ █░█ █░█ █░█ █░█ \t"<<TextColor::PURPLE<<
" █░█ ";
127 runLog()<<TextColor::BROWN<<
" █░█ █░█ ███████ █░█ █░█ \t"<<TextColor::PURPLE<<
" ███████ ";
128 runLog()<<TextColor::BROWN<<
" █░█ █████░░░░░█████ █░█ \t"<<TextColor::PURPLE<<
" █████░█░█░█████ ";
129 runLog()<<TextColor::BROWN<<
" █░█ ██░░░░░░░░░░░░░██ █░█ \t"<<TextColor::PURPLE<<
" ██░░░░░█░█░░░░░██ ";
130 runLog()<<TextColor::BROWN<<
" █░██░░░░░░░░░░░░░░░░░██░█ \t"<<TextColor::PURPLE<<
" ██░░░░░░░█░█░░░░░░░██ ";
131 runLog()<<TextColor::BROWN<<
" ▄▄▄▄▄▄███████████░███████████▄▄▄▄▄▄ \t" <<TextColor::PURPLE<<
" ██░░░░░░░░█░█░░░░░░░░██ ";
132 runLog()<<TextColor::BROWN<<
" █░░░░░░█░████████░░░████████░█░░░░░░█ \t"<<TextColor::PURPLE<<
" █░░░░░░░░░█░█░░░░░░░░░█ ";
133 runLog()<<TextColor::BROWN<<
" ▀▀▀▀▀▀█░░░████░░░░░░░████░░░█▀▀▀▀▀▀ \t" <<TextColor::PURPLE<<
" █░░░░░░░░░█░█░░░░░░░░░█ ";
134 runLog()<<TextColor::BROWN<<
" ██░░░░░░░░░░░░░░░░░░░░█ \t"<<TextColor::PURPLE<<
" ██░░░░░░░░█░█░░░░░░░░░█ ";
135 runLog()<<TextColor::BROWN<<
" █░██░░░░░███████░░░░░░█░█ \t"<<TextColor::PURPLE<<
" ██░░░░░░░█░█░░░░░░░░█ ";
136 runLog()<<TextColor::BROWN<<
" █░█ █░░░░░░░░░░░░░░░██ █░█ \t"<<TextColor::PURPLE<<
" █░░░░░░█░█░░░░░░██ ";
137 runLog()<<TextColor::BROWN<<
" █░█ ██░░░░░░░░░░░██ █░█ \t"<<TextColor::PURPLE<<
" ██░░░░█░█░░░░██ ";
138 runLog()<<TextColor::BROWN<<
" █░█ █░███████████░█ █░█ \t"<<TextColor::PURPLE<<
" ███████████ ";
139 runLog()<<TextColor::BROWN<<
" █░█ █░█ █░█ █░█ █░█ \t"<<TextColor::PURPLE<<
" █░█ ";
140 runLog()<<TextColor::BROWN<<
" ▀▀ █░█ █░█ █░█ ▀▀ \t" <<TextColor::PURPLE<<
" █░█ ";
141 runLog()<<TextColor::BROWN<<
" █░█ █░█ █░█ \t" <<TextColor::PURPLE<<
" █░█ ";
142 runLog()<<TextColor::BROWN<<
" █░█ █░█ █░█ \t" <<TextColor::PURPLE<<
" █░█ ";
143 runLog()<<TextColor::BROWN<<
" ▀▀ ▀█▀ ▀▀ \t" <<TextColor::PURPLE<<
" ▀█▀ ";
172 runLog()<<
"\n Ciao!\n";
185 threads.workOn([](
const int threadID){runLog()<<
"ANNA";});
191 threads.workOn([](
const int threadID){runLog()<<
"ANNA";});
204 Timer timings(
"Total time",Timer::NO_FATHER,Timer::UNSTOPPABLE);
218 TrueRandomGenerator trueRandomGenerator;
#define MINIMAL_CRASH(...)
Initialize the minimal crasher.
LoggerLine printVariadicMessage(const char *format, va_list ap)
Print a C-style variadic message.
void minimalCrash(const char *path, const int line, const char *funcName, const char *format,...)
static Logger fakeLogger
Fake logger, printing to /dev/null.
void printBailout() const
Says bye bye.
void minimalLogger(Logger &logger, const char *format,...)
void printVersionContacts() const
Prints the version, and contacts.
#define ALLOWS_ALL_THREADS_TO_PRINT_FOR_THIS_SCOPE(LOGGER)
Makes all thread print for current scope.
decltype(auto) father(Ts &&...ts)
Logger(const char *path, const bool &prependTime=true)
Create with a path.
void printBanner() const
Prints the banner.
#define MINIMAL_CRASH_STDLIBERR(STRING)
Minimal crash with stdlib error.
Class used to provocate initialization of Mpi.
constexpr int masterThreadId
Thread id of master thread.
Logger runLog("/dev/stdout")
Global logger.
#define PACKAGE_BUGREPORT
void printGitInfo() const
Prints the git info.
decltype(auto) file(Ts &&...ts)
void printConfigurePars() const
Prints configure info.
#define ALLOWS_ALL_RANKS_TO_PRINT_FOR_THIS_SCOPE(LOGGER)
Makes all thread print for current scope.
#define CONFIG_TIME
Null time.
#define CONFIG_FLAGS
Null flags.
Timer timings("Total time", Timer::NO_FATHER, Timer::UNSTOPPABLE)
Global timings.
void broadcast(T &&val, int root=MASTER_RANK) const
ThreadPool threads
Global thread pool.