source: XIOS/trunk/src/distribution.cpp @ 552

Last change on this file since 552 was 552, checked in by mhnguyen, 9 years ago

Doing some cleans and improving a little bit performance of creating local index on server

+) Add some comments, add some initialization
+) Change the way to calculate local index on server

Test
+) On Curie

File size: 636 bytes
Line 
1#include "distribution.hpp"
2
3namespace xios {
4
5CDistribution::CDistribution(int rank, int dims, CArray<size_t,1>* globalIndex)
6  : rank_(rank), dims_(dims), globalIndex_(globalIndex)
7{
8  if (0 != globalIndex)
9  {
10    globalIndex_ = new CArray<size_t,1>(globalIndex->numElements());
11    *globalIndex_ = *globalIndex;
12  }
13}
14
15CDistribution::~CDistribution()
16{
17  if (0 != globalIndex_) delete globalIndex_;
18}
19
20//const CArray<size_t,1>* CDistribution::getGlobalIndex() const
21//{
22//  return globalIndex_;
23//}
24
25int CDistribution::getDims() const
26{
27  return dims_;
28}
29
30int CDistribution::getRank() const
31{
32  return rank_;
33}
34
35} // namespace xios
Note: See TracBrowser for help on using the repository browser.