10 #define __PFFTUTIL_H__
14 #include "ckcomplex.h"
36 #define ENERGY_EHART 0
44 #define ENERGY_FICTEKE 8
46 #define NUM_ENERGIES 9
48 #define MAX_CHAR_ARRAY_LENGTH 1024
62 inline size2d() {sz[0]=sz[1]=0;}
63 inline size2d(
int ni,
int nj) {sz[0]=ni; sz[1]=nj;}
64 inline int ni(
void)
const {
return sz[0];}
65 inline int nj(
void)
const {
return sz[1];}
66 inline int nx(
void)
const {
return sz[0];}
67 inline int ny(
void)
const {
return sz[1];}
68 inline int operator[](
int i)
const {
return sz[i];}
69 inline int getIndex(
int i,
int j)
const {
71 if (i<0 || i>=sz[0]) {CkAbort(
"Index out of bounds");}
72 if (j<0 || j>=sz[1]) {CkAbort(
"Index out of bounds");}
76 inline int getIndex(
const size2d &at)
const {
77 return getIndex(at[0],at[1]);
79 inline int getTotal(
void)
const {
return sz[0]*sz[1];}
80 inline int getVolume(
void)
const {
return getTotal();}
82 #if ! CMK_BLUEGENE_CHARM
99 inline void allocate(
void) {
101 data = (T*) malloc(size.getTotal() *
sizeof(T));
104 inline void destroy(
void) {
113 inline void operator=(
const array2d &a);
118 inline array2d(
void) {data=NULL;}
125 inline void zero(
void) {
126 int l=size.getTotal();
129 memset(data, 0, l *
sizeof(T));
132 inline const size2d &getSize(
void)
const {
return size;}
133 inline T *getData(
void)
const {
return data;}
135 inline T &operator[](
const size2d &at) {
return data[size.getIndex(at)];}
136 inline const T &operator[](
const size2d &at)
const {
return data[size.getIndex(at)];}
138 inline T &operator()(
int i,
int j) {
return data[size.getIndex(i,j)];}
139 inline const T &operator()(
int i,
int j)
const {
return data[size.getIndex(i,j)];}
141 void pup(PUP::er &p) {
143 if (p.isUnpacking()) allocate();
144 p(data, size.getTotal());
150 #include "../../include/RunDescriptor.h"
161 void get_rho_kvectors(
double ecut4,
double *hmati,
int **kx_ret,
int **ky_ret,
162 int **kz_ret,
int *nline_tot_ret,
int *nPacked_ret,
163 int ka_max,
int kb_max,
int kc_max);
174 void readStateInfo(
int &,
int &,
int &,
int &,
int &,
int &,
const char *,
int );
177 const char *,
int ,
int *,
int *,
int *,
int *,
int *,
int *,
178 int **,
int **,
int **,
int **,
int **,
int,
int,
int,
int,
int);
181 int ibinary_opt,
int *nline_tot_ret,
int *nplane_ret,
int *kx,
182 int *ky,
int *kz,
int *nx_ret,
int *ny_ret,
int *nz_ret,
183 int *istrt_lgrp,
int *iend_lgrp,
int *npts_lgrp,
int *nline_lgrp,
184 int iget_decomp,
int iget_vstate);
188 void sort_kxky(
int ,
int *,
int *,
int *,
int *,
int);
191 int *,
int *,
int *,
int ,
int,
int,
int,
char *,
char *,
int,
int,
int,
192 int ,
int ,
int ,
int );
203 int *,
int *,
int *,
int *,
int *,
int ,
int ,
int,
int);
205 FILE *
openScreenfWrite(
const char *dirnameBase,
const char *fname,
int temper,
int bead,
bool beadfile);
208 #endif //__PFFTUTIL_H__
== Size or location in a regular 2D array
void readStateInfo(int &, int &, int &, int &, int &, int &, const char *, int)
== input/output routines, including states, run descriptors, and line balancing
void getSplitDecomp(int *, int *, int *, int, int, int)
Initialization Function /////////////////////////////////////////////////////////////////////////// /...
void sort_kxky(int, int *, int *, int *, int *, int)
FILE * openScreenfWrite(const char *dirnameBase, const char *fname, int temper, int bead, bool beadfile)
this stuff is in a C file because multiple includes of .def will give you too many implementations of...
void create_line_decomp_descriptor(CPcharmParaInfo *sim)
/////////////////////////////////////////////////////////////////////////cc
void create_subPlane_decomp(int, int *, int *, int, int *, int *, int *, int **, int)
Create some decompositions and find the best one. ///////////////////////////////////////////////////...
== Regular rectangular 2D array
void readStateIntoRuns(int, int, complex *, CkVec< RunDescriptor > &, const char *, int, int *, int *, int *, int *, int *, int *, int **, int **, int **, int **, int **, int, int, int, int, int)
void readState(int nPacked, complex *arrCP, const char *fromFile, int ibinary_opt, int *nline_tot_ret, int *nplane_ret, int *kx, int *ky, int *kz, int *nx_ret, int *ny_ret, int *nz_ret, int *istrt_lgrp, int *iend_lgrp, int *npts_lgrp, int *nline_lgrp, int iget_decomp, int iget_vstate)
void processState(int, int, complex *, const char *, int, int *, int *, int *, int *, int *, int *, int *, int *, int *, int, int, int, int)
void get_rho_kvectors(double ecut4, double *hmati, int **kx_ret, int **ky_ret, int **kz_ret, int *nline_tot_ret, int *nPacked_ret, int ka_max, int kb_max, int kc_max)
void make_rho_runs(CPcharmParaInfo *sim)
== rho space run descriptors for spherical cutoff fft support
void sort_psi_output(int, int *, int *, int *, int *, int *, int *)
void create_gx_decomp(int, int, int *, int *, int, int *)
void score_subPlane_decomp(int, int, int *, int *, int *, int **, int *)
Score a decomposition /////////////////////////////////////////////////////////////////////////// ///...