Subject: CGAL users discussion list
List archive
- From: Tom Dreyfus <>
- To:
- Subject: [cgal-discuss] Algebraic_kernel_d_1 and multi threading with OpenMP
- Date: Mon, 5 Sep 2011 23:58:13 +0200 (CEST)
Hello,
I use the Algebraic_kernel_d_1 of CGAL for solving degree 4 equations.
When I use the solver in a #pragma omp parallel for directive, I have a segmentation fault.
However, I have no issue when there is only one thread.
I attached an example.
Thank you.
Tom.
I use the Algebraic_kernel_d_1 of CGAL for solving degree 4 equations.
When I use the solver in a #pragma omp parallel for directive, I have a segmentation fault.
However, I have no issue when there is only one thread.
I attached an example.
Thank you.
Tom.
#ifndef CGAL_USE_MPFI #define CGAL_USE_MPFI #endif #ifdef CGAL_USE_MPFI #include <CGAL/Algebraic_kernel_d_1.h> #include <CGAL/Gmpz.h> #include <omp.h> #define M 100000 typedef CGAL::Gmpz Gmpz; typedef CGAL::Algebraic_kernel_d_1<Gmpz> AK_1; typedef AK_1::Algebraic_real_1 Algebraic_real_1; typedef AK_1::Polynomial_1 Polynomial_1; typedef AK_1::Solve_1 Solve_1; int main() { AK_1 ak; Solve_1 solver = ak.solve_1_object(); #pragma omp parallel for for(unsigned i = 0; i < M; i++){ std::vector<Algebraic_real_1> roots; Polynomial_1 l = CGAL::shift(Polynomial_1(1),1); Polynomial_1 P = l*l - 1; solver(P,false,std::back_inserter(roots)); } return 0; } #else int main() { std::cout << "This example requires CGAL to be configured with library MPFI." << std::endl; return 0; } #endif
- [cgal-discuss] Algebraic_kernel_d_1 and multi threading with OpenMP, Tom Dreyfus, 09/05/2011
- Re: [cgal-discuss] Algebraic_kernel_d_1 and multi threading with OpenMP, Eric Berberich, 09/06/2011
- Re: [cgal-discuss] Algebraic_kernel_d_1 and multi threading with OpenMP, Sebastien Loriot (GeometryFactory), 09/06/2011
Archive powered by MHonArc 2.6.16.