PmeXPencil Class Reference

Inheritance diagram for PmeXPencil:
PmePencil< CBase_PmeXPencil > CBase_PmeXPencil

List of all members.

Public Member Functions

PmeXPencil_SDAG_CODE PmeXPencil ()
 PmeXPencil (CkMigrateMessage *)
 ~PmeXPencil ()
void fft_init ()
void recv_trans (const PmeTransMsg *)
void forward_fft ()
void pme_kspace ()
void backward_fft ()
void send_untrans ()
void send_subset_untrans (int fromIdx, int toIdx)
void node_process_trans (PmeTransMsg *)
void evir_init ()

Public Attributes

fftw_plan forward_plan
fftw_plan backward_plan
int ny
int nz
int recipEvirPe
PmeKSpacemyKSpace

Detailed Description

Definition at line 4673 of file ComputePme.C.


Constructor & Destructor Documentation

PmeXPencil_SDAG_CODE PmeXPencil::PmeXPencil (  )  [inline]

Definition at line 4676 of file ComputePme.C.

References PmePencil< CBase_PmeXPencil >::imsg, PmePencil< CBase_PmeXPencil >::imsgb, myKSpace, and recipEvirPe.

04676 { __sdag_init();  myKSpace = 0; setMigratable(false); imsg=imsgb=0; recipEvirPe = -999; }

PmeXPencil::PmeXPencil ( CkMigrateMessage *   )  [inline]

Definition at line 4677 of file ComputePme.C.

04677 { __sdag_init(); }

PmeXPencil::~PmeXPencil (  )  [inline]

Definition at line 4678 of file ComputePme.C.

04678                       {
04679         #ifdef NAMD_FFTW
04680         #ifdef NAMD_FFTW_3
04681                 delete [] forward_plans;
04682                 delete [] backward_plans;
04683         #endif
04684         #endif
04685         }


Member Function Documentation

void PmeXPencil::backward_fft (  ) 

Definition at line 5686 of file ComputePme.C.

References backward_plan, CKLOOP_CTRL_PME_BACKWARDFFT, PmePencil< CBase_PmeXPencil >::data, PmePencilInitMsgData::grid, PmePencil< CBase_PmeXPencil >::initdata, PmeGrid::K1, Node::Object(), PmeXZPencilFFT(), Node::simParameters, SimParameters::useCkLoop, PmePencil< CBase_PmeXPencil >::work, PmePencilInitMsgData::yBlocks, and PmePencilInitMsgData::zBlocks.

Referenced by node_process_trans().

05686                               {
05687 #ifdef NAMD_FFTW
05688 #ifdef MANUAL_DEBUG_FFTW3
05689   dumpMatrixFloat3("bw_x_b", data, initdata.grid.K1, ny, nz, thisIndex.x, thisIndex.y, thisIndex.z);
05690 #endif
05691 
05692 #ifdef NAMD_FFTW_3
05693 #if     CMK_SMP && USE_CKLOOP
05694   int useCkLoop = Node::Object()->simParameters->useCkLoop;
05695   if(useCkLoop>=CKLOOP_CTRL_PME_BACKWARDFFT
05696      && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks) {
05697           //for(int i=0; i<numPlans; i++) fftwf_execute(backward_plans[i]);
05698           //transform the above loop
05699           CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)backward_plans, CkMyNodeSize(), 0, numPlans-1); //sync
05700           return;
05701   }
05702 #endif
05703   fftwf_execute(backward_plan);
05704 #else
05705   fftw(backward_plan, ny*nz,
05706         ((fftw_complex *) data), ny*nz, 1, (fftw_complex *) work, 1, 0);
05707 #endif
05708 #ifdef MANUAL_DEBUG_FFTW3
05709   dumpMatrixFloat3("bw_x_a", data, initdata.grid.K1, ny, nz, thisIndex.x, thisIndex.y, thisIndex.z);
05710 #endif
05711 #endif
05712 }

void PmeXPencil::evir_init (  ) 

Definition at line 4731 of file ComputePme.C.

References findRecipEvirPe(), PmePencil< CBase_PmeXPencil >::initdata, PmePencilInitMsgData::pmeProxy, and recipEvirPe.

04731                            {
04732   recipEvirPe = findRecipEvirPe();
04733   initdata.pmeProxy[recipEvirPe].addRecipEvirClient();
04734 }

void PmeXPencil::fft_init (  ) 

Definition at line 5009 of file ComputePme.C.

References backward_plan, PmeGrid::block2, PmeGrid::block3, PmePencil< CBase_PmeXPencil >::data, PmeGrid::dim3, SimParameters::FFTWEstimate, fftwf_malloc, SimParameters::FFTWPatient, forward_plan, PmePencilInitMsgData::grid, if(), PmePencil< CBase_PmeXPencil >::initdata, PmeGrid::K1, PmeGrid::K2, myKSpace, NAMD_die(), PmePencil< CBase_PmeXPencil >::order_init(), PmePencilInitMsgData::pmeNodeProxy, Node::simParameters, SimParameters::useCkLoop, PmePencil< CBase_PmeXPencil >::work, and PmePencilInitMsgData::xBlocks.

05009                           {
05010   CProxy_Node nd(CkpvAccess(BOCclass_group).node);
05011   Node *node = nd.ckLocalBranch();
05012   SimParameters *simParams = node->simParameters;
05013 #if USE_NODE_PAR_RECEIVE
05014   ((NodePmeMgr *)CkLocalNodeBranch(initdata.pmeNodeProxy))->registerXPencil(thisIndex,this);
05015 #endif
05016 
05017   int K1 = initdata.grid.K1;
05018   int K2 = initdata.grid.K2;
05019   int dim3 = initdata.grid.dim3;
05020   int block2 = initdata.grid.block2;
05021   int block3 = initdata.grid.block3;
05022 
05023   ny = block2;
05024   if ( (thisIndex.y + 1) * block2 > K2 ) ny = K2 - thisIndex.y * block2;
05025   nz = block3;
05026   if ( (thisIndex.z+1)*block3 > dim3/2 ) nz = dim3/2 - thisIndex.z*block3;
05027 
05028 #ifdef NAMD_FFTW
05029   CmiLock(ComputePmeMgr::fftw_plan_lock);
05030 
05031   data = (float *) fftwf_malloc( sizeof(float) * K1*ny*nz*2);
05032   work = new float[2*K1];
05033 
05034   order_init(initdata.xBlocks);
05035 
05036 #ifdef NAMD_FFTW_3
05037   /* need array of sizes for the how many */
05038   int fftwFlags = simParams->FFTWPatient ? FFTW_PATIENT  : simParams->FFTWEstimate ? FFTW_ESTIMATE  : FFTW_MEASURE ;
05039   int sizeLines=ny*nz;
05040   int planLineSizes[1];
05041   planLineSizes[0]=K1;
05042   forward_plan = fftwf_plan_many_dft(1, planLineSizes, sizeLines,
05043                                      (fftwf_complex *) data, NULL, sizeLines, 1,
05044                                      (fftwf_complex *) data, NULL, sizeLines, 1,
05045                                    FFTW_FORWARD,
05046                                      fftwFlags);
05047   backward_plan = fftwf_plan_many_dft(1, planLineSizes, sizeLines,
05048                                      (fftwf_complex *) data, NULL, sizeLines, 1,
05049                                      (fftwf_complex *) data, NULL, sizeLines, 1,
05050                                           FFTW_BACKWARD,
05051                                       fftwFlags);
05052 
05053 #if     CMK_SMP && USE_CKLOOP
05054   if(simParams->useCkLoop) {
05055           //How many FFT plans to be created? The grain-size issue!!.
05056           //Currently, I am choosing the min(nx, ny) to be coarse-grain
05057           numPlans = (ny<=nz?ny:nz);
05058           // limit attempted parallelism due to false sharing
05059           //if ( numPlans < CkMyNodeSize() ) numPlans = (ny>=nz?ny:nz);
05060           //if ( numPlans < CkMyNodeSize() ) numPlans = sizeLines;
05061           if ( sizeLines/numPlans < 4 ) numPlans = 1;
05062           int howmany = sizeLines/numPlans;
05063           forward_plans = new fftwf_plan[numPlans];
05064           backward_plans = new fftwf_plan[numPlans];
05065           for(int i=0; i<numPlans; i++) {
05066                   int curStride = i*howmany;              
05067                   forward_plans[i] = fftwf_plan_many_dft(1, planLineSizes, howmany,
05068                                                                                                          ((fftwf_complex *)data)+curStride, NULL, sizeLines, 1,
05069                                                                                                          ((fftwf_complex *)data)+curStride, NULL, sizeLines, 1,
05070                                                                                                         FFTW_FORWARD,
05071                                                                                                          fftwFlags);
05072 
05073                   backward_plans[i] = fftwf_plan_many_dft(1, planLineSizes, howmany,
05074                                                                                                          ((fftwf_complex *)data)+curStride, NULL, sizeLines, 1,
05075                                                                                                          ((fftwf_complex *)data)+curStride, NULL, sizeLines, 1,
05076                                                                                                           FFTW_BACKWARD,
05077                                                                                                          fftwFlags);
05078           }
05079   }else
05080 #endif
05081   {
05082           forward_plans = NULL;
05083           backward_plans = NULL;
05084   }
05085 #else
05086   forward_plan = fftw_create_plan_specific(K1, FFTW_FORWARD,
05087         ( simParams->FFTWEstimate ? FFTW_ESTIMATE : FFTW_MEASURE )
05088         | FFTW_IN_PLACE | FFTW_USE_WISDOM, (fftw_complex *) data,
05089         ny*nz, (fftw_complex *) work, 1);
05090   backward_plan = fftw_create_plan_specific(K1, FFTW_BACKWARD,
05091         ( simParams->FFTWEstimate ? FFTW_ESTIMATE : FFTW_MEASURE )
05092         | FFTW_IN_PLACE | FFTW_USE_WISDOM, (fftw_complex *) data,
05093         ny*nz, (fftw_complex *) work, 1);
05094 #endif
05095   CmiUnlock(ComputePmeMgr::fftw_plan_lock);
05096 #else
05097   NAMD_die("Sorry, FFTW must be compiled in to use PME.");
05098 #endif
05099 
05100   myKSpace = new PmeKSpace(initdata.grid,
05101                 thisIndex.y*block2, thisIndex.y*block2 + ny,
05102                 thisIndex.z*block3, thisIndex.z*block3 + nz);
05103 
05104 }

void PmeXPencil::forward_fft (  ) 

Definition at line 5627 of file ComputePme.C.

References CKLOOP_CTRL_PME_FORWARDFFT, PmePencil< CBase_PmeXPencil >::data, forward_plan, PmePencilInitMsgData::grid, PmePencil< CBase_PmeXPencil >::initdata, PmeGrid::K1, Node::Object(), PmeXZPencilFFT(), Node::simParameters, SimParameters::useCkLoop, PmePencil< CBase_PmeXPencil >::work, PmePencilInitMsgData::yBlocks, and PmePencilInitMsgData::zBlocks.

Referenced by node_process_trans().

05627                              {
05628 #ifdef NAMD_FFTW
05629 
05630 #ifdef MANUAL_DEBUG_FFTW3
05631   dumpMatrixFloat3("fw_x_b", data, initdata.grid.K1, ny, nz, thisIndex.x, thisIndex.y, thisIndex.z);
05632 #endif
05633 
05634 #ifdef NAMD_FFTW_3
05635 #if     CMK_SMP && USE_CKLOOP
05636   int useCkLoop = Node::Object()->simParameters->useCkLoop;
05637   if(useCkLoop>=CKLOOP_CTRL_PME_FORWARDFFT
05638      && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks) {
05639           //for(int i=0; i<numPlans; i++) fftwf_execute(forward_plans[i]);
05640           //transform the above loop
05641           CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)forward_plans, CkMyNodeSize(), 0, numPlans-1); //sync
05642           return;
05643   }
05644 #endif
05645   fftwf_execute(forward_plan);
05646 #else
05647   fftw(forward_plan, ny*nz,
05648         ((fftw_complex *) data), ny*nz, 1, (fftw_complex *) work, 1, 0);
05649 #endif
05650 #ifdef MANUAL_DEBUG_FFTW3
05651   dumpMatrixFloat3("fw_x_a", data, initdata.grid.K1, ny, nz, thisIndex.x, thisIndex.y, thisIndex.z);
05652 #endif
05653 
05654 #endif
05655 }

void PmeXPencil::node_process_trans ( PmeTransMsg msg  ) 

Definition at line 5570 of file ComputePme.C.

References backward_fft(), forward_fft(), PmePencil< CBase_PmeXPencil >::hasData, PmeTransMsg::hasData, PmePencil< CBase_PmeXPencil >::imsg, PmePencil< CBase_PmeXPencil >::initdata, PmePencil< CBase_PmeXPencil >::needs_reply, pme_kspace(), recv_trans(), send_untrans(), PmeTransMsg::sourceNode, and PmePencilInitMsgData::xBlocks.

Referenced by NodePmeMgr::recvXTrans().

05571 {
05572   if(msg->hasData) hasData=1;
05573   needs_reply[msg->sourceNode] = msg->hasData;
05574   recv_trans(msg);
05575   int limsg;
05576   CmiMemoryAtomicFetchAndInc(imsg,limsg);
05577   if(limsg+1 == initdata.xBlocks)
05578     {
05579       if(hasData){
05580         forward_fft();
05581         pme_kspace();
05582         backward_fft();
05583       }
05584       send_untrans();
05585       imsg=0;
05586       CmiMemoryWriteFence();
05587     }
05588 }

void PmeXPencil::pme_kspace (  ) 

Definition at line 5657 of file ComputePme.C.

References CKLOOP_CTRL_PME_KSPACE, PmeKSpace::compute_energy(), PmePencil< CBase_PmeXPencil >::data, PmePencil< CBase_PmeXPencil >::evir, ComputeNonbondedUtil::ewaldcof, PmePencil< CBase_PmeXPencil >::initdata, PmePencil< CBase_PmeXPencil >::lattice, myKSpace, Node::Object(), PmePencilInitMsgData::yBlocks, and PmePencilInitMsgData::zBlocks.

Referenced by node_process_trans().

05657                             {
05658 
05659   evir = 0.;
05660 
05661 #ifdef FFTCHECK
05662   return;
05663 #endif
05664 
05665   BigReal ewaldcof = ComputeNonbondedUtil::ewaldcof;
05666 
05667   int useCkLoop = 0;
05668 #if CMK_SMP && USE_CKLOOP
05669   if ( Node::Object()->simParameters->useCkLoop >= CKLOOP_CTRL_PME_KSPACE
05670        && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks ) {
05671     useCkLoop = 1;
05672   }
05673 #endif
05674 
05675   int numGrids = 1;
05676   for ( int g=0; g<numGrids; ++g ) {
05677     evir[0] = myKSpace->compute_energy(data+0*g,
05678                 lattice, ewaldcof, &(evir[1]), useCkLoop);
05679   }
05680   
05681 #if USE_NODE_PAR_RECEIVE
05682     CmiMemoryWriteFence();
05683 #endif
05684 }

void PmeXPencil::recv_trans ( const PmeTransMsg msg  ) 

Definition at line 5590 of file ComputePme.C.

References PmeGrid::block1, PmePencil< CBase_PmeXPencil >::data, PmePencilInitMsgData::grid, PmeTransMsg::hasData, PmePencil< CBase_PmeXPencil >::imsg, PmePencil< CBase_PmeXPencil >::initdata, j, PmeGrid::K1, PmeTransMsg::lattice, PmePencil< CBase_PmeXPencil >::lattice, PmeTransMsg::nx, PmeTransMsg::qgrid, PmeTransMsg::sequence, PmePencil< CBase_PmeXPencil >::sequence, and PmeTransMsg::sourceNode.

Referenced by node_process_trans().

05590                                                   {
05591   if ( imsg == 0 ) {
05592     lattice = msg->lattice;
05593     sequence = msg->sequence;
05594   }
05595   int block1 = initdata.grid.block1;
05596   int K1 = initdata.grid.K1;
05597   int ib = msg->sourceNode;
05598   int nx = msg->nx;
05599  if ( msg->hasData ) {
05600   const float *md = msg->qgrid;
05601   for ( int i=ib*block1; i<(ib*block1+nx); ++i ) {
05602    float *d = data + i*ny*nz*2;
05603    for ( int j=0; j<ny; ++j, d += nz*2 ) {
05604     for ( int k=0; k<nz; ++k ) {
05605 #ifdef ZEROCHECK
05606       if ( (*md) == 0. ) CkPrintf("0 in YX at %d %d %d %d %d %d %d %d %d\n",
05607         ib, thisIndex.y, thisIndex.z, i, j, k, nx, ny, nz);
05608 #endif
05609       d[2*k] = *(md++);
05610       d[2*k+1] = *(md++);
05611     }
05612    }
05613   }
05614  } else {
05615   for ( int i=ib*block1; i<(ib*block1+nx); ++i ) {
05616    float *d = data + i*ny*nz*2;
05617    for ( int j=0; j<ny; ++j, d += nz*2 ) {
05618     for ( int k=0; k<nz; ++k ) {
05619       d[2*k] = 0;
05620       d[2*k+1] = 0;
05621     }
05622    }
05623   }
05624  }
05625 }

void PmeXPencil::send_subset_untrans ( int  fromIdx,
int  toIdx 
)

Definition at line 5719 of file ComputePme.C.

References PmeGrid::block1, PmePencil< CBase_PmeXPencil >::data, PmeUntransMsg::destElem, PmePencilInitMsgData::grid, PmePencil< CBase_PmeXPencil >::initdata, j, PmeGrid::K1, PmePencil< CBase_PmeXPencil >::needs_reply, PmeUntransMsg::ny, PME_UNTRANS_PRIORITY, PmePencilInitMsgData::pmeNodeProxy, PRIORITY_SIZE, PmeUntransMsg::qgrid, PmePencil< CBase_PmeXPencil >::send_order, PmePencil< CBase_PmeXPencil >::sequence, SET_PRIORITY, PmeUntransMsg::sourceNode, PmePencilInitMsgData::xBlocks, PmePencilInitMsgData::ym, and PmePencilInitMsgData::yPencil.

Referenced by PmeXPencilSendUntrans().

05719                                                           {
05720         int xBlocks = initdata.xBlocks;
05721         int block1 = initdata.grid.block1;      
05722         int K1 = initdata.grid.K1;
05723 
05724         for(int isend=fromIdx; isend<=toIdx; isend++) {
05725                 int ib = send_order[isend];
05726                 if ( ! needs_reply[ib] ) {
05727                         PmeAckMsg *msg = new (PRIORITY_SIZE) PmeAckMsg;
05728                         CmiEnableUrgentSend(1);
05729                         SET_PRIORITY(msg,sequence,PME_UNTRANS_PRIORITY)
05730 #if USE_NODE_PAR_RECEIVE
05731                         initdata.yPencil(ib,0,thisIndex.z).recvNodeAck(msg);
05732 #else
05733                         initdata.yPencil(ib,0,thisIndex.z).recvAck(msg);
05734 #endif
05735                         CmiEnableUrgentSend(0);
05736                         continue;
05737                 }
05738                 int nx = block1;
05739                 if ( (ib+1)*block1 > K1 ) nx = K1 - ib*block1;
05740                 PmeUntransMsg *msg = new (nx*ny*nz*2,PRIORITY_SIZE) PmeUntransMsg;
05741                 msg->sourceNode = thisIndex.y;
05742                 msg->ny = ny;
05743                 float *md = msg->qgrid;
05744                 for ( int i=ib*block1; i<(ib*block1+nx); ++i ) {
05745                         float *d = data + i*ny*nz*2;
05746                         for ( int j=0; j<ny; ++j, d += nz*2 ) {
05747                                 for ( int k=0; k<nz; ++k ) {
05748                                         *(md++) = d[2*k];
05749                                         *(md++) = d[2*k+1];
05750                                 }
05751                         }
05752                 }
05753                 SET_PRIORITY(msg,sequence,PME_UNTRANS_PRIORITY)
05754         CmiEnableUrgentSend(1);
05755 #if USE_NODE_PAR_RECEIVE
05756         msg->destElem=CkArrayIndex3D(ib,0, thisIndex.z);
05757 #if Y_PERSIST 
05758         CmiUsePersistentHandle(&untrans_handle[isend], 1);
05759 #endif
05760         initdata.pmeNodeProxy[CmiNodeOf(initdata.ym.ckLocalBranch()->procNum(0,msg->destElem))].recvYUntrans(msg);
05761 #if Y_PERSIST 
05762         CmiUsePersistentHandle(NULL, 0);
05763 #endif
05764 #else
05765 #if Y_PERSIST 
05766   //      CmiUsePersistentHandle(&untrans_handle[isend], 1);
05767 #endif
05768         initdata.yPencil(ib,0,thisIndex.z).recvUntrans(msg);
05769 #if Y_PERSIST 
05770    //     CmiUsePersistentHandle(NULL, 0);
05771 #endif
05772 #endif
05773         CmiEnableUrgentSend(0);
05774         }
05775 }

void PmeXPencil::send_untrans (  ) 

Definition at line 5777 of file ComputePme.C.

References PmeGrid::block1, CKLOOP_CTRL_PME_SENDUNTRANS, PmePencil< CBase_PmeXPencil >::data, PmeUntransMsg::destElem, PmePencil< CBase_PmeXPencil >::evir, PmeEvirMsg::evir, PmePencilInitMsgData::grid, PmePencil< CBase_PmeXPencil >::initdata, j, PmeGrid::K1, PmePencil< CBase_PmeXPencil >::needs_reply, PmeUntransMsg::ny, Node::Object(), PME_UNGRID_PRIORITY, PME_UNTRANS_PRIORITY, PmePencilInitMsgData::pmeNodeProxy, PmePencilInitMsgData::pmeProxy, PmeXPencilSendUntrans(), PRIORITY_SIZE, PmeUntransMsg::qgrid, recipEvirPe, PmePencil< CBase_PmeXPencil >::send_order, PmePencil< CBase_PmeXPencil >::sequence, SET_PRIORITY, Node::simParameters, PmeUntransMsg::sourceNode, SimParameters::useCkLoop, PmePencilInitMsgData::xBlocks, PmePencilInitMsgData::yBlocks, PmePencilInitMsgData::ym, PmePencilInitMsgData::yPencil, and PmePencilInitMsgData::zBlocks.

Referenced by node_process_trans().

05777                               {
05778 
05779   { // send energy and virial
05780     int numGrids = 1;
05781     PmeEvirMsg *newmsg = new (numGrids, PRIORITY_SIZE) PmeEvirMsg;
05782     newmsg->evir[0] = evir;
05783     SET_PRIORITY(newmsg,sequence,PME_UNGRID_PRIORITY)
05784     CmiEnableUrgentSend(1);
05785     initdata.pmeProxy[recipEvirPe].recvRecipEvir(newmsg);
05786     CmiEnableUrgentSend(0);
05787   }
05788 
05789 #if USE_PERSISTENT
05790   if (untrans_handle == NULL) setup_persistent();
05791 #endif
05792 #if     CMK_SMP && USE_CKLOOP
05793   int useCkLoop = Node::Object()->simParameters->useCkLoop;
05794   if(useCkLoop>=CKLOOP_CTRL_PME_SENDUNTRANS
05795      && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks) {
05796                 int xBlocks = initdata.xBlocks;
05797 
05798 #if USE_NODE_PAR_RECEIVE
05799                 //CkLoop_Parallelize(PmeXPencilSendUntrans, 1, (void *)this, CkMyNodeSize(), 0, xBlocks-1, 1); //has to sync
05800                 CkLoop_Parallelize(PmeXPencilSendUntrans, 1, (void *)this, xBlocks, 0, xBlocks-1, 1); //has to sync
05801 #else
05802         //CkLoop_Parallelize(PmeXPencilSendUntrans, 1, (void *)this, CkMyNodeSize(), 0, xBlocks-1, 0); //not sync
05803                 CkLoop_Parallelize(PmeXPencilSendUntrans, 1, (void *)this, xBlocks, 0, xBlocks-1, 0); //not sync
05804 #endif        
05805                 return;
05806   }
05807 #endif
05808   int xBlocks = initdata.xBlocks;
05809   int block1 = initdata.grid.block1;
05810   int K1 = initdata.grid.K1;
05811   for ( int isend=0; isend<xBlocks; ++isend ) {
05812     int ib = send_order[isend];
05813     if ( ! needs_reply[ib] ) {
05814       PmeAckMsg *msg = new (PRIORITY_SIZE) PmeAckMsg;
05815       CmiEnableUrgentSend(1);
05816       SET_PRIORITY(msg,sequence,PME_UNTRANS_PRIORITY)
05817 #if USE_NODE_PAR_RECEIVE
05818       initdata.yPencil(ib,0,thisIndex.z).recvNodeAck(msg);
05819 #else
05820       initdata.yPencil(ib,0,thisIndex.z).recvAck(msg);
05821 #endif
05822       CmiEnableUrgentSend(0);
05823       continue;
05824     }
05825     int nx = block1;
05826     if ( (ib+1)*block1 > K1 ) nx = K1 - ib*block1;
05827     PmeUntransMsg *msg = new (nx*ny*nz*2,PRIORITY_SIZE) PmeUntransMsg;
05828     msg->sourceNode = thisIndex.y;
05829     msg->ny = ny;
05830     float *md = msg->qgrid;
05831     for ( int i=ib*block1; i<(ib*block1+nx); ++i ) {
05832      float *d = data + i*ny*nz*2;
05833      for ( int j=0; j<ny; ++j, d += nz*2 ) {
05834       for ( int k=0; k<nz; ++k ) {
05835         *(md++) = d[2*k];
05836         *(md++) = d[2*k+1];
05837       }
05838      }
05839     }
05840     SET_PRIORITY(msg,sequence,PME_UNTRANS_PRIORITY)
05841 
05842     CmiEnableUrgentSend(1);
05843 #if USE_NODE_PAR_RECEIVE
05844     msg->destElem=CkArrayIndex3D(ib,0, thisIndex.z);
05845 #if Y_PERSIST 
05846     CmiUsePersistentHandle(&untrans_handle[isend], 1);
05847 #endif
05848     initdata.pmeNodeProxy[CmiNodeOf(initdata.ym.ckLocalBranch()->procNum(0,msg->destElem))].recvYUntrans(msg);
05849 #if Y_PERSIST 
05850     CmiUsePersistentHandle(NULL, 0);
05851 #endif
05852 #else
05853 #if Y_PERSIST 
05854     CmiUsePersistentHandle(&untrans_handle[isend], 1);
05855 #endif
05856     initdata.yPencil(ib,0,thisIndex.z).recvUntrans(msg);
05857 #if Y_PERSIST 
05858     CmiUsePersistentHandle(NULL, 0);
05859 #endif
05860 #endif
05861     CmiEnableUrgentSend(0);
05862   }
05863 }


Member Data Documentation

Definition at line 4701 of file ComputePme.C.

Referenced by backward_fft(), and fft_init().

Definition at line 4701 of file ComputePme.C.

Referenced by fft_init(), and forward_fft().

Definition at line 4707 of file ComputePme.C.

Referenced by fft_init(), pme_kspace(), and PmeXPencil().

Definition at line 4704 of file ComputePme.C.

Definition at line 4704 of file ComputePme.C.

Definition at line 4705 of file ComputePme.C.

Referenced by evir_init(), PmeXPencil(), and send_untrans().


The documentation for this class was generated from the following file:

Generated on 8 Dec 2019 for NAMD by  doxygen 1.6.1