6 #include "patch.decl.h"
7 #include "pairCompute.decl.h"
10 class Patch
: public CBase_Patch
{
12 // Declare CkIndex_Patch as a friend so accelerated entry methods can access
13 // the member variables of the object they execute on
14 friend class CkIndex_Patch
;
18 /// Member Variables ///
19 int remainingForceCheckIns
;
20 int remainingIterations
;
23 MD_FLOAT
* particleX
; // x-coordinate
24 MD_FLOAT
* particleY
; // y-coordinate
25 MD_FLOAT
* particleZ
; // z-coordinate
26 MD_FLOAT
* particleQ
; // charge
27 MD_FLOAT
* particleM
; // mass
28 MD_FLOAT
* velocityX
; // velocity x-component
29 MD_FLOAT
* velocityY
; // velocity y-component
30 MD_FLOAT
* velocityZ
; // velocity z-component
31 MD_FLOAT
* forceSumX
; // Buffer to sum of force x components from computes
32 MD_FLOAT
* forceSumY
; // Buffer to sum of force y components from computes
33 MD_FLOAT
* forceSumZ
; // Buffer to sum of force z components from computes
35 #if USE_ARRAY_SECTIONS != 0
36 CProxySection_PairCompute pairComputeArraySection_lower
;
37 CProxySection_PairCompute pairComputeArraySection_upper
;
40 #if USE_PROXY_PATCHES != 0
41 CProxy_ProxyPatch proxyPatchProxy
;
42 int* proxyPatchPresentFlags
;
47 unsigned int localFlopCount
;
50 /// Member Functions ///
51 void randomizeParticles();
53 void startIteration_common(int numIters
);
57 /// Constructor(s) \ Destructor ///
59 Patch(CkMigrateMessage
* msg
);
63 void init(int numParticles
);
64 void init(int numParticles
, CProxy_ProxyPatch proxyPatchProxy
);
65 void init_common(int numParticles
);
66 void startIteration();
67 void startIterations(int numIters
);
68 void forceCheckIn(int numParticles
, MD_FLOAT
* forceX
, MD_FLOAT
* forceY
, MD_FLOAT
* forceZ
);
69 void forceCheckIn(int numParticles
, MD_FLOAT
* forceX
, MD_FLOAT
* forceY
, MD_FLOAT
* forceZ
, int numForceCheckIns
);
70 void integrate_callback();
75 class ProxyPatch
: public CBase_ProxyPatch
{
77 // Declare CkIndex_ProxyPatch as a friend so accelerated entry methods can access
78 // the member variables of the object they execute on
79 friend class CkIndex_ProxyPatch
;
83 /// Member Variables ///
100 /// Constructor(s) \ Destructor ///
101 ProxyPatch(int proxyIndex
);
102 ProxyPatch(CkMigrateMessage
*msg
);
105 /// Entry Methods ///
106 void init(int numParticles
);
107 void patchData(int numParticles
, MD_FLOAT
* particleX
, MD_FLOAT
* particleY
, MD_FLOAT
* particleZ
, MD_FLOAT
* particleQ
);
108 void forceCheckIn(int numParticles
, MD_FLOAT
* forceX
, MD_FLOAT
* forceY
, MD_FLOAT
* forceZ
);