getfem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-commits] (no subject)


From: Konstantinos Poulios
Subject: [Getfem-commits] (no subject)
Date: Fri, 22 May 2020 06:02:01 -0400 (EDT)

branch: devel-logari81-gcc9-openmp
commit efe0d4541f6b972d1c48ad685131f42d68ff56b8
Author: Konstantinos Poulios <address@hidden>
AuthorDate: Fri May 22 12:01:45 2020 +0200

    Fix compilation and test errors with --enable-openmp
---
 src/getfem/getfem_omp.h    | 5 ++++-
 tests/test_kdtree.cc       | 2 ++
 tests/test_small_vector.cc | 3 ++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/getfem/getfem_omp.h b/src/getfem/getfem_omp.h
index f8dbaa7..f224ffe 100644
--- a/src/getfem/getfem_omp.h
+++ b/src/getfem/getfem_omp.h
@@ -54,6 +54,9 @@ namespace getfem
   using bgeot::size_type;
 
 #ifdef GETFEM_HAS_OPENMP
+  void parallel_execution(std::function<void(void)> lambda,
+                          bool iterate_over_partitions);
+
   //declaring a thread lock, to protect multi-threaded accesses to
   //asserts, traces and warnings. Using a global mutex
   class omp_guard
@@ -486,4 +489,4 @@ namespace getfem
 
   #endif
 
-}  /* end of namespace getfem.                                             */
\ No newline at end of file
+}  /* end of namespace getfem.                                             */
diff --git a/tests/test_kdtree.cc b/tests/test_kdtree.cc
index 331b569..9e29656 100644
--- a/tests/test_kdtree.cc
+++ b/tests/test_kdtree.cc
@@ -115,7 +115,9 @@ void speed_test(unsigned N, unsigned NPT, unsigned nrepeat) 
{
     for (dim_type k = 0; k < N; ++k) 
       pt[k] = gmm::random(double())*2.;
     tree.add_point(pt);
+#ifndef GETFEM_HAS_OPENMP
     assert(pt.refcnt()>1);
+#endif
   }
   t = gmm::uclock_sec();
   cout << "point list built in " << gmm::uclock_sec() - t << " seconds.\n";
diff --git a/tests/test_small_vector.cc b/tests/test_small_vector.cc
index 6aac7f1..7abf61a 100644
--- a/tests/test_small_vector.cc
+++ b/tests/test_small_vector.cc
@@ -779,7 +779,8 @@ namespace getfem {
     //rrun(mv);
     rrun(Sv);
     //rrun(av);
-    bgeot::static_block_allocator::palloc->memstats();
+    if (bgeot::static_block_allocator::palloc)
+      bgeot::static_block_allocator::palloc->memstats();
     cout << "sizeof(size_type)=" << sizeof(size_type) 
         << ", sizeof(base_node)=" << sizeof(base_node) 
         << ", sizeof(base_small_vector)=" << sizeof(base_small_vector) << "\n";



reply via email to

[Prev in Thread] Current Thread [Next in Thread]