Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ UseTab: Never
AllowShortFunctionsOnASingleLine: Empty
IndentPPDirectives: AfterHash
SortIncludes: true
IncludeCategories:
- Regex: '^<gtest/.*\.h>'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*\.h>'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 4
SortPriority: 0
CaseSensitive: false
FixNamespaceComments: true
InsertBraces: true
QualifierAlignment: Left
Expand Down
2 changes: 2 additions & 0 deletions modules/runners/src/runners.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "runners/include/runners.hpp"

#include <gtest/gtest.h>

#include <mpi.h>

#include <chrono>
Expand Down Expand Up @@ -140,6 +141,7 @@ int RunAllTestsSafely() {
} // namespace

int Init(int argc, char **argv) {
ppc::util::ConfigureMpiEnvironment();
const int init_res = MPI_Init(&argc, &argv);
if (init_res != MPI_SUCCESS) {
std::cerr << std::format("[ ERROR ] MPI_Init failed with code {}", init_res) << '\n';
Expand Down
1 change: 1 addition & 0 deletions modules/util/include/func_test_util.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <gtest/gtest.h>

#include <tbb/tick_count.h>

#include <concepts>
Expand Down
3 changes: 2 additions & 1 deletion modules/util/include/perf_test_util.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#pragma once

#include <benchmark/benchmark.h>
#include <gtest/gtest.h>

#include <benchmark/benchmark.h>
#include <mpi.h>
#include <omp.h>
#include <tbb/tick_count.h>
Expand Down
1 change: 1 addition & 0 deletions modules/util/include/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ double GetTaskMaxTime();
double GetPerfMaxTime();
double GetTimeMPI();
int GetMPIRank();
void ConfigureMpiEnvironment();
void SynchronizeMpiRanks();

template <typename T>
Expand Down
9 changes: 9 additions & 0 deletions modules/util/src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ bool ppc::util::IsUnderMpirun() {
});
}

void ppc::util::ConfigureMpiEnvironment() {
#ifdef __APPLE__
// Open MPI 5 can emit mmap backing-file probe warnings for macOS TMPDIR paths.
if (!env::get<std::string>("OMPI_MCA_shmem").has_value()) {
env::detail::set_environment_variable("OMPI_MCA_shmem", "posix");
Comment thread
aobolensk marked this conversation as resolved.
}
#endif
}

void ppc::util::SynchronizeMpiRanks() {
int initialized = 0;
if (MPI_Initialized(&initialized) != MPI_SUCCESS || initialized == 0) {
Expand Down
4 changes: 3 additions & 1 deletion tasks/common/runners/performance.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <gtest/gtest.h>

#include <benchmark/benchmark.h>
#include <benchmark/reporter.h>
#include <gtest/gtest.h>
#include <mpi.h>

#include <chrono>
Expand Down Expand Up @@ -177,6 +178,7 @@ int SynchronizeStatus(int local_status, std::string_view stage) {
}

int RunPerformanceMain(int argc, char **argv) {
ppc::util::ConfigureMpiEnvironment();
const int init_res = MPI_Init(&argc, &argv);
if (init_res != MPI_SUCCESS) {
std::cerr << "[ ERROR ] MPI_Init failed with code " << init_res << '\n';
Expand Down
1 change: 1 addition & 0 deletions tasks/example/processes/t1/tests/functional/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <gtest/gtest.h>

#include <stb/stb_image.h>

#include <algorithm>
Expand Down
1 change: 1 addition & 0 deletions tasks/example/processes/t2/tests/functional/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <gtest/gtest.h>

#include <stb/stb_image.h>

#include <algorithm>
Expand Down
1 change: 1 addition & 0 deletions tasks/example/processes/t3/tests/functional/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <gtest/gtest.h>

#include <stb/stb_image.h>

#include <algorithm>
Expand Down
1 change: 1 addition & 0 deletions tasks/example/threads/tests/functional/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <gtest/gtest.h>

#include <stb/stb_image.h>

#include <algorithm>
Expand Down
Loading