9fcaf879344ea1aaed8d68fae33de178dceee59b
3 #include "00_pi_tools.h"
8 /*----------------------------------------------------------------------*\
10 \*---------------------------------------------------------------------*/
12 /*--------------------------------------*\
14 \*-------------------------------------*/
18 /*--------------------------------------*\
20 \*-------------------------------------*/
22 bool isPiOMPforPromotionTab_Ok(int n
);
24 /*--------------------------------------*\
26 \*-------------------------------------*/
28 static double piOMPforPromotionTab(int n
);
29 static void syntaxeSimplifier(double* tabSumThread
,int n
);
30 static void syntaxeFull(double* tabSumThread
,int n
);
32 /*----------------------------------------------------------------------*\
34 \*---------------------------------------------------------------------*/
36 /*--------------------------------------*\
38 \*-------------------------------------*/
40 bool isPiOMPforPromotionTab_Ok(int n
)
42 return isAlgoPI_OK(piOMPforPromotionTab
, n
, "Pi OMP for promotion tab");
45 /*--------------------------------------*\
47 \*-------------------------------------*/
50 * De-synchronisation avec PromotionTab
52 double piOMPforPromotionTab(int n
)
55 const int NB_THREAD
= OmpTools::setAndGetNaturalGranularity();
56 const double DX
= 1.0/(double)n
;
58 double sums
[NB_THREAD
];
59 memset(sums
, 0, sizeof(sums
));
61 #pragma omp parallel for private(xi)
62 for (int i
= 0; i
< n
; i
++)
64 const int TID
= OmpTools::getTid();
70 for (int i
= 0; i
< NB_THREAD
; i
++)
78 /*----------------------------------------------------------------------*\
80 \*---------------------------------------------------------------------*/