00df8bd941f9bb1d6de54282aeac5309c654bfcd
2 #include "00_pi_tools.h"
5 /*----------------------------------------------------------------------*\
7 \*---------------------------------------------------------------------*/
9 /*--------------------------------------*\
11 \*-------------------------------------*/
14 /*--------------------------------------*\
16 \*-------------------------------------*/
18 bool isPiOMPEntrelacerAtomic_Ok(int n
);
20 /*--------------------------------------*\
22 \*-------------------------------------*/
24 static double piOMPEntrelacerAtomic(int n
);
26 /*----------------------------------------------------------------------*\
28 \*---------------------------------------------------------------------*/
30 /*--------------------------------------*\
32 \*-------------------------------------*/
34 bool isPiOMPEntrelacerAtomic_Ok(int n
)
36 return isAlgoPI_OK(piOMPEntrelacerAtomic
, n
, "Pi OMP Entrelacer atomic");
39 /*--------------------------------------*\
41 \*-------------------------------------*/
44 * Bonne performance, si!
46 double piOMPEntrelacerAtomic(int n
)
48 const int NB_THREAD
= OmpTools::setAndGetNaturalGranularity();
49 const double DX
= 1.0/(double)n
;
55 double sumLocalThread
= 0;
56 const int TID
= OmpTools::getTid();
62 sumLocalThread
+= fpi(xs
);
67 sum
+= sumLocalThread
;
74 /*----------------------------------------------------------------------*\
76 \*---------------------------------------------------------------------*/