Marge with trunk: svn merge -r 12050:12057 https://svn.blender.org/svnroot/bf-blender...
[blender.git] / intern / elbeem / intern / paraloop.h
1
2 #define PERFORM_USQRMAXCHECK \
3 _Pragma("omp critical") {\
4 USQRMAXCHECK(usqr,ux,uy,uz, mMaxVlen, mMxvx,mMxvy,mMxvz); \
5 } \
6
7
8 #define LIST_EMPTY(x) \
9 _Pragma("omp critical") {\
10 mListEmpty.push_back( x ); }
11
12 #define LIST_FULL(x) \
13 _Pragma("omp critical") {\
14 mListFull.push_back( x ); }
15
16 #define FSGR_ADDPART(x)  \
17 _Pragma("omp critical") { \
18 mpParticles->addFullParticle( x ); } \
19
20
21 #define MAX_THREADS 2
22
23 #define  GRID_REGION_START()  \
24 { /* main_region */ \
25         int kstart=getForZMinBnd(), kend=getForZMaxBnd(mMaxRefine); \
26         if(gridLoopBound>0){ kstart=getForZMin1(), kend=getForZMax1(mMaxRefine); } \
27         int kdir = 1; \
28         const int id=omp_get_thread_num(); \
29         int jstart = (id*((mLevel[mMaxRefine].lSizey-gridLoopBound) / MAX_THREADS))+gridLoopBound; \
30         int jend   = (id+1)*((mLevel[mMaxRefine].lSizey-gridLoopBound)/ MAX_THREADS); \
31         if(id+1 == MAX_THREADS) \
32         { \
33         jend = mLevel[mMaxRefine].lSizey-gridLoopBound; \
34         } \
35         LbmFloat *ccel = NULL, *tcel = NULL; \
36         CellFlagType *pFlagSrc=NULL, *pFlagDst=NULL; \
37         if(mLevel[mMaxRefine].setCurr==1) { \
38         kdir = -1; \
39         int temp = kend; \
40         kend = kstart-1; \
41         kstart = temp-1; \
42         temp = id; /* dummy remove warning */ \
43 } \
44
45 // if(jstart<1) jstart = 1; 
46
47 #define unused_GRID_REGION_END() \
48 } /* main_region */  \
49         // end unusedGRID_REGION_END
50