CudaPmePencilXY Class Reference

#include <CudaPmeSolver.h>

List of all members.

Public Member Functions

CudaPmePencilXY_SDAG_CODE CudaPmePencilXY ()
 CudaPmePencilXY (CkMigrateMessage *m)
 ~CudaPmePencilXY ()
void initialize (CudaPmeXYInitMsg *msg)
void initializeDevice (InitDeviceMsg *msg)


Detailed Description

Definition at line 84 of file CudaPmeSolver.h.


Constructor & Destructor Documentation

CudaPmePencilXY_SDAG_CODE CudaPmePencilXY::CudaPmePencilXY (  )  [inline]

Definition at line 87 of file CudaPmeSolver.h.

00087 : numGetDeviceBuffer(0), eventCreated(false) {}

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

Definition at line 88 of file CudaPmeSolver.h.

00088 : numGetDeviceBuffer(0), eventCreated(false) {}

CudaPmePencilXY::~CudaPmePencilXY (  ) 

Definition at line 66 of file CudaPmeSolver.C.

References cudaCheck.

00066                                   {
00067   if (eventCreated) cudaCheck(cudaEventDestroy(event));
00068 }


Member Function Documentation

void CudaPmePencilXY::initialize ( CudaPmeXYInitMsg msg  ) 

Definition at line 56 of file CudaPmeSolver.C.

References CudaPmeXYInitMsg::pmeGrid, CudaPmeXYInitMsg::pmePencilZ, and CudaPmeXYInitMsg::zMap.

00056                                                       {
00057   pmeGrid = msg->pmeGrid;
00058   pmePencilZ = msg->pmePencilZ;
00059   zMap = msg->zMap;
00060 
00061   delete msg;
00062 
00063   initBlockSizes();
00064 }

void CudaPmePencilXY::initializeDevice ( InitDeviceMsg msg  ) 

Definition at line 73 of file CudaPmeSolver.C.

References cudaCheck, InitDeviceMsg::deviceProxy, Perm_cX_Y_Z, and x.

00073                                                          {
00074   // Store device proxy
00075   deviceProxy = msg->deviceProxy;
00076   delete msg;
00077   deviceID = deviceProxy.ckLocalBranch()->getDeviceID();
00078   stream = deviceProxy.ckLocalBranch()->getStream();
00079   CProxy_ComputePmeCUDAMgr mgrProxy = deviceProxy.ckLocalBranch()->getMgrProxy();
00080   // Setup fftCompute and pmeKSpaceCompute
00081   fftCompute = new CudaFFTCompute(deviceID, stream);
00082   pmeTranspose = new CudaPmeTranspose(pmeGrid, Perm_cX_Y_Z, 0, thisIndex.z, deviceID, stream);  
00083 
00084   deviceBuffers.resize(pmeGrid.xBlocks, DeviceBuffer(-1, false, NULL));
00085   numDeviceBuffers = 0;
00086 
00087   // Create event. NOTE: Events are tied to devices, hence the cudaSetDevice() here
00088   cudaCheck(cudaSetDevice(deviceID));
00089   cudaCheck(cudaEventCreateWithFlags(&event, cudaEventDisableTiming));
00090   eventCreated = true;
00091 
00092 /*
00093   bool useMultiGPUfft = true;
00094   bool allDeviceOnSameNode = true;
00095   for (int x=0;x < pmeGrid.xBlocks;x++) {
00096     int pe = zMap.ckLocalBranch()->procNum(0, CkArrayIndex3D(x,0,0));
00097     allDeviceOnSameNode &= (CkNodeOf(pe) == CkMyNode());
00098   }
00099 
00100   if (useMultiGPUfft && allDeviceOnSameNode && pmeGrid.xBlocks > 1) {
00101 
00102 
00103 
00104   } else {
00105 */
00106 
00107   for (int x=0;x < pmeGrid.xBlocks;x++) {
00108     int pe = zMap.ckLocalBranch()->procNum(0, CkArrayIndex3D(x,0,0));
00109     if (CkNodeOf(pe) == CkMyNode()) {
00110       // Get device ID on a device on this node
00111       int deviceID0 = mgrProxy.ckLocalBranch()->getDeviceIDPencilZ(x, 0);
00112       // Check for Peer-to-Peer access
00113       int canAccessPeer = 0;
00114       if (deviceID != deviceID0) {
00115         cudaCheck(cudaSetDevice(deviceID));
00116         cudaCheck(cudaDeviceCanAccessPeer(&canAccessPeer, deviceID, deviceID0));
00117 #ifdef DISABLE_P2P
00118         canAccessPeer = 0;
00119 #endif
00120         if (canAccessPeer) {
00121           unsigned int flags = 0;
00122           cudaCheck(cudaDeviceEnablePeerAccess(deviceID0, flags));
00123           // fprintf(stderr, "device %d can access device %d\n", deviceID, deviceID0);
00124         }
00125       }
00126       numDeviceBuffers++;
00127       deviceBuffers[x] = DeviceBuffer(deviceID0, canAccessPeer, NULL);
00128       pmePencilZ(x,0,0).getDeviceBuffer(thisIndex.z, (deviceID0 == deviceID) || canAccessPeer, thisProxy);
00129     }
00130   }
00131 
00132   // }
00133 
00134 }


The documentation for this class was generated from the following files:
Generated on Thu Nov 23 01:17:18 2017 for NAMD by  doxygen 1.4.7