Changeset 855


Ignore:
Timestamp:
05/25/16 12:21:03 (8 years ago)
Author:
mhnguyen
Message:

Fixing a bug during compilation on PGI

+) Remove some codes which contain mismatch-type error

Test
+) On Curie with compiler Intel.
+) All tests pass

Location:
XIOS/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/policy.cpp

    r833 r855  
    1313namespace xios 
    1414{ 
    15 /*! 
    16   Calculate MPI communicator for each level of hierarchy. 
    17   \param[in] mpiCommRoot MPI communicator of the level 0 (usually communicator of all clients) 
    18   \param[in] levels number of level in hierarchy 
    19 */ 
    20 void DivideCommByTwo::computeMPICommLevel(const MPI_Comm& mpiCommRoot, int levels) 
    21 { 
    22   int nbProc; 
    23   MPI_Comm_size(mpiCommRoot,&nbProc); 
    24   if (levels > nbProc) levels = std::log10(nbProc) * 3.3219; // log2(x) = log2(10) * log10(x); stupid C++98 
    25   else if (1 > levels) levels = 1; 
    26  
    27   commLevel_.push_back(mpiCommRoot); 
    28   divideMPICommLevel(mpiCommRoot, levels); 
    29 } 
    30  
    31 /*! 
    32   Divide each MPI communicator into sub-communicator. Recursive function 
    33   \param [in] mpiCommLevel MPI communicator of current level 
    34   \param [in] level current level 
    35 */ 
    36 void DivideCommByTwo::divideMPICommLevel(const MPI_Comm& mpiCommLevel, int level) 
    37 { 
    38   int clientRank; 
    39   MPI_Comm_rank(mpiCommLevel,&clientRank); 
    40  
    41    --level; 
    42   if (0 < level) 
    43   { 
    44    int color = clientRank % 2; 
    45    commLevel_.push_back(MPI_Comm()); 
    46    MPI_Comm_split(mpiCommLevel, color, 0, &(commLevel_.back())); 
    47    divideMPICommLevel(commLevel_.back(), level); 
    48   } 
    49 } 
     15///*! 
     16//  Calculate MPI communicator for each level of hierarchy. 
     17//  \param[in] mpiCommRoot MPI communicator of the level 0 (usually communicator of all clients) 
     18//  \param[in] levels number of level in hierarchy 
     19//*/ 
     20//void DivideCommByTwo::computeMPICommLevel(const MPI_Comm& mpiCommRoot, int levels) 
     21//{ 
     22//  int nbProc; 
     23//  MPI_Comm_size(mpiCommRoot,&nbProc); 
     24//  if (levels > nbProc) levels = std::log10(nbProc) * 3.3219; // log2(x) = log2(10) * log10(x); stupid C++98 
     25//  else if (1 > levels) levels = 1; 
     26// 
     27//  commLevel_.push_back(mpiCommRoot); 
     28//  divideMPICommLevel(mpiCommRoot, levels); 
     29//} 
     30// 
     31///*! 
     32//  Divide each MPI communicator into sub-communicator. Recursive function 
     33//  \param [in] mpiCommLevel MPI communicator of current level 
     34//  \param [in] level current level 
     35//*/ 
     36//void DivideCommByTwo::divideMPICommLevel(const MPI_Comm& mpiCommLevel, int level) 
     37//{ 
     38//  int clientRank; 
     39//  MPI_Comm_rank(mpiCommLevel,&clientRank); 
     40// 
     41//   --level; 
     42//  if (0 < level) 
     43//  { 
     44//   int color = clientRank % 2; 
     45//   commLevel_.push_back(MPI_Comm()); 
     46//   MPI_Comm_split(mpiCommLevel, color, 0, &(commLevel_.back())); 
     47//   divideMPICommLevel(commLevel_.back(), level); 
     48//  } 
     49//} 
    5050 
    5151DivideAdaptiveComm::DivideAdaptiveComm(const MPI_Comm& mpiComm) 
  • XIOS/trunk/src/policy.hpp

    r833 r855  
    1616namespace xios 
    1717{ 
    18 class DivideCommByTwo 
    19 { 
    20 protected: 
    21   void computeMPICommLevel(const MPI_Comm& mpiCommRoot, int levels); 
    22  
    23 protected: 
    24   std::vector<MPI_Comm> commLevel_; 
    25 private: 
    26   // Divide MPI communicator on each level recursively 
    27   void divideMPICommLevel(const MPI_Comm& mpiCommLevel, int level); 
    28 }; 
     18//class DivideCommByTwo 
     19//{ 
     20//protected: 
     21//  void computeMPICommLevel(const MPI_Comm& mpiCommRoot, int levels); 
     22// 
     23//protected: 
     24//  std::vector<MPI_Comm> commLevel_; 
     25//private: 
     26//  // Divide MPI communicator on each level recursively 
     27//  void divideMPICommLevel(const MPI_Comm& mpiCommLevel, int level); 
     28//}; 
    2929 
    3030class DivideAdaptiveComm 
Note: See TracChangeset for help on using the changeset viewer.