Ignore:
Timestamp:
Apr 10, 2012, 1:55:49 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
a40eea
Parents:
d24c2f
Message:

Merge recent changes of the vmg library into ScaFaCos.

Includes a fix for the communication problems on Jugene.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1666 5161e1c8-67bf-11de-9fd5-51895aff932f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/comm/mpi/key.hpp

    rd24c2f rac6d04  
    3333public:
    3434  KeyStorage(const Grid& grid) :
    35     begin(grid.Global().BeginLocal()),
    36     end(grid.Global().EndLocal()),
     35    begin(grid.Global().LocalBegin()),
     36    end(grid.Global().LocalEnd()),
    3737    size_local(grid.Local().SizeTotal()),
    38     size_global(grid.Global().SizeGlobal())
     38    size_global(grid.Global().GlobalSize()),
     39    level(grid.Level())
    3940  {}
    4041
    41   KeyStorage(const Index& begin, const Index& end, const Index& size_local, const Index& size_global) :
     42  KeyStorage(const Index& begin, const Index& end,
     43             const Index& size_local, const Index& size_global,
     44             const int& level) :
    4245    begin(begin),
    4346    end(end),
    4447    size_local(size_local),
    45     size_global(size_global)
     48    size_global(size_global),
     49    level(level)
    4650  {}
    4751
     
    5054    end(other.end),
    5155    size_local(other.size_local),
    52     size_global(other.size_global)
     56    size_global(other.size_global),
     57    level(other.level)
    5358  {}
    5459
     
    6065           this->end == other.end &&
    6166           this->size_local == other.size_local &&
    62            this->size_global == other.size_global;
     67           this->size_global == other.size_global &&
     68           this->level == other.level;
    6369  }
    6470
     
    7177  {
    7278    if (this->begin < other.begin) return true;
    73     else if (this->begin != other.begin) return false;
    74     else if (this->end < other.end) return true;
    75     else if (this->end != other.end) return false;
    76     else if (this->size_local < other.size_local) return true;
    77     else if (this->size_local != other.size_local) return false;
    78     else if (this->size_global < other.size_global) return true;
    79     else return false;
     79    if (this->begin != other.begin) return false;
     80    if (this->end < other.end) return true;
     81    if (this->end != other.end) return false;
     82    if (this->size_local < other.size_local) return true;
     83    if (this->size_local != other.size_local) return false;
     84    if (this->size_global < other.size_global) return true;
     85    if (this->size_global != other.size_global) return false;
     86    if (this->level < other.level) return true;
     87    return false;
    8088  }
    8189
    8290private:
    8391  const Index begin, end, size_local, size_global;
    84   const void* ptr;
     92  const int level;
    8593};
    8694
     
    107115  }
    108116
    109   KeySorted(const Index& begin, const Index& end, const Index& size_local, const Index& size_global)
    110   {
    111     keys.push_back(KeyStorage(begin, end, size_local, size_global));
     117  KeySorted(const Index& begin, const Index& end,
     118            const Index& size_local, const Index& size_global,
     119            const int& level)
     120  {
     121    keys.push_back(KeyStorage(begin, end, size_local, size_global, level));
    112122  }
    113123
     
    134144};
    135145
     146
     147  /*
     148   * direction: 0 - from multigrid to temporary grid
     149   *            1 - from temporary grid to multigrid
     150   *            for single grid datatypes always 0
     151   */
    136152class KeyUnsorted {
    137153public:
     
    142158    for (i=other.keys.begin(); i!=other.keys.end(); ++i)
    143159      this->keys.push_back(*i);
    144   }
    145 
    146   KeyUnsorted(const Grid& grid)
     160    this->direction = other.direction;
     161  }
     162
     163  KeyUnsorted(const Grid& grid, const int& direction)
    147164  {
    148165    keys.push_back(KeyStorage(grid));
    149   }
    150 
    151   KeyUnsorted(const Grid& grid_1, const Grid& grid_2)
     166    this->direction = direction;
     167  }
     168
     169  KeyUnsorted(const Grid& grid_1, const Grid& grid_2, const int& direction)
    152170  {
    153171    keys.push_back(KeyStorage(grid_1));
    154172    keys.push_back(KeyStorage(grid_2));
    155   }
    156 
    157   KeyUnsorted(const Index& begin, const Index& end, const Index& size_local, const Index& size_global)
    158   {
    159     keys.push_back(KeyStorage(begin, end, size_local, size_global));
     173    this->direction = direction;
     174  }
     175
     176  KeyUnsorted(const Index& begin, const Index& end,
     177              const Index& size_local, const Index& size_global,
     178              const int& level, const int& direction)
     179  {
     180    keys.push_back(KeyStorage(begin, end, size_local, size_global, level));
     181    this->direction = direction;
    160182  }
    161183
     
    175197    }
    176198
     199    if (this->direction < other.direction) return true;
     200
    177201    return false;
    178202  }
     
    180204private:
    181205  std::list<KeyStorage> keys;
     206  int direction;
    182207};
    183208
Note: See TracChangeset for help on using the changeset viewer.