OptPmePencilMapX Class Reference

#include <fftmap.h>

List of all members.

Public Member Functions

 OptPmePencilMapX (int xblock, int yblock, int zblock)
void initialize ()
 OptPmePencilMapX (CkMigrateMessage *m)
int procNum (int foo, const CkArrayIndex &idx)


Detailed Description

Definition at line 106 of file fftmap.h.


Constructor & Destructor Documentation

OptPmePencilMapX::OptPmePencilMapX ( int  xblock,
int  yblock,
int  zblock 
) [inline]

Definition at line 113 of file fftmap.h.

References global_map_x, PmeFFTInfo::xBlocks, PmeFFTInfo::yBlocks, and PmeFFTInfo::zBlocks.

00113                                                        {
00114     _initialized = false;
00115     _info.xBlocks = xblock;
00116     _info.yBlocks = yblock;
00117     _info.zBlocks = zblock;    
00118     global_map_x = thisProxy;   
00119   }

OptPmePencilMapX::OptPmePencilMapX ( CkMigrateMessage *  m  )  [inline]

Definition at line 143 of file fftmap.h.

00143 {}


Member Function Documentation

void OptPmePencilMapX::initialize ( void   )  [inline]

Definition at line 121 of file fftmap.h.

References initializePmeMap(), pencilPMEProcessors, y, PmeFFTInfo::yBlocks, z, and PmeFFTInfo::zBlocks.

Referenced by procNum().

00121                             {
00122     _initialized = true;
00123     _mapcache = (int *) malloc(_info.yBlocks * _info.zBlocks * sizeof(int));
00124     
00125     SortableResizeArray<int>    xprocs;
00126     SortableResizeArray<int>    yprocs;
00127     SortableResizeArray<int>    zprocs;
00128     
00129     initializePmeMap (_info, xprocs, yprocs, zprocs);
00130     
00131     for (int y = 0; y < _info.yBlocks; y++) {
00132       for (int z = 0; z < _info.zBlocks; z ++) {
00133         int index = z + y * _info.zBlocks;
00134         int pe = xprocs[index];
00135         _mapcache[index] = pe;
00136         
00137         if(CkMyRank() == 0) 
00138           pencilPMEProcessors[pe] = 1;
00139       }
00140     }
00141   }

int OptPmePencilMapX::procNum ( int  foo,
const CkArrayIndex &  idx 
) [inline]

Definition at line 145 of file fftmap.h.

References initialize(), and PmeFFTInfo::zBlocks.

00145                                                 {
00146     if (!_initialized) initialize();
00147 
00148     CkArrayIndex3D idx3d = *(CkArrayIndex3D *) &idx;
00149     int index = idx3d.index[2] + idx3d.index[1] * _info.zBlocks;
00150     
00151     return _mapcache[index];
00152   }


The documentation for this class was generated from the following file:
Generated on Wed Sep 20 01:17:19 2017 for NAMD by  doxygen 1.4.7