Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Adding additional SMP information into header information #12947

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions kratos/sources/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// Kratos default license: kratos/license.txt
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: Pooyan Dadvand
//
Expand Down Expand Up @@ -204,33 +204,39 @@ void Kernel::SetPythonVersion(std::string pyVersion) {

void Kernel::PrintParallelismSupportInfo() const
{
#ifdef KRATOS_SMP_NONE
#ifdef KRATOS_SMP_NONE
constexpr bool threading_support = false;
#else
constexpr auto smp = "None";
#else
constexpr bool threading_support = true;
std::string scheduling_str;
#if defined(KRATOS_SMP_OPENMP)
const auto smp = "OpenMP";
#elif defined(KRATOS_SMP_CXX11)
constexpr auto smp = "C++11";
#else
constexpr auto smp = "Unknown";
#endif
#endif

#ifdef KRATOS_USING_MPI
#ifdef KRATOS_USING_MPI
constexpr bool mpi_support = true;
#else
#else
constexpr bool mpi_support = false;
#endif
#endif

Logger logger("");
logger << LoggerMessage::Severity::INFO;

if (threading_support) {
if (mpi_support) {
logger << "Compiled with threading and MPI support." << std::endl;
logger << "Compiled with threading and MPI support. Threading support with " << smp << "." << std::endl;
} else {
logger << "Compiled with threading support. Threading support with " << smp << "." << std::endl;
}
else {
logger << "Compiled with threading support." << std::endl;
}
}
else if (mpi_support) {
} else if (mpi_support) {
logger << "Compiled with MPI support." << std::endl;
}
else {
} else {
logger << "Serial compilation." << std::endl;
}

Expand All @@ -242,8 +248,7 @@ void Kernel::PrintParallelismSupportInfo() const
if (mIsDistributedRun) {
const DataCommunicator& r_world = ParallelEnvironment::GetDataCommunicator("World");
logger << "MPI world size: " << r_world.Size() << "." << std::endl;
}
else {
} else {
logger << "Running without MPI." << std::endl;
}
}
Expand Down
Loading