Skip to content

Commit

Permalink
Fix Ubuntu-System-CI (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-bournes authored Feb 6, 2024
1 parent 465ba5a commit 5bd40af
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/unit/core/diffusion_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -974,8 +974,8 @@ TEST(DiffusionTest, EulerDirichletBoundaries) {
double simulation_time_step{0.1};
auto set_param = [](auto* param) {
param->bound_space = Param::BoundSpaceMode::kClosed;
param->min_bound = -100;
param->max_bound = 100;
param->min_bound = -50;
param->max_bound = 50;
param->diffusion_boundary_condition = "Dirichlet";
};
Simulation simulation(TEST_NAME, set_param);
Expand All @@ -984,7 +984,7 @@ TEST(DiffusionTest, EulerDirichletBoundaries) {

double decay_coef = 0.0;
double diff_coef = 100.0;
int res = 20;
int res = 10;
// Depleting substance is fixed, i.e. no diff and no decay
auto* dgrid = new EulerGrid(0, "Kalium", diff_coef, decay_coef, res);

Expand All @@ -996,7 +996,7 @@ TEST(DiffusionTest, EulerDirichletBoundaries) {
rm->AddContinuum(dgrid);

// Simulate diffusion / exponential decay for `tot` timesteps
int tot = 100000; // ToDo This should probably be lower for final version
int tot = 5000; // ToDo This should probably be lower for final version
for (int t = 0; t < tot; t++) {
dgrid->Diffuse(simulation_time_step);
}
Expand All @@ -1016,8 +1016,8 @@ TEST(DiffusionTest, EulerNeumannZeroBoundaries) {
double simulation_time_step{0.1};
auto set_param = [](auto* param) {
param->bound_space = Param::BoundSpaceMode::kClosed;
param->min_bound = -100;
param->max_bound = 100;
param->min_bound = -50;
param->max_bound = 50;
param->diffusion_boundary_condition = "Neumann";
};
Simulation simulation(TEST_NAME, set_param);
Expand All @@ -1026,12 +1026,12 @@ TEST(DiffusionTest, EulerNeumannZeroBoundaries) {

double decay_coef = 0.0;
double diff_coef = 10.0;
int res = 20;
int res = 10;
double init = 1e5;
std::vector<Real3> sources;
sources.push_back({0, 0, 0});
sources.push_back({50, 50, 50});
sources.push_back({-50, -50, -50});
sources.push_back({49, 49, 49});
sources.push_back({-49, -49, -49});

// Test multiple positions for the source
for (size_t s = 0; s < sources.size(); s++) {
Expand All @@ -1045,7 +1045,7 @@ TEST(DiffusionTest, EulerNeumannZeroBoundaries) {
rm->AddContinuum(dgrid);

// Simulate diffusion / exponential decay for `tot` timesteps
int tot = 10000;
int tot = 1000;
for (int t = 0; t < tot; t++) {
dgrid->Diffuse(simulation_time_step);
}
Expand Down Expand Up @@ -1104,7 +1104,7 @@ TEST(DiffusionTest, EulerNeumannNonZeroBoundaries) {
// ----------------------------------------------------------

double intermediate_concentration_backup = 0.0;
int tot = 10000;
int tot = 1000;
for (int t = 0; t < tot; t++) {
dgrid->Diffuse(simulation_time_step);
conc = dgrid->GetAllConcentrations(); // get current concentrations.
Expand Down
41 changes: 41 additions & 0 deletions util/valgrind-bdm.supp
Original file line number Diff line number Diff line change
Expand Up @@ -529,3 +529,44 @@
fun:__cxa_finalize
...
}

######### Suppress Memory Leak for Ubuntu

{
ignore_memory_leak_ubuntu_20_04
Memcheck:Leak
match-leak-kinds: possible
fun:calloc
fun:allocate_dtv
fun:_dl_allocate_tls
fun:allocate_stack
fun:pthread_create@@GLIBC_2.2.5
fun:launch
fun:wake_or_launch
fun:_ZN3tbb8internal3rml14private_server9wake_someEi
fun:propagate_chain_reaction
fun:_ZN3tbb8internal3rml14private_worker3runEv
fun:_ZN3tbb8internal3rml14private_worker14thread_routineEPv
fun:start_thread
fun:clone
}

{
ignore_memory_leak_ubuntu_22_04
Memcheck:Leak
match-leak-kinds: possible
fun:calloc
fun:calloc
fun:allocate_dtv
fun:_dl_allocate_tls
fun:allocate_stack
fun:pthread_create@@GLIBC_2.34
fun:launch
fun:wake_or_launch
fun:_ZN3tbb8internal3rml14private_server9wake_someEi
fun:propagate_chain_reaction
fun:_ZN3tbb8internal3rml14private_worker3runEv
fun:_ZN3tbb8internal3rml14private_worker14thread_routineEPv
fun:start_thread
fun:clone
}

0 comments on commit 5bd40af

Please sign in to comment.