PmeSolverUtil.h File Reference

#include "PmeBase.h"
#include "NamdTypes.h"
#include "Lattice.h"

Go to the source code of this file.

Classes

struct  PatchInfo
class  FFTCompute
class  PmeKSpaceCompute
class  PmeRealSpaceCompute
class  PmeTranspose

Enumerations

enum  { Perm_X_Y_Z, Perm_cX_Y_Z, Perm_Y_Z_cX, Perm_Z_cX_Y }

Functions

static int getPencilIndexY (const PmeGrid &pmeGrid, const int y)
static int getPencilIndexZ (const PmeGrid &pmeGrid, const int z)
static void getPencilDim (const PmeGrid &pmeGrid, const int permutation, const int jblock, const int kblock, int &i0, int &i1, int &j0, int &j1, int &k0, int &k1)
static void getBlockDim (const PmeGrid &pmeGrid, const int permutation, const int iblock, const int jblock, const int kblock, int &i0, int &i1, int &j0, int &j1, int &k0, int &k1)


Enumeration Type Documentation

anonymous enum

Enumerator:
Perm_X_Y_Z 
Perm_cX_Y_Z 
Perm_Y_Z_cX 
Perm_Z_cX_Y 

Definition at line 17 of file PmeSolverUtil.h.


Function Documentation

static void getBlockDim ( const PmeGrid pmeGrid,
const int  permutation,
const int  iblock,
const int  jblock,
const int  kblock,
int &  i0,
int &  i1,
int &  j0,
int &  j1,
int &  k0,
int &  k1 
) [static]

Definition at line 86 of file PmeSolverUtil.h.

References getPencilDim(), NAMD_bug(), Perm_cX_Y_Z, Perm_X_Y_Z, Perm_Y_Z_cX, Perm_Z_cX_Y, PmeGrid::xBlocks, PmeGrid::yBlocks, and PmeGrid::zBlocks.

Referenced by CudaPmeTranspose::copyDataDeviceToDevice(), CudaPmeTranspose::copyDataHostToDevice(), CudaPmeTranspose::getBuffer(), PmePencilZ::initBlockSizes(), PmePencilY::initBlockSizes(), PmePencilX::initBlockSizes(), PmePencilXY::initBlockSizes(), and PmeTranspose::PmeTranspose().

00088                                                         {
00089 
00090   getPencilDim(pmeGrid, permutation, jblock, kblock, i0, i1, j0, j1, k0, k1);
00091 
00092   int iblocks;
00093 
00094   switch(permutation) {
00095     case Perm_X_Y_Z:
00096     iblocks = pmeGrid.xBlocks;
00097     break;
00098     case Perm_cX_Y_Z:
00099     iblocks = pmeGrid.xBlocks;
00100     break;
00101     case Perm_Y_Z_cX:
00102     iblocks = pmeGrid.yBlocks;
00103     break;
00104     case Perm_Z_cX_Y:
00105     iblocks = pmeGrid.zBlocks;
00106     break;
00107     default:
00108     NAMD_bug("getBlockDim, invalid permutation");
00109     break;
00110   }
00111 
00112   if (iblock < 0 || iblock >= iblocks)
00113     NAMD_bug("getBlockDim, invalid block index");
00114 
00115   int isize = i1-i0+1;
00116 
00117   i0 = isize*iblock/iblocks;
00118   i1 = isize*(iblock+1)/iblocks - 1;
00119 }

static void getPencilDim ( const PmeGrid pmeGrid,
const int  permutation,
const int  jblock,
const int  kblock,
int &  i0,
int &  i1,
int &  j0,
int &  j1,
int &  k0,
int &  k1 
) [static]

Definition at line 29 of file PmeSolverUtil.h.

References PmeGrid::K1, PmeGrid::K2, PmeGrid::K3, NAMD_bug(), Perm_cX_Y_Z, Perm_X_Y_Z, Perm_Y_Z_cX, Perm_Z_cX_Y, PmeGrid::xBlocks, PmeGrid::yBlocks, and PmeGrid::zBlocks.

Referenced by getBlockDim(), ComputePmeCUDAMgr::getHomePencil(), FFTCompute::init(), PmeKSpaceCompute::PmeKSpaceCompute(), PmeRealSpaceCompute::PmeRealSpaceCompute(), and PmeTranspose::PmeTranspose().

00031                                                         {
00032 
00033   int isize, jsize, ksize;
00034   int jblocks, kblocks;
00035 
00036   switch(permutation) {
00037     case Perm_X_Y_Z:
00038     isize = pmeGrid.K1;
00039     jsize = pmeGrid.K2;
00040     ksize = pmeGrid.K3;
00041     jblocks = pmeGrid.yBlocks;
00042     kblocks = pmeGrid.zBlocks;
00043     break;
00044     case Perm_cX_Y_Z:
00045     isize = pmeGrid.K1/2+1;
00046     jsize = pmeGrid.K2;
00047     ksize = pmeGrid.K3;
00048     jblocks = pmeGrid.yBlocks;
00049     kblocks = pmeGrid.zBlocks;
00050     break;
00051     case Perm_Y_Z_cX:
00052     isize = pmeGrid.K2;
00053     jsize = pmeGrid.K3;
00054     ksize = pmeGrid.K1/2+1;
00055     jblocks = pmeGrid.zBlocks;
00056     kblocks = pmeGrid.xBlocks;
00057     break;
00058     case Perm_Z_cX_Y:
00059     isize = pmeGrid.K3;
00060     jsize = pmeGrid.K1/2+1;
00061     ksize = pmeGrid.K2;
00062     jblocks = pmeGrid.xBlocks;
00063     kblocks = pmeGrid.yBlocks;
00064     break;
00065     default:
00066     NAMD_bug("getPencilDim, invalid permutation");
00067     break;
00068   }
00069 
00070   if (jblock < 0 || jblock >= jblocks || kblock < 0 || kblock >= kblocks)
00071     NAMD_bug("getPencilDim, invalid block indices");
00072 
00073   i0 = 0;
00074   i1 = isize - 1;
00075 
00076   j0 = jsize*jblock/jblocks;
00077   j1 = jsize*(jblock+1)/jblocks - 1;
00078 
00079   k0 = ksize*kblock/kblocks;
00080   k1 = ksize*(kblock+1)/kblocks - 1;
00081 }

static int getPencilIndexY ( const PmeGrid pmeGrid,
const int  y 
) [inline, static]

Definition at line 20 of file PmeSolverUtil.h.

References PmeGrid::K2, and PmeGrid::yBlocks.

Referenced by PmeAtomFiler::fileAtoms().

00020                                                                        {
00021   return (y*pmeGrid.yBlocks + pmeGrid.yBlocks - 1)/pmeGrid.K2;
00022 }

static int getPencilIndexZ ( const PmeGrid pmeGrid,
const int  z 
) [inline, static]

Definition at line 25 of file PmeSolverUtil.h.

References PmeGrid::K3, and PmeGrid::zBlocks.

Referenced by PmeAtomFiler::fileAtoms().

00025                                                                        {
00026   return (z*pmeGrid.zBlocks + pmeGrid.zBlocks - 1)/pmeGrid.K3;
00027 }


Generated on Tue Sep 19 01:17:15 2017 for NAMD by  doxygen 1.4.7