2 #include "structureFactor.decl.h"
3 #include "StructureFactorMessages.h"
5 #ifndef _StructureFactor_h_
6 #define _StructureFactor_h_
7 void *fftw_malloc(
size_t );
8 void fftw_free(
void *);
24 StructureFactor(
int _numSfGrps,
int _numSfDups,
int _natm_nl_grp_max,
int _numdest,
int *_destinations,
UberCollection _thisInstance) : numSfGrps(_numSfGrps), numSfDups(_numSfDups), natm_nl_grp_max(_natm_nl_grp_max), numdest(_numdest), thisInstance(_thisInstance)
33 destinations =
new int[numdest];
34 CmiMemcpy(destinations,_destinations, numdest *
sizeof(
int));
39 #ifdef _CP_DEBUG_SF_CALC_
40 CkPrintf(
"[%d %d %d] created SF\n",thisIndex.x, thisIndex.y, thisIndex.z);
51 if(structFactor!=NULL)
53 fftw_free(structFactor);
54 fftw_free(structFactor_fx);
55 fftw_free(structFactor_fy);
56 fftw_free(structFactor_fz);
58 if(destinations!=NULL)
59 delete [] destinations;
62 void acceptDestination(
int _numdest,
int *_destinations)
64 #ifdef _CP_DEBUG_SF_CALC_
65 CkPrintf(
"[%d %d %d] SF has %d destinations\n",thisIndex.x, thisIndex.y, thisIndex.z, _numdest);
68 destinations =
new int[numdest];
69 CmiMemcpy(destinations,_destinations, numdest *
sizeof(
int));
75 void acceptKVectors(
int n,
int *_k_x,
int *_k_y,
int *_k_z)
78 k_x= (
int *)fftw_malloc(gsSize*
sizeof(
int));
79 k_y= (
int *)fftw_malloc(gsSize*
sizeof(
int));
80 k_z= (
int *)fftw_malloc(gsSize*
sizeof(
int));
81 CmiMemcpy(k_x,_k_x,gsSize*
sizeof(
int));
82 CmiMemcpy(k_y,_k_y,gsSize*
sizeof(
int));
83 CmiMemcpy(k_z,_k_z,gsSize*
sizeof(
int));
92 p((
char*)structFactor,gsSize*natm_nl_grp_max*
sizeof(
complex));
93 p((
char*)structFactor_fx,gsSize*natm_nl_grp_max*
sizeof(
complex));
94 p((
char*)structFactor_fy,gsSize*natm_nl_grp_max*
sizeof(
complex));
95 p((
char*)structFactor_fz,gsSize*natm_nl_grp_max*
sizeof(
complex));
99 p(destinations, numdest);
119 #endif //_StructureFactor_h_
holds the UberIndex and the offset for proxies
void computeSF(SFDummyMsg *msg)
StructureFactor(int _numSfGrps, int _numSfDups, int _natm_nl_grp_max, int _numdest, int *_destinations, UberCollection _thisInstance)