Stop TaskManager console message

Hi everyone,

is there any way I can stop the printing of the message task-based parallelization (C++11 threads) using xx threads to the console whenever TaskManager() gets called? Unfortunately, changing ngsglobals.msg_level does not help.

Best wishes,

I thought that line is helpful…
But if you build ngsolve from source, you may simply comment out the line
78: std::cout << "task-based parallelization (C++11 threads) using “<< task_manager->GetNumThreads() << " threads” << std::endl;
in taskmanager.cpp in the source code and recompile.

Hi Guosheng,

thank you for the hint :slight_smile: ! The line you suggested looked slightly different in the sources I have, but from that point I now found a way from the python end:

from pyngcore import SetLoggingLevel, LOG_LEVEL

Because I call the TaskManager only where its needed (twice in every iteration of my time loop), my own output is drowned in the console by this message.

Best wishes,

Hi Henry and Guosheng,

Thank you all for the investigation. I changed the code in NGSolve such that

ngsglobals.msg_level = level

also sets the logging level in ngcore accordingly, see commit

Setting the level to 3 or below mutes the message of the TaskManager.

I also issued a nightly build with this version which is already online.