MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
Classes | Typedefs | Functions
petapm.h File Reference
#include <pfft.h>
#include "powerspectrum.h"
Include dependency graph for petapm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Region
 
struct  Layout
 
struct  PetaPMPriv
 
struct  PetaPM
 
struct  PetaPMParticleStruct
 
struct  PetaPMFunctions
 
struct  PetaPMGlobalFunctions
 

Typedefs

typedef struct Region PetaPMRegion
 
typedef struct PetaPMPriv PetaPMPriv
 
typedef struct PetaPM PetaPM
 
typedef void(* petapm_transfer_func) (PetaPM *pm, int64_t k2, int kpos[3], pfft_complex *value)
 
typedef void(* petapm_readout_func) (PetaPM *pm, int i, double *mesh, double weight)
 
typedef PetaPMRegion *(* petapm_prepare_func) (PetaPM *pm, PetaPMParticleStruct *pstruct, void *data, int *Nregions)
 
typedef void *(* petapm_malloc_func) (char *name, size_t *size)
 
typedef void *(* petapm_mfree_func) (void *ptr)
 

Functions

void petapm_module_init (int Nthreads)
 
void petapm_init (PetaPM *pm, double BoxSize, double Asmth, int Nmesh, double G, MPI_Comm comm)
 
void petapm_destroy (PetaPM *pm)
 
void petapm_region_init_strides (PetaPMRegion *region)
 
void petapm_force (PetaPM *pm, petapm_prepare_func prepare, PetaPMGlobalFunctions *global_functions, PetaPMFunctions *functions, PetaPMParticleStruct *pstruct, void *userdata)
 
PetaPMRegionpetapm_force_init (PetaPM *pm, petapm_prepare_func prepare, PetaPMParticleStruct *pstruct, int *Nregions, void *userdata)
 
pfft_complex * petapm_force_r2c (PetaPM *pm, PetaPMGlobalFunctions *global_functions)
 
void petapm_force_c2r (PetaPM *pm, pfft_complex *rho_k, PetaPMRegion *regions, const int Nregions, PetaPMFunctions *functions)
 
void petapm_force_finish (PetaPM *pm)
 
PetaPMRegionpetapm_get_fourier_region (PetaPM *pm)
 
PetaPMRegionpetapm_get_real_region (PetaPM *pm)
 
int petapm_mesh_to_k (PetaPM *pm, int i)
 
int * petapm_get_thistask2d (PetaPM *pm)
 
int * petapm_get_ntask2d (PetaPM *pm)
 
pfft_complex * petapm_alloc_rhok (PetaPM *pm)
 

Typedef Documentation

◆ PetaPM

typedef struct PetaPM PetaPM

◆ petapm_malloc_func

typedef void*(* petapm_malloc_func) (char *name, size_t *size)

Definition at line 108 of file petapm.h.

◆ petapm_mfree_func

typedef void*(* petapm_mfree_func) (void *ptr)

Definition at line 109 of file petapm.h.

◆ petapm_prepare_func

typedef PetaPMRegion*(* petapm_prepare_func) (PetaPM *pm, PetaPMParticleStruct *pstruct, void *data, int *Nregions)

Definition at line 91 of file petapm.h.

◆ petapm_readout_func

typedef void(* petapm_readout_func) (PetaPM *pm, int i, double *mesh, double weight)

Definition at line 90 of file petapm.h.

◆ petapm_transfer_func

typedef void(* petapm_transfer_func) (PetaPM *pm, int64_t k2, int kpos[3], pfft_complex *value)

Definition at line 89 of file petapm.h.

◆ PetaPMPriv

typedef struct PetaPMPriv PetaPMPriv

◆ PetaPMRegion

typedef struct Region PetaPMRegion

Function Documentation

◆ petapm_alloc_rhok()

pfft_complex* petapm_alloc_rhok ( PetaPM pm)

Definition at line 50 of file petapm.c.

51 {
52  pfft_complex * rho_k = (pfft_complex * ) mymalloc("PMrho_k", pm->priv->fftsize * sizeof(double));
53  memset(rho_k, 0, pm->priv->fftsize * sizeof(double));
54  return rho_k;
55 }
#define mymalloc(name, size)
Definition: mymalloc.h:15
int fftsize
Definition: petapm.h:51
PetaPMPriv priv[1]
Definition: petapm.h:72

References PetaPMPriv::fftsize, mymalloc, and PetaPM::priv.

Referenced by displacement_fields().

Here is the caller graph for this function:

◆ petapm_destroy()

void petapm_destroy ( PetaPM pm)

Definition at line 215 of file petapm.c.

216 {
217  pfft_destroy_plan(pm->priv->plan_forw);
218  pfft_destroy_plan(pm->priv->plan_back);
219  MPI_Comm_free(&pm->priv->comm_cart_2d);
220  myfree(pm->Mesh2Task[0]);
221 }
#define myfree(x)
Definition: mymalloc.h:19
pfft_plan plan_back
Definition: petapm.h:53
pfft_plan plan_forw
Definition: petapm.h:52
MPI_Comm comm_cart_2d
Definition: petapm.h:54
int * Mesh2Task[2]
Definition: petapm.h:75

References PetaPMPriv::comm_cart_2d, PetaPM::Mesh2Task, myfree, PetaPMPriv::plan_back, PetaPMPriv::plan_forw, and PetaPM::priv.

Referenced by do_force_test(), main(), and run_gravity_test().

Here is the caller graph for this function:

◆ petapm_force()

void petapm_force ( PetaPM pm,
petapm_prepare_func  prepare,
PetaPMGlobalFunctions global_functions,
PetaPMFunctions functions,
PetaPMParticleStruct pstruct,
void *  userdata 
)

Definition at line 353 of file petapm.c.

357  {
358  int Nregions;
359  PetaPMRegion * regions = petapm_force_init(pm, prepare, pstruct, &Nregions, userdata);
360  pfft_complex * rho_k = petapm_force_r2c(pm, global_functions);
361  if(functions)
362  petapm_force_c2r(pm, rho_k, regions, Nregions, functions);
363  myfree(rho_k);
364  if(CPS->RegionInd)
365  myfree(CPS->RegionInd);
366  myfree(regions);
368 }
static PetaPMGlobalFunctions global_functions
Definition: glass.c:33
static PetaPMFunctions functions[]
Definition: gravpm.c:32
void petapm_force_finish(PetaPM *pm)
Definition: petapm.c:348
pfft_complex * petapm_force_r2c(PetaPM *pm, PetaPMGlobalFunctions *global_functions)
Definition: petapm.c:273
void petapm_force_c2r(PetaPM *pm, pfft_complex *rho_k, PetaPMRegion *regions, const int Nregions, PetaPMFunctions *functions)
Definition: petapm.c:317
static PetaPMParticleStruct * CPS
Definition: petapm.c:59
PetaPMRegion * petapm_force_init(PetaPM *pm, petapm_prepare_func prepare, PetaPMParticleStruct *pstruct, int *Nregions, void *userdata)
Definition: petapm.c:251
Definition: petapm.h:7

References CPS, functions, global_functions, myfree, petapm_force_c2r(), petapm_force_finish(), petapm_force_init(), petapm_force_r2c(), and PetaPMParticleStruct::RegionInd.

Referenced by glass_force(), and gravpm_force().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ petapm_force_c2r()

void petapm_force_c2r ( PetaPM pm,
pfft_complex *  rho_k,
PetaPMRegion regions,
const int  Nregions,
PetaPMFunctions functions 
)

Definition at line 317 of file petapm.c.

322 {
323 
325  for (f = functions; f->name; f ++) {
326  petapm_transfer_func transfer = f->transfer;
327  petapm_readout_func readout = f->readout;
328 
329  pfft_complex * complx = (pfft_complex *) mymalloc("PMcomplex", pm->priv->fftsize * sizeof(double));
330  /* apply the greens function turn rho_k into potential in fourier space */
331  pm_apply_transfer_function(pm, rho_k, complx, transfer);
332  walltime_measure("/PMgrav/calc");
333 
334  double * real = (double * ) mymalloc2("PMreal", pm->priv->fftsize * sizeof(double));
335  pfft_execute_dft_c2r(pm->priv->plan_back, complx, real);
336  walltime_measure("/PMgrav/c2r");
337  myfree(complx);
338  /* read out the potential: this will copy and free real.*/
340  walltime_measure("/PMgrav/comm");
341 
342  pm_iterate(pm, readout, regions, Nregions);
343  walltime_measure("/PMgrav/readout");
344  }
345  walltime_measure("/PMgrav/Misc");
346 
347 }
#define mymalloc2(name, size)
Definition: mymalloc.h:16
static void pm_apply_transfer_function(PetaPM *pm, pfft_complex *src, pfft_complex *dst, petapm_transfer_func H)
Definition: petapm.c:883
static void pm_iterate(PetaPM *pm, pm_iterator iterator, PetaPMRegion *regions, const int Nregions)
Definition: petapm.c:804
static void layout_build_and_exchange_cells_to_local(PetaPM *pm, struct Layout *L, double *meshbuf, double *real)
Definition: petapm.c:639
void(* petapm_transfer_func)(PetaPM *pm, int64_t k2, int kpos[3], pfft_complex *value)
Definition: petapm.h:89
void(* petapm_readout_func)(PetaPM *pm, int i, double *mesh, double weight)
Definition: petapm.h:90
petapm_readout_func readout
Definition: petapm.h:96
petapm_transfer_func transfer
Definition: petapm.h:95
const char * name
Definition: petapm.h:94
struct Layout layout
Definition: petapm.h:59
double * meshbuf
Definition: petapm.h:57
#define walltime_measure(name)
Definition: walltime.h:8

References PetaPMPriv::fftsize, functions, PetaPMPriv::layout, layout_build_and_exchange_cells_to_local(), PetaPMPriv::meshbuf, myfree, mymalloc, mymalloc2, PetaPMFunctions::name, PetaPMPriv::plan_back, pm_apply_transfer_function(), pm_iterate(), PetaPM::priv, PetaPMFunctions::readout, PetaPMFunctions::transfer, and walltime_measure.

Referenced by displacement_fields(), and petapm_force().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ petapm_force_finish()

void petapm_force_finish ( PetaPM pm)

Definition at line 348 of file petapm.c.

348  {
349  layout_finish(&pm->priv->layout);
350  myfree(pm->priv->meshbuf);
351 }
static void layout_finish(struct Layout *L)
Definition: petapm.c:569

References PetaPMPriv::layout, layout_finish(), PetaPMPriv::meshbuf, myfree, and PetaPM::priv.

Referenced by displacement_fields(), and petapm_force().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ petapm_force_init()

PetaPMRegion* petapm_force_init ( PetaPM pm,
petapm_prepare_func  prepare,
PetaPMParticleStruct pstruct,
int *  Nregions,
void *  userdata 
)

Definition at line 251 of file petapm.c.

256  {
257  CPS = pstruct;
258 
259  *Nregions = 0;
260  PetaPMRegion * regions = prepare(pm, pstruct, userdata, Nregions);
261  pm_init_regions(pm, regions, *Nregions);
262 
263  walltime_measure("/PMgrav/Misc");
264  pm_iterate(pm, put_particle_to_mesh, regions, *Nregions);
265  walltime_measure("/PMgrav/cic");
266 
267  layout_prepare(pm, &pm->priv->layout, pm->priv->meshbuf, regions, *Nregions, pm->comm);
268 
269  walltime_measure("/PMgrav/comm");
270  return regions;
271 }
static void pm_init_regions(PetaPM *pm, PetaPMRegion *regions, const int Nregions)
Definition: petapm.c:723
static void layout_prepare(PetaPM *pm, struct Layout *L, double *meshbuf, PetaPMRegion *regions, const int Nregions, MPI_Comm comm)
Definition: petapm.c:375
static void put_particle_to_mesh(PetaPM *pm, int i, double *mesh, double weight)
Definition: petapm.c:929
MPI_Comm comm
Definition: petapm.h:64

References PetaPM::comm, CPS, PetaPMPriv::layout, layout_prepare(), PetaPMPriv::meshbuf, pm_init_regions(), pm_iterate(), PetaPM::priv, put_particle_to_mesh(), and walltime_measure.

Referenced by displacement_fields(), and petapm_force().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ petapm_force_r2c()

pfft_complex* petapm_force_r2c ( PetaPM pm,
PetaPMGlobalFunctions global_functions 
)

Definition at line 273 of file petapm.c.

275  {
276  /* call pfft rho_k is CFT of rho */
277 
278  /* this is because
279  *
280  * CFT = DFT * dx **3
281  * CFT[rho] = DFT [rho * dx **3] = DFT[CIC]
282  * */
283  double * real = (double * ) mymalloc2("PMreal", pm->priv->fftsize * sizeof(double));
284  memset(real, 0, sizeof(double) * pm->priv->fftsize);
286  walltime_measure("/PMgrav/comm2");
287 
288 #ifdef DEBUG
289  verify_density_field(pm, real, pm->priv->meshbuf, pm->priv->meshbufsize);
290  walltime_measure("/PMgrav/Misc");
291 #endif
292 
293  pfft_complex * complx = (pfft_complex *) mymalloc("PMcomplex", pm->priv->fftsize * sizeof(double));
294  pfft_execute_dft_r2c(pm->priv->plan_forw, real, complx);
295  myfree(real);
296 
297  pfft_complex * rho_k = (pfft_complex * ) mymalloc2("PMrho_k", pm->priv->fftsize * sizeof(double));
298 
299  /*Do any analysis that may be required before the transfer function is applied*/
301  if(global_readout)
302  pm_apply_transfer_function(pm, complx, rho_k, global_readout);
305  /*Apply the transfer function*/
307  pm_apply_transfer_function(pm, complx, rho_k, global_transfer);
308  walltime_measure("/PMgrav/r2c");
309 
310  report_memory_usage("PetaPM");
311 
312  myfree(complx);
313  return rho_k;
314 }
#define report_memory_usage(x)
Definition: mymalloc.h:30
static void layout_build_and_exchange_cells_to_pfft(PetaPM *pm, struct Layout *L, double *meshbuf, double *real)
Definition: petapm.c:583
petapm_transfer_func global_transfer
Definition: petapm.h:104
void(* global_analysis)(PetaPM *pm)
Definition: petapm.h:103
petapm_transfer_func global_readout
Definition: petapm.h:102
size_t meshbufsize
Definition: petapm.h:58

References PetaPMPriv::fftsize, PetaPMGlobalFunctions::global_analysis, global_functions, PetaPMGlobalFunctions::global_readout, PetaPMGlobalFunctions::global_transfer, PetaPMPriv::layout, layout_build_and_exchange_cells_to_pfft(), PetaPMPriv::meshbuf, PetaPMPriv::meshbufsize, myfree, mymalloc, mymalloc2, PetaPMPriv::plan_forw, pm_apply_transfer_function(), PetaPM::priv, report_memory_usage, and walltime_measure.

Referenced by petapm_force().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ petapm_get_fourier_region()

PetaPMRegion* petapm_get_fourier_region ( PetaPM pm)

Definition at line 64 of file petapm.c.

64  {
65  return &pm->fourier_space_region;
66 }
PetaPMRegion fourier_space_region
Definition: petapm.h:66

References PetaPM::fourier_space_region.

Referenced by displacement_fields().

Here is the caller graph for this function:

◆ petapm_get_ntask2d()

int* petapm_get_ntask2d ( PetaPM pm)

Definition at line 77 of file petapm.c.

77  {
78  return pm->NTask2d;
79 }
int NTask2d[2]
Definition: petapm.h:74

References PetaPM::NTask2d.

Referenced by idgen_init().

Here is the caller graph for this function:

◆ petapm_get_real_region()

PetaPMRegion* petapm_get_real_region ( PetaPM pm)

Definition at line 67 of file petapm.c.

67  {
68  return &pm->real_space_region;
69 }
PetaPMRegion real_space_region
Definition: petapm.h:65

References PetaPM::real_space_region.

◆ petapm_get_thistask2d()

int* petapm_get_thistask2d ( PetaPM pm)

Definition at line 74 of file petapm.c.

74  {
75  return pm->ThisTask2d;
76 }
int ThisTask2d[2]
Definition: petapm.h:73

References PetaPM::ThisTask2d.

Referenced by idgen_init().

Here is the caller graph for this function:

◆ petapm_init()

void petapm_init ( PetaPM pm,
double  BoxSize,
double  Asmth,
int  Nmesh,
double  G,
MPI_Comm  comm 
)

Definition at line 94 of file petapm.c.

95 {
96  /* define the global long / short range force cut */
97  pm->BoxSize = BoxSize;
98  pm->Asmth = Asmth;
99  pm->Nmesh = Nmesh;
100  pm->G = G;
101  pm->CellSize = BoxSize / Nmesh;
102  pm->comm = comm;
103 
104  ptrdiff_t n[3] = {Nmesh, Nmesh, Nmesh};
105  ptrdiff_t np[2];
106 
107  int ThisTask;
108  int NTask;
109 
110  pm->Mesh2Task[0] = (int *) mymalloc2("Mesh2Task", 2*sizeof(int) * Nmesh);
111  pm->Mesh2Task[1] = pm->Mesh2Task[0] + Nmesh;
112 
113  MPI_Comm_rank(comm, &ThisTask);
114  MPI_Comm_size(comm, &NTask);
115 
116  /* try to find a square 2d decomposition */
117  int i;
118  int k;
119  for(i = sqrt(NTask) + 1; i >= 0; i --) {
120  if(NTask % i == 0) break;
121  }
122  np[0] = i;
123  np[1] = NTask / i;
124 
125  message(0, "Using 2D Task mesh %td x %td \n", np[0], np[1]);
126  if( pfft_create_procmesh_2d(comm, np[0], np[1], &pm->priv->comm_cart_2d) ){
127  endrun(0, "Error: This test file only works with %td processes.\n", np[0]*np[1]);
128  }
129 
130  int periods_unused[2];
131  MPI_Cart_get(pm->priv->comm_cart_2d, 2, pm->NTask2d, periods_unused, pm->ThisTask2d);
132 
133  if(pm->NTask2d[0] != np[0]) abort();
134  if(pm->NTask2d[1] != np[1]) abort();
135 
136  pm->priv->fftsize = 2 * pfft_local_size_dft_r2c_3d(n, pm->priv->comm_cart_2d,
137  PFFT_TRANSPOSED_OUT,
140 
141  /*
142  * In fourier space, the transposed array is ordered in
143  * are in (y, z, x). The strides and sizes returned
144  * from local size is in (Nx, Ny, Nz), hence we roll them once
145  * so that the strides will give correct linear indexing for
146  * integer coordinates given in order of (y, z, x).
147  * */
148 
149 #define ROLL(a, N, j) { \
150  typeof(a[0]) tmp[N]; \
151  ptrdiff_t k; \
152  for(k = 0; k < N; k ++) tmp[k] = a[k]; \
153  for(k = 0; k < N; k ++) a[k] = tmp[(k + j)% N]; \
154  }
155 
156  ROLL(pm->fourier_space_region.offset, 3, 1);
157  ROLL(pm->fourier_space_region.size, 3, 1);
158 
159 #undef ROLL
160 
161  /* calculate the strides */
164 
165  /* planning the fft; need temporary arrays */
166 
167  double * real = (double * ) mymalloc("PMreal", pm->priv->fftsize * sizeof(double));
168  pfft_complex * rho_k = (pfft_complex * ) mymalloc("PMrho_k", pm->priv->fftsize * sizeof(double));
169  pfft_complex * complx = (pfft_complex *) mymalloc("PMcomplex", pm->priv->fftsize * sizeof(double));
170 
171  pm->priv->plan_forw = pfft_plan_dft_r2c_3d(
172  n, real, rho_k, pm->priv->comm_cart_2d, PFFT_FORWARD,
173  PFFT_TRANSPOSED_OUT | PFFT_ESTIMATE | PFFT_TUNE | PFFT_DESTROY_INPUT);
174  pm->priv->plan_back = pfft_plan_dft_c2r_3d(
175  n, complx, real, pm->priv->comm_cart_2d, PFFT_BACKWARD,
176  PFFT_TRANSPOSED_IN | PFFT_ESTIMATE | PFFT_TUNE | PFFT_DESTROY_INPUT);
177 
178  myfree(complx);
179  myfree(rho_k);
180  myfree(real);
181 
182  /* now lets fill up the mesh2task arrays */
183 
184 #if 0
185  message(1, "ThisTask = %d (%td %td %td) - (%td %td %td)\n", ThisTask,
186  pm->real_space_region.offset[0],
187  pm->real_space_region.offset[1],
188  pm->real_space_region.offset[2],
189  pm->real_space_region.size[0],
190  pm->real_space_region.size[1],
191  pm->real_space_region.size[2]);
192 #endif
193 
194  int * tmp = (int *) mymalloc("tmp", sizeof(int) * Nmesh);
195  for(k = 0; k < 2; k ++) {
196  for(i = 0; i < Nmesh; i ++) {
197  tmp[i] = 0;
198  }
199  for(i = 0; i < pm->real_space_region.size[k]; i ++) {
200  tmp[i + pm->real_space_region.offset[k]] = pm->ThisTask2d[k];
201  }
202  /* which column / row hosts this tile? */
203  /* FIXME: this is very inefficient */
204  MPI_Allreduce(tmp, pm->Mesh2Task[k], Nmesh, MPI_INT, MPI_MAX, comm);
205  /*
206  for(i = 0; i < Nmesh; i ++) {
207  message(0, "Mesh2Task[%d][%d] == %d\n", k, i, Mesh2Task[k][i]);
208  }
209  */
210  }
211  myfree(tmp);
212 }
void message(int where, const char *fmt,...)
Definition: endrun.c:175
void endrun(int where, const char *fmt,...)
Definition: endrun.c:147
#define ROLL(a, N, j)
void petapm_region_init_strides(PetaPMRegion *region)
Definition: petapm.c:813
int Nmesh
Definition: petapm.h:68
double CellSize
Definition: petapm.h:67
double G
Definition: petapm.h:71
double BoxSize
Definition: petapm.h:70
double Asmth
Definition: petapm.h:69
ptrdiff_t size[3]
Definition: petapm.h:10
ptrdiff_t offset[3]
Definition: petapm.h:9
int ThisTask
Definition: test_exchange.c:23
int NTask
Definition: test_exchange.c:23
static const double G
Definition: test_gravity.c:35

References PetaPM::Asmth, PetaPM::BoxSize, PetaPM::CellSize, PetaPM::comm, PetaPMPriv::comm_cart_2d, endrun(), PetaPMPriv::fftsize, PetaPM::fourier_space_region, PetaPM::G, G, PetaPM::Mesh2Task, message(), myfree, mymalloc, mymalloc2, PetaPM::Nmesh, NTask, PetaPM::NTask2d, Region::offset, petapm_region_init_strides(), PetaPMPriv::plan_back, PetaPMPriv::plan_forw, PetaPM::priv, PetaPM::real_space_region, ROLL, Region::size, ThisTask, and PetaPM::ThisTask2d.

Referenced by gravpm_init_periodic(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ petapm_mesh_to_k()

int petapm_mesh_to_k ( PetaPM pm,
int  i 
)

Definition at line 70 of file petapm.c.

70  {
71  /*Return the position of this point on the Fourier mesh*/
72  return i<=pm->Nmesh/2 ? i : (i-pm->Nmesh);
73 }

References PetaPM::Nmesh.

Referenced by pm_apply_transfer_function().

Here is the caller graph for this function:

◆ petapm_module_init()

void petapm_module_init ( int  Nthreads)

Definition at line 82 of file petapm.c.

83 {
84  pfft_init();
85 
86  pfft_plan_with_nthreads(Nthreads);
87 
88  /* initialize the MPI Datatype of pencil */
89  MPI_Type_contiguous(sizeof(struct Pencil), MPI_BYTE, &MPI_PENCIL);
90  MPI_Type_commit(&MPI_PENCIL);
91 }
static MPI_Datatype MPI_PENCIL
Definition: petapm.c:46
Definition: petapm.c:29

References MPI_PENCIL.

Referenced by begrun(), main(), and setup_tree().

Here is the caller graph for this function:

◆ petapm_region_init_strides()

void petapm_region_init_strides ( PetaPMRegion region)

Definition at line 813 of file petapm.c.

813  {
814  int k;
815  size_t rt = 1;
816  for(k = 2; k >= 0; k --) {
817  region->strides[k] = rt;
818  rt = region->size[k] * rt;
819  }
820  region->totalsize = rt;
821  region->buffer = NULL;
822 }
size_t totalsize
Definition: petapm.h:12
double * buffer
Definition: petapm.h:13
ptrdiff_t strides[3]
Definition: petapm.h:11

References Region::buffer, Region::size, Region::strides, and Region::totalsize.

Referenced by _prepare(), convert_node_to_region(), makeregion(), and petapm_init().

Here is the caller graph for this function: