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 4699 of file ComputePme.C.


Constructor & Destructor Documentation

PmeXPencil_SDAG_CODE PmeXPencil::PmeXPencil (  )  [inline]

Definition at line 4702 of file ComputePme.C.

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

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

PmeXPencil::PmeXPencil ( CkMigrateMessage *   )  [inline]

Definition at line 4703 of file ComputePme.C.

04703 { __sdag_init(); }

PmeXPencil::~PmeXPencil (  )  [inline]

Definition at line 4704 of file ComputePme.C.

04704                       {
04705         #ifdef NAMD_FFTW
04706         #ifdef NAMD_FFTW_3
04707                 delete [] forward_plans;
04708                 delete [] backward_plans;
04709         #endif
04710         #endif
04711         }


Member Function Documentation

void PmeXPencil::backward_fft (  ) 

Definition at line 5712 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().

05712                               {
05713 #ifdef NAMD_FFTW
05714 #ifdef MANUAL_DEBUG_FFTW3
05715   dumpMatrixFloat3("bw_x_b", data, initdata.grid.K1, ny, nz, thisIndex.x, thisIndex.y, thisIndex.z);
05716 #endif
05717 
05718 #ifdef NAMD_FFTW_3
05719 #if     CMK_SMP && USE_CKLOOP
05720   int useCkLoop = Node::Object()->simParameters->useCkLoop;
05721   if(useCkLoop>=CKLOOP_CTRL_PME_BACKWARDFFT
05722      && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks) {
05723           //for(int i=0; i<numPlans; i++) fftwf_execute(backward_plans[i]);
05724           //transform the above loop
05725           CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)backward_plans, CkMyNodeSize(), 0, numPlans-1); //sync
05726           return;
05727   }
05728 #endif
05729   fftwf_execute(backward_plan);
05730 #else
05731   fftw(backward_plan, ny*nz,
05732         ((fftw_complex *) data), ny*nz, 1, (fftw_complex *) work, 1, 0);
05733 #endif
05734 #ifdef MANUAL_DEBUG_FFTW3
05735   dumpMatrixFloat3("bw_x_a", data, initdata.grid.K1, ny, nz, thisIndex.x, thisIndex.y, thisIndex.z);
05736 #endif
05737 #endif
05738 }

void PmeXPencil::evir_init (  ) 

Definition at line 4757 of file ComputePme.C.

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

04757                            {
04758   recipEvirPe = findRecipEvirPe();
04759   initdata.pmeProxy[recipEvirPe].addRecipEvirClient();
04760 }

void PmeXPencil::fft_init (  ) 

Definition at line 5035 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.

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

void PmeXPencil::forward_fft (  ) 

Definition at line 5653 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().

05653                              {
05654 #ifdef NAMD_FFTW
05655 
05656 #ifdef MANUAL_DEBUG_FFTW3
05657   dumpMatrixFloat3("fw_x_b", data, initdata.grid.K1, ny, nz, thisIndex.x, thisIndex.y, thisIndex.z);
05658 #endif
05659 
05660 #ifdef NAMD_FFTW_3
05661 #if     CMK_SMP && USE_CKLOOP
05662   int useCkLoop = Node::Object()->simParameters->useCkLoop;
05663   if(useCkLoop>=CKLOOP_CTRL_PME_FORWARDFFT
05664      && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks) {
05665           //for(int i=0; i<numPlans; i++) fftwf_execute(forward_plans[i]);
05666           //transform the above loop
05667           CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)forward_plans, CkMyNodeSize(), 0, numPlans-1); //sync
05668           return;
05669   }
05670 #endif
05671   fftwf_execute(forward_plan);
05672 #else
05673   fftw(forward_plan, ny*nz,
05674         ((fftw_complex *) data), ny*nz, 1, (fftw_complex *) work, 1, 0);
05675 #endif
05676 #ifdef MANUAL_DEBUG_FFTW3
05677   dumpMatrixFloat3("fw_x_a", data, initdata.grid.K1, ny, nz, thisIndex.x, thisIndex.y, thisIndex.z);
05678 #endif
05679 
05680 #endif
05681 }

void PmeXPencil::node_process_trans ( PmeTransMsg msg  ) 

Definition at line 5596 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().

05597 {
05598   if(msg->hasData) hasData=1;
05599   needs_reply[msg->sourceNode] = msg->hasData;
05600   recv_trans(msg);
05601   int limsg;
05602   CmiMemoryAtomicFetchAndInc(imsg,limsg);
05603   if(limsg+1 == initdata.xBlocks)
05604     {
05605       if(hasData){
05606         forward_fft();
05607         pme_kspace();
05608         backward_fft();
05609       }
05610       send_untrans();
05611       imsg=0;
05612       CmiMemoryWriteFence();
05613     }
05614 }

void PmeXPencil::pme_kspace (  ) 

Definition at line 5683 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().

05683                             {
05684 
05685   evir = 0.;
05686 
05687 #ifdef FFTCHECK
05688   return;
05689 #endif
05690 
05691   BigReal ewaldcof = ComputeNonbondedUtil::ewaldcof;
05692 
05693   int useCkLoop = 0;
05694 #if CMK_SMP && USE_CKLOOP
05695   if ( Node::Object()->simParameters->useCkLoop >= CKLOOP_CTRL_PME_KSPACE
05696        && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks ) {
05697     useCkLoop = 1;
05698   }
05699 #endif
05700 
05701   int numGrids = 1;
05702   for ( int g=0; g<numGrids; ++g ) {
05703     evir[0] = myKSpace->compute_energy(data+0*g,
05704                 lattice, ewaldcof, &(evir[1]), useCkLoop);
05705   }
05706   
05707 #if USE_NODE_PAR_RECEIVE
05708     CmiMemoryWriteFence();
05709 #endif
05710 }

void PmeXPencil::recv_trans ( const PmeTransMsg msg  ) 

Definition at line 5616 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().

05616                                                   {
05617   if ( imsg == 0 ) {
05618     lattice = msg->lattice;
05619     sequence = msg->sequence;
05620   }
05621   int block1 = initdata.grid.block1;
05622   int K1 = initdata.grid.K1;
05623   int ib = msg->sourceNode;
05624   int nx = msg->nx;
05625  if ( msg->hasData ) {
05626   const float *md = msg->qgrid;
05627   for ( int i=ib*block1; i<(ib*block1+nx); ++i ) {
05628    float *d = data + i*ny*nz*2;
05629    for ( int j=0; j<ny; ++j, d += nz*2 ) {
05630     for ( int k=0; k<nz; ++k ) {
05631 #ifdef ZEROCHECK
05632       if ( (*md) == 0. ) CkPrintf("0 in YX at %d %d %d %d %d %d %d %d %d\n",
05633         ib, thisIndex.y, thisIndex.z, i, j, k, nx, ny, nz);
05634 #endif
05635       d[2*k] = *(md++);
05636       d[2*k+1] = *(md++);
05637     }
05638    }
05639   }
05640  } else {
05641   for ( int i=ib*block1; i<(ib*block1+nx); ++i ) {
05642    float *d = data + i*ny*nz*2;
05643    for ( int j=0; j<ny; ++j, d += nz*2 ) {
05644     for ( int k=0; k<nz; ++k ) {
05645       d[2*k] = 0;
05646       d[2*k+1] = 0;
05647     }
05648    }
05649   }
05650  }
05651 }

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

Definition at line 5745 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().

05745                                                           {
05746         int xBlocks = initdata.xBlocks;
05747         int block1 = initdata.grid.block1;      
05748         int K1 = initdata.grid.K1;
05749 
05750         for(int isend=fromIdx; isend<=toIdx; isend++) {
05751                 int ib = send_order[isend];
05752                 if ( ! needs_reply[ib] ) {
05753                         PmeAckMsg *msg = new (PRIORITY_SIZE) PmeAckMsg;
05754                         CmiEnableUrgentSend(1);
05755                         SET_PRIORITY(msg,sequence,PME_UNTRANS_PRIORITY)
05756 #if USE_NODE_PAR_RECEIVE
05757                         initdata.yPencil(ib,0,thisIndex.z).recvNodeAck(msg);
05758 #else
05759                         initdata.yPencil(ib,0,thisIndex.z).recvAck(msg);
05760 #endif
05761                         CmiEnableUrgentSend(0);
05762                         continue;
05763                 }
05764                 int nx = block1;
05765                 if ( (ib+1)*block1 > K1 ) nx = K1 - ib*block1;
05766                 PmeUntransMsg *msg = new (nx*ny*nz*2,PRIORITY_SIZE) PmeUntransMsg;
05767                 msg->sourceNode = thisIndex.y;
05768                 msg->ny = ny;
05769                 float *md = msg->qgrid;
05770                 for ( int i=ib*block1; i<(ib*block1+nx); ++i ) {
05771                         float *d = data + i*ny*nz*2;
05772                         for ( int j=0; j<ny; ++j, d += nz*2 ) {
05773                                 for ( int k=0; k<nz; ++k ) {
05774                                         *(md++) = d[2*k];
05775                                         *(md++) = d[2*k+1];
05776                                 }
05777                         }
05778                 }
05779                 SET_PRIORITY(msg,sequence,PME_UNTRANS_PRIORITY)
05780         CmiEnableUrgentSend(1);
05781 #if USE_NODE_PAR_RECEIVE
05782         msg->destElem=CkArrayIndex3D(ib,0, thisIndex.z);
05783 #if Y_PERSIST 
05784         CmiUsePersistentHandle(&untrans_handle[isend], 1);
05785 #endif
05786         initdata.pmeNodeProxy[CmiNodeOf(initdata.ym.ckLocalBranch()->procNum(0,msg->destElem))].recvYUntrans(msg);
05787 #if Y_PERSIST 
05788         CmiUsePersistentHandle(NULL, 0);
05789 #endif
05790 #else
05791 #if Y_PERSIST 
05792   //      CmiUsePersistentHandle(&untrans_handle[isend], 1);
05793 #endif
05794         initdata.yPencil(ib,0,thisIndex.z).recvUntrans(msg);
05795 #if Y_PERSIST 
05796    //     CmiUsePersistentHandle(NULL, 0);
05797 #endif
05798 #endif
05799         CmiEnableUrgentSend(0);
05800         }
05801 }

void PmeXPencil::send_untrans (  ) 

Definition at line 5803 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().

05803                               {
05804 
05805   { // send energy and virial
05806     int numGrids = 1;
05807     PmeEvirMsg *newmsg = new (numGrids, PRIORITY_SIZE) PmeEvirMsg;
05808     newmsg->evir[0] = evir;
05809     SET_PRIORITY(newmsg,sequence,PME_UNGRID_PRIORITY)
05810     CmiEnableUrgentSend(1);
05811     initdata.pmeProxy[recipEvirPe].recvRecipEvir(newmsg);
05812     CmiEnableUrgentSend(0);
05813   }
05814 
05815 #if USE_PERSISTENT
05816   if (untrans_handle == NULL) setup_persistent();
05817 #endif
05818 #if     CMK_SMP && USE_CKLOOP
05819   int useCkLoop = Node::Object()->simParameters->useCkLoop;
05820   if(useCkLoop>=CKLOOP_CTRL_PME_SENDUNTRANS
05821      && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks) {
05822                 int xBlocks = initdata.xBlocks;
05823 
05824 #if USE_NODE_PAR_RECEIVE
05825                 //CkLoop_Parallelize(PmeXPencilSendUntrans, 1, (void *)this, CkMyNodeSize(), 0, xBlocks-1, 1); //has to sync
05826                 CkLoop_Parallelize(PmeXPencilSendUntrans, 1, (void *)this, xBlocks, 0, xBlocks-1, 1); //has to sync
05827 #else
05828         //CkLoop_Parallelize(PmeXPencilSendUntrans, 1, (void *)this, CkMyNodeSize(), 0, xBlocks-1, 0); //not sync
05829                 CkLoop_Parallelize(PmeXPencilSendUntrans, 1, (void *)this, xBlocks, 0, xBlocks-1, 0); //not sync
05830 #endif        
05831                 return;
05832   }
05833 #endif
05834   int xBlocks = initdata.xBlocks;
05835   int block1 = initdata.grid.block1;
05836   int K1 = initdata.grid.K1;
05837   for ( int isend=0; isend<xBlocks; ++isend ) {
05838     int ib = send_order[isend];
05839     if ( ! needs_reply[ib] ) {
05840       PmeAckMsg *msg = new (PRIORITY_SIZE) PmeAckMsg;
05841       CmiEnableUrgentSend(1);
05842       SET_PRIORITY(msg,sequence,PME_UNTRANS_PRIORITY)
05843 #if USE_NODE_PAR_RECEIVE
05844       initdata.yPencil(ib,0,thisIndex.z).recvNodeAck(msg);
05845 #else
05846       initdata.yPencil(ib,0,thisIndex.z).recvAck(msg);
05847 #endif
05848       CmiEnableUrgentSend(0);
05849       continue;
05850     }
05851     int nx = block1;
05852     if ( (ib+1)*block1 > K1 ) nx = K1 - ib*block1;
05853     PmeUntransMsg *msg = new (nx*ny*nz*2,PRIORITY_SIZE) PmeUntransMsg;
05854     msg->sourceNode = thisIndex.y;
05855     msg->ny = ny;
05856     float *md = msg->qgrid;
05857     for ( int i=ib*block1; i<(ib*block1+nx); ++i ) {
05858      float *d = data + i*ny*nz*2;
05859      for ( int j=0; j<ny; ++j, d += nz*2 ) {
05860       for ( int k=0; k<nz; ++k ) {
05861         *(md++) = d[2*k];
05862         *(md++) = d[2*k+1];
05863       }
05864      }
05865     }
05866     SET_PRIORITY(msg,sequence,PME_UNTRANS_PRIORITY)
05867 
05868     CmiEnableUrgentSend(1);
05869 #if USE_NODE_PAR_RECEIVE
05870     msg->destElem=CkArrayIndex3D(ib,0, thisIndex.z);
05871 #if Y_PERSIST 
05872     CmiUsePersistentHandle(&untrans_handle[isend], 1);
05873 #endif
05874     initdata.pmeNodeProxy[CmiNodeOf(initdata.ym.ckLocalBranch()->procNum(0,msg->destElem))].recvYUntrans(msg);
05875 #if Y_PERSIST 
05876     CmiUsePersistentHandle(NULL, 0);
05877 #endif
05878 #else
05879 #if Y_PERSIST 
05880     CmiUsePersistentHandle(&untrans_handle[isend], 1);
05881 #endif
05882     initdata.yPencil(ib,0,thisIndex.z).recvUntrans(msg);
05883 #if Y_PERSIST 
05884     CmiUsePersistentHandle(NULL, 0);
05885 #endif
05886 #endif
05887     CmiEnableUrgentSend(0);
05888   }
05889 }


Member Data Documentation

Definition at line 4727 of file ComputePme.C.

Referenced by backward_fft(), and fft_init().

Definition at line 4727 of file ComputePme.C.

Referenced by fft_init(), and forward_fft().

Definition at line 4733 of file ComputePme.C.

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

Definition at line 4730 of file ComputePme.C.

Definition at line 4730 of file ComputePme.C.

Definition at line 4731 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 19 Sep 2020 for NAMD by  doxygen 1.6.1