CudaPmePencilZ Class Reference

#include <CudaPmeSolver.h>

List of all members.

Public Member Functions

CudaPmePencilZ_SDAG_CODE CudaPmePencilZ ()
 CudaPmePencilZ (CkMigrateMessage *m)
 ~CudaPmePencilZ ()
void initialize (CudaPmeXInitMsg *msg)
void initialize (CudaPmeXYInitMsg *msg)
void initializeDevice (InitDeviceMsg2 *msg)
void energyAndVirialDone ()


Detailed Description

Definition at line 175 of file CudaPmeSolver.h.


Constructor & Destructor Documentation

CudaPmePencilZ_SDAG_CODE CudaPmePencilZ::CudaPmePencilZ (  )  [inline]

Definition at line 178 of file CudaPmeSolver.h.

00178 : numGetDeviceBufferY(0), numGetDeviceBufferXY(0), eventCreated(false) {}

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

Definition at line 179 of file CudaPmeSolver.h.

00179 : numGetDeviceBufferY(0), numGetDeviceBufferXY(0), eventCreated(false) {}

CudaPmePencilZ::~CudaPmePencilZ (  ) 

Definition at line 732 of file CudaPmeSolver.C.

References cudaCheck.

00732                                 {
00733   if (eventCreated) cudaCheck(cudaEventDestroy(event));
00734 }


Member Function Documentation

void CudaPmePencilZ::energyAndVirialDone (  ) 

Definition at line 932 of file CudaPmeSolver.C.

00932                                          {
00933   submitReductions();
00934 }

void CudaPmePencilZ::initialize ( CudaPmeXYInitMsg msg  ) 

Definition at line 721 of file CudaPmeSolver.C.

References CudaPmeXYInitMsg::pmeGrid, CudaPmeXYInitMsg::pmePencilXY, and CudaPmeXYInitMsg::xyMap.

00721                                                      {
00722   useXYslab = true;
00723   pmeGrid = msg->pmeGrid;
00724   pmePencilXY = msg->pmePencilXY;
00725   xyMap = msg->xyMap;
00726 
00727   delete msg;
00728 
00729   initBlockSizes();
00730 }

void CudaPmePencilZ::initialize ( CudaPmeXInitMsg msg  ) 

Definition at line 710 of file CudaPmeSolver.C.

References CudaPmeXInitMsg::pmeGrid, CudaPmeXInitMsg::pmePencilY, and CudaPmeXInitMsg::yMap.

00710                                                     {
00711   useXYslab = false;
00712   pmeGrid = msg->pmeGrid;
00713   pmePencilY = msg->pmePencilY;
00714   yMap = msg->yMap;
00715 
00716   delete msg;
00717 
00718   initBlockSizes();
00719 }

void CudaPmePencilZ::initializeDevice ( InitDeviceMsg2 msg  ) 

Definition at line 739 of file CudaPmeSolver.C.

References cudaCheck, InitDeviceMsg2::deviceID, ComputeNonbondedUtil::ewaldcof, InitDeviceMsg2::mgrProxy, Perm_Z_cX_Y, InitDeviceMsg2::stream, and z.

00739                                                          {
00740   // Get device proxy
00741   // CProxy_ComputePmeCUDADevice deviceProxy = msg->deviceProxy;
00742   deviceID = msg->deviceID;
00743   stream = msg->stream;
00744   CProxy_ComputePmeCUDAMgr mgrProxy = msg->mgrProxy;
00745   delete msg;
00746   // deviceID = deviceProxy.ckLocalBranch()->getDeviceID();
00747   // cudaStream_t stream = deviceProxy.ckLocalBranch()->getStream();
00748   // CProxy_ComputePmeCUDAMgr mgrProxy = deviceProxy.ckLocalBranch()->getMgrProxy();
00749   // Setup fftCompute and pmeKSpaceCompute
00750   fftCompute = new CudaFFTCompute(deviceID, stream);
00751   pmeTranspose = new CudaPmeTranspose(pmeGrid, Perm_Z_cX_Y, thisIndex.x, thisIndex.y, deviceID, stream);
00752   pmeKSpaceCompute = new CudaPmeKSpaceCompute(pmeGrid, Perm_Z_cX_Y, thisIndex.x, thisIndex.y,
00753     ComputeNonbondedUtil::ewaldcof, deviceID, stream);
00754 
00755   // Create event. NOTE: Events are tied to devices, hence the cudaSetDevice() here
00756   cudaCheck(cudaSetDevice(deviceID));
00757   cudaCheck(cudaEventCreateWithFlags(&event, cudaEventDisableTiming));
00758   eventCreated = true;
00759 
00760   deviceBuffers.resize(pmeGrid.zBlocks, DeviceBuffer(-1, false, NULL));
00761   numDeviceBuffers = 0;
00762 
00763   if (useXYslab) {
00764     for (int z=0;z < pmeGrid.zBlocks;z++) {
00765       int pe = xyMap.ckLocalBranch()->procNum(0, CkArrayIndex3D(0,0,z));
00766       if (CkNodeOf(pe) == CkMyNode()) {
00767         int deviceID0 = mgrProxy.ckLocalBranch()->getDeviceIDPencilX(0, z);
00768         // Check for Peer-to-Peer access
00769         int canAccessPeer = 0;
00770         if (deviceID != deviceID0) {
00771           cudaCheck(cudaSetDevice(deviceID));
00772           cudaCheck(cudaDeviceCanAccessPeer(&canAccessPeer, deviceID, deviceID0));
00773         }
00774 #ifdef DISABLE_P2P
00775         canAccessPeer = 0;
00776 #endif
00777         numDeviceBuffers++;
00778         deviceBuffers[z] = DeviceBuffer(deviceID0, canAccessPeer, NULL);
00779         pmePencilXY(0,0,z).getDeviceBuffer(thisIndex.x, (deviceID0 == deviceID) || canAccessPeer, thisProxy);
00780       }
00781     }
00782   } else {
00783     for (int z=0;z < pmeGrid.zBlocks;z++) {
00784       int pe = yMap.ckLocalBranch()->procNum(0, CkArrayIndex3D(thisIndex.x,0,z));
00785       if (CkNodeOf(pe) == CkMyNode()) {
00786         int deviceID0 = mgrProxy.ckLocalBranch()->getDeviceIDPencilY(thisIndex.x, z);
00787         numDeviceBuffers++;
00788         deviceBuffers[z] = DeviceBuffer(deviceID0, false, NULL);
00789         pmePencilY(thisIndex.x,0,z).getDeviceBuffer(thisIndex.y, (deviceID0 == deviceID), thisProxy);
00790       }
00791     }
00792   }
00793 
00794 }


The documentation for this class was generated from the following files:
Generated on Mon Sep 25 01:17:17 2017 for NAMD by  doxygen 1.4.7