Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
KRM7 committed Sep 8, 2023
1 parent 74c6516 commit 5ef1778
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 34 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
matrix:
build-type: [ Release, RelWithDebInfo ]
compiler: [
{ cxx: g++-11, pkgs: g++-11 libtbb-dev },
{ cxx: g++-12, pkgs: g++-12 libtbb-dev },
{ cxx: clang++-14, pkgs: clang-14 libtbb-dev },
{ cxx: clang++-15, pkgs: clang-15 libtbb-dev },
{ cxx: g++-11, pkgs: g++-11 libtbb-dev gdb },
{ cxx: g++-12, pkgs: g++-12 libtbb-dev gdb },
{ cxx: clang++-14, pkgs: clang-14 libtbb-dev gdb },
{ cxx: clang++-15, pkgs: clang-15 libtbb-dev gdb },
]

defaults:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
run: cmake --build . --parallel

- name: run-tests
run: ctest --output-on-failure --schedule-random
run: gdb -ex run ./unit_tests --args schedule-random

- name: install
run: sudo cmake --install .
2 changes: 1 addition & 1 deletion .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sanitizer: [ address, undefined ]
sanitizer: [ address, undefined, thread ]
include:
- cxx: clang++-15
pkgs: clang-15 llvm-15 libtbb-dev
Expand Down
14 changes: 1 addition & 13 deletions .tsan-supressions
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Suppress warnings from Intel TBB
# (libstdc++ uses TBB to implement the parallel std algorithms)

# clang
race:^tbb::detail::d1::node::node
race:^tbb::detail::d1::tree_node::tree_node

Expand All @@ -12,12 +8,4 @@ race:^tbb::detail::d1::auto_partition_type::is_divisible
race:tbb::detail::d1::small_object_allocator::new_object
race:tbb::detail::d1::small_object_allocator::delete_object

race:tbb::detail::d1::dynamic_grainsize_mode<*>::check_being_stolen

race:^tbb::detail::d1::start_for<*>::finalize

# This supression is just supposed to be the first one, but the function name isnt always displayed properly in the stack trace
race:^tbb::detail::d1::start_for<*>::offer_work
race:tbb::detail::d1::auto_partitioner const>::offer_work(tbb::detail::d0::split&, tbb::detail::d1::execution_data&)

race:^tbb::detail::r1::isolate_within_arena
race:tbb::detail::d1::dynamic_grainsize_mode<*>::check_being_stolen
4 changes: 2 additions & 2 deletions src/algorithm/nd_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ namespace gapp::algorithm::dtl
const size_t popsize = std::distance(first, last);
DominanceMatrix dmat(popsize, popsize /*, MAXIMAL */);

std::for_each(GAPP_EXEC_UNSEQ, detail::iota_iterator(0_sz), detail::iota_iterator(first->size()), [&](size_t obj)
std::for_each(GAPP_EXEC, detail::iota_iterator(0_sz), detail::iota_iterator(first->size()), [&](size_t obj)
{
FitnessVector fvec(popsize);
std::transform(first, last, fvec.begin(), detail::element_at(obj));
Expand All @@ -212,7 +212,7 @@ namespace gapp::algorithm::dtl
});
});

std::for_each(GAPP_EXEC_UNSEQ, detail::iota_iterator(0_sz), detail::iota_iterator(popsize), [&](size_t row) noexcept
std::for_each(GAPP_EXEC, detail::iota_iterator(0_sz), detail::iota_iterator(popsize), [&](size_t row) noexcept
{
dmat(row, row).store(NONMAXIMAL, std::memory_order_relaxed); // diagonal is all nonmax

Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/nsga3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ namespace gapp::algorithm

sol_info_.resize(last - first);

std::for_each(GAPP_EXEC_UNSEQ, pfirst, plast, [&](const FrontInfo& sol)
std::for_each(GAPP_EXEC, pfirst, plast, [&](const FrontInfo& sol)
{
const FitnessVector fnorm = normalizeFitnessVec(first[sol.idx], ideal_point_, nadir_point_);

Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/reference_lines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ namespace gapp::algorithm::reflines
min_distances.pop_back();

/* Calc the distance of each candidate to the closest ref point. */
std::transform(GAPP_EXEC_UNSEQ, candidate_points.begin(), candidate_points.end(), min_distances.begin(), min_distances.begin(),
std::transform(GAPP_EXEC, candidate_points.begin(), candidate_points.end(), min_distances.begin(), min_distances.begin(),
[&](const Point& candidate, double current_min) noexcept
{
const double dist = math::euclideanDistanceSq(candidate, points.back());
Expand Down
6 changes: 3 additions & 3 deletions src/core/ga_base.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ namespace gapp
/* Create and evaluate the initial population of the algorithm. */
num_objectives_ = findNumberOfObjectives();
population_ = generatePopulation(population_size_, std::move(initial_population));
std::for_each(GAPP_EXEC_UNSEQ, population_.begin(), population_.end(), [this](Candidate<T>& sol) { evaluate(sol); });
std::for_each(GAPP_EXEC, population_.begin(), population_.end(), [this](Candidate<T>& sol) { evaluate(sol); });
fitness_matrix_ = detail::toFitnessMatrix(population_);
if (keep_all_optimal_sols_) solutions_ = detail::findParetoFront(population_);

Expand Down Expand Up @@ -504,7 +504,7 @@ namespace gapp
std::vector<CandidatePair<T>> child_pairs(num_children / 2);

prepareSelections();
std::generate(GAPP_EXEC_UNSEQ, child_pairs.begin(), child_pairs.end(),
std::generate(GAPP_EXEC, child_pairs.begin(), child_pairs.end(),
[this]
{
const auto& parent1 = select();
Expand All @@ -518,7 +518,7 @@ namespace gapp
/* If the population size is odd, one too many child candidates were generated by the crossovers. */
if (children.size() > population_size_) children.pop_back();

std::for_each(GAPP_EXEC_UNSEQ, children.begin(), children.end(),
std::for_each(GAPP_EXEC, children.begin(), children.end(),
[this](Candidate<T>& child)
{
mutate(child);
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/pop_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ namespace gapp::detail
const FitnessMatrix front = uniqueSortedParetoFront(fmat);

std::atomic<double> hypervolume = 0.0;
std::for_each(GAPP_EXEC_UNSEQ, detail::iota_iterator(0_sz), detail::iota_iterator(front.size()), [&](size_t idx)
std::for_each(GAPP_EXEC, detail::iota_iterator(0_sz), detail::iota_iterator(front.size()), [&](size_t idx)
{
const auto point = front[idx];
const FitnessMatrix rest = { front.begin() + idx + 1, front.end() };
Expand Down
2 changes: 1 addition & 1 deletion src/population/population.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace gapp::detail
std::vector<Dominance> lhs_state(lhs.size());
std::vector<std::atomic<Dominance>> rhs_state(rhs.size());

std::for_each(GAPP_EXEC_UNSEQ, iota_iterator(0_sz), iota_iterator(lhs.size()), [&](size_t i) noexcept
std::for_each(GAPP_EXEC, iota_iterator(0_sz), iota_iterator(lhs.size()), [&](size_t i) noexcept
{
for (size_t j = 0; j < rhs.size(); j++)
{
Expand Down
8 changes: 2 additions & 6 deletions src/utility/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,8 @@
#endif


#ifndef GAPP_EXCUTION_UNSEQ
# define GAPP_EXEC_UNSEQ std::execution::par_unseq
#endif

#ifndef GAPP_EXEC_SEQ
# define GAPP_EXEC_SEQ std::execution::par
#ifndef GAPP_EXEC
# define GAPP_EXEC std::execution::par
#endif


Expand Down

0 comments on commit 5ef1778

Please sign in to comment.