Difference for src/ComputePme.C from version 1.225 to 1.226

version 1.225version 1.226
Line 2132
Line 2132
  
 void ComputePmeMgr::gridCalc2R(void) { void ComputePmeMgr::gridCalc2R(void) {
  
    int useCkLoop = 0;
  #if CMK_SMP && USE_CKLOOP
    if ( Node::Object()->simParameters->useCkLoop >= CKLOOP_CTRL_PME_KSPACE
         && CkNumPes() >= 2 * numTransNodes ) {
      useCkLoop = 1;
    }
  #endif
  
   int zdim = myGrid.dim3;   int zdim = myGrid.dim3;
   // int y_start = localInfo[myTransPe].y_start_after_transpose;   // int y_start = localInfo[myTransPe].y_start_after_transpose;
   int ny = localInfo[myTransPe].ny_after_transpose;   int ny = localInfo[myTransPe].ny_after_transpose;
Line 2140
Line 2148
     // reciprocal space portion of PME     // reciprocal space portion of PME
     BigReal ewaldcof = ComputeNonbondedUtil::ewaldcof;     BigReal ewaldcof = ComputeNonbondedUtil::ewaldcof;
     recip_evir2[g][0] = myKSpace->compute_energy(kgrid+qgrid_size*g,     recip_evir2[g][0] = myKSpace->compute_energy(kgrid+qgrid_size*g,
  lattice, ewaldcof, &(recip_evir2[g][1]));  lattice, ewaldcof, &(recip_evir2[g][1]), useCkLoop);
     // CkPrintf("Ewald reciprocal energy = %f\n", recip_evir2[g][0]);     // CkPrintf("Ewald reciprocal energy = %f\n", recip_evir2[g][0]);
  
     // start backward FFT (x dimension)     // start backward FFT (x dimension)
Line 5152
Line 5160
 #ifdef NAMD_FFTW_3 #ifdef NAMD_FFTW_3
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
   int useCkLoop = Node::Object()->simParameters->useCkLoop;   int useCkLoop = Node::Object()->simParameters->useCkLoop;
   if(useCkLoop>=CKLOOP_CTRL_PME_FORWARDFFT) {   if(useCkLoop>=CKLOOP_CTRL_PME_FORWARDFFT
       && CkNumPes() >= 2 * initdata.xBlocks * initdata.yBlocks) {
           //for(int i=0; i<numPlans; i++) fftwf_execute(forward_plans[i]);           //for(int i=0; i<numPlans; i++) fftwf_execute(forward_plans[i]);
           //transform the above loop           //transform the above loop
           CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)forward_plans, CkMyNodeSize(), 0, numPlans-1); //sync           CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)forward_plans, CkMyNodeSize(), 0, numPlans-1); //sync
Line 5248
Line 5257
 #endif #endif
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
  Bool useCkLoop = Node::Object()->simParameters->useCkLoop;  Bool useCkLoop = Node::Object()->simParameters->useCkLoop;
  if(useCkLoop>=CKLOOP_CTRL_PME_SENDTRANS) {  if(useCkLoop>=CKLOOP_CTRL_PME_SENDTRANS
             && CkNumPes() >= 2 * initdata.xBlocks * initdata.yBlocks) {
  /**  /**
   * Basically, this function call could be converted into    * Basically, this function call could be converted into 
   * a for-loop of:    * a for-loop of: 
Line 5374
Line 5384
 #ifdef NAMD_FFTW_3 #ifdef NAMD_FFTW_3
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
   int useCkLoop = Node::Object()->simParameters->useCkLoop;   int useCkLoop = Node::Object()->simParameters->useCkLoop;
   if(useCkLoop>=CKLOOP_CTRL_PME_FORWARDFFT) {   if(useCkLoop>=CKLOOP_CTRL_PME_FORWARDFFT
       && CkNumPes() >= 2 * initdata.xBlocks * initdata.zBlocks) {
    CkLoop_Parallelize(PmeYPencilForwardFFT, 1, (void *)this, CkMyNodeSize(), 0, nx-1); //sync    CkLoop_Parallelize(PmeYPencilForwardFFT, 1, (void *)this, CkMyNodeSize(), 0, nx-1); //sync
    return;    return;
   }   }
Line 5467
Line 5478
 #endif #endif
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
  Bool useCkLoop = Node::Object()->simParameters->useCkLoop;  Bool useCkLoop = Node::Object()->simParameters->useCkLoop;
  if(useCkLoop>=CKLOOP_CTRL_PME_SENDTRANS) {  if(useCkLoop>=CKLOOP_CTRL_PME_SENDTRANS
             && CkNumPes() >= 2 * initdata.xBlocks * initdata.zBlocks) {
  /**  /**
   * Basically, this function call could be converted into    * Basically, this function call could be converted into 
   * a for-loop of:    * a for-loop of: 
Line 5603
Line 5615
 #ifdef NAMD_FFTW_3 #ifdef NAMD_FFTW_3
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
   int useCkLoop = Node::Object()->simParameters->useCkLoop;   int useCkLoop = Node::Object()->simParameters->useCkLoop;
   if(useCkLoop>=CKLOOP_CTRL_PME_FORWARDFFT) {   if(useCkLoop>=CKLOOP_CTRL_PME_FORWARDFFT
       && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks) {
    //for(int i=0; i<numPlans; i++) fftwf_execute(forward_plans[i]);    //for(int i=0; i<numPlans; i++) fftwf_execute(forward_plans[i]);
    //transform the above loop    //transform the above loop
    CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)forward_plans, CkMyNodeSize(), 0, numPlans-1); //sync    CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)forward_plans, CkMyNodeSize(), 0, numPlans-1); //sync
Line 5632
Line 5645
  
   BigReal ewaldcof = ComputeNonbondedUtil::ewaldcof;   BigReal ewaldcof = ComputeNonbondedUtil::ewaldcof;
  
    int useCkLoop = 0;
  #if CMK_SMP && USE_CKLOOP
    if ( Node::Object()->simParameters->useCkLoop >= CKLOOP_CTRL_PME_KSPACE
         && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks ) {
      useCkLoop = 1;
    }
  #endif
  
   int numGrids = 1;   int numGrids = 1;
   for ( int g=0; g<numGrids; ++g ) {   for ( int g=0; g<numGrids; ++g ) {
     evir[0] = myKSpace->compute_energy(data+0*g,     evir[0] = myKSpace->compute_energy(data+0*g,
  lattice, ewaldcof, &(evir[1]));  lattice, ewaldcof, &(evir[1]), useCkLoop);
   }   }
      
 #if USE_NODE_PAR_RECEIVE #if USE_NODE_PAR_RECEIVE
Line 5652
Line 5673
 #ifdef NAMD_FFTW_3 #ifdef NAMD_FFTW_3
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
   int useCkLoop = Node::Object()->simParameters->useCkLoop;   int useCkLoop = Node::Object()->simParameters->useCkLoop;
   if(useCkLoop>=CKLOOP_CTRL_PME_BACKWARDFFT) {   if(useCkLoop>=CKLOOP_CTRL_PME_BACKWARDFFT
       && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks) {
           //for(int i=0; i<numPlans; i++) fftwf_execute(backward_plans[i]);           //for(int i=0; i<numPlans; i++) fftwf_execute(backward_plans[i]);
           //transform the above loop           //transform the above loop
           CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)backward_plans, CkMyNodeSize(), 0, numPlans-1); //sync           CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)backward_plans, CkMyNodeSize(), 0, numPlans-1); //sync
Line 5799
Line 5821
 #endif #endif
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
   Bool useCkLoop = Node::Object()->simParameters->useCkLoop;   Bool useCkLoop = Node::Object()->simParameters->useCkLoop;
   if(useCkLoop>=CKLOOP_CTRL_PME_SENDUNTRANS) {   if(useCkLoop>=CKLOOP_CTRL_PME_SENDUNTRANS
       && CkNumPes() >= 2 * initdata.yBlocks * initdata.zBlocks) {
     int xBlocks = initdata.xBlocks;     int xBlocks = initdata.xBlocks;
  int evirIdx = 0;  int evirIdx = 0;
  for ( int isend=0; isend<xBlocks; ++isend ) {  for ( int isend=0; isend<xBlocks; ++isend ) {
Line 5932
Line 5955
 #ifdef NAMD_FFTW_3 #ifdef NAMD_FFTW_3
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
   int useCkLoop = Node::Object()->simParameters->useCkLoop;   int useCkLoop = Node::Object()->simParameters->useCkLoop;
   if(useCkLoop>=CKLOOP_CTRL_PME_BACKWARDFFT) {   if(useCkLoop>=CKLOOP_CTRL_PME_BACKWARDFFT
       && CkNumPes() >= 2 * initdata.xBlocks * initdata.zBlocks) {
    CkLoop_Parallelize(PmeYPencilBackwardFFT, 1, (void *)this, CkMyNodeSize(), 0, nx-1); //sync    CkLoop_Parallelize(PmeYPencilBackwardFFT, 1, (void *)this, CkMyNodeSize(), 0, nx-1); //sync
    return;    return;
   }   }
Line 6084
Line 6108
 #endif #endif
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
   Bool useCkLoop = Node::Object()->simParameters->useCkLoop;   Bool useCkLoop = Node::Object()->simParameters->useCkLoop;
   if(useCkLoop>=CKLOOP_CTRL_PME_SENDUNTRANS) {   if(useCkLoop>=CKLOOP_CTRL_PME_SENDUNTRANS
       && CkNumPes() >= 2 * initdata.xBlocks * initdata.zBlocks) {
    int yBlocks = initdata.yBlocks;    int yBlocks = initdata.yBlocks;
    int evirIdx = 0;    int evirIdx = 0;
    for ( int isend=0; isend<yBlocks; ++isend ) {    for ( int isend=0; isend<yBlocks; ++isend ) {
Line 6211
Line 6236
 #ifdef NAMD_FFTW_3 #ifdef NAMD_FFTW_3
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
   int useCkLoop = Node::Object()->simParameters->useCkLoop;   int useCkLoop = Node::Object()->simParameters->useCkLoop;
   if(useCkLoop>=CKLOOP_CTRL_PME_BACKWARDFFT) {   if(useCkLoop>=CKLOOP_CTRL_PME_BACKWARDFFT
       && CkNumPes() >= 2 * initdata.xBlocks * initdata.yBlocks) {
    //for(int i=0; i<numPlans; i++) fftwf_execute(backward_plans[i]);    //for(int i=0; i<numPlans; i++) fftwf_execute(backward_plans[i]);
    //transform the above loop    //transform the above loop
    CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)backward_plans, CkMyNodeSize(), 0, numPlans-1); //sync    CkLoop_Parallelize(PmeXZPencilFFT, 1, (void *)backward_plans, CkMyNodeSize(), 0, numPlans-1); //sync
Line 6299
Line 6325
  
 #if     CMK_SMP && USE_CKLOOP #if     CMK_SMP && USE_CKLOOP
  Bool useCkLoop = Node::Object()->simParameters->useCkLoop;  Bool useCkLoop = Node::Object()->simParameters->useCkLoop;
  if(useCkLoop>=CKLOOP_CTRL_PME_SENDUNTRANS) {  if(useCkLoop>=CKLOOP_CTRL_PME_SENDUNTRANS
             && CkNumPes() >= 2 * initdata.xBlocks * initdata.yBlocks) {
  //????What's the best value for numChunks?????  //????What's the best value for numChunks?????
 #if USE_NODE_PAR_RECEIVE         #if USE_NODE_PAR_RECEIVE        
  //CkLoop_Parallelize(PmeZPencilSendUngrid, evirIdx, (void *)this, CkMyNodeSize(), 0, grid_msgs.size()-1, 1); //has to sync  //CkLoop_Parallelize(PmeZPencilSendUngrid, evirIdx, (void *)this, CkMyNodeSize(), 0, grid_msgs.size()-1, 1); //has to sync


Legend:
Removed in v.1.225 
changed lines
 Added in v.1.226



Made by using version 1.53 of cvs2html