ParallelProblemStatBase.cc 1.77 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology 
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.


#include "parallel/ParallelProblemStatBase.h"
#include "parallel/MeshDistributor.h"
#include "parallel/MpiHelper.h"
16
#include "Global.h"
17
18
19
20
21
22
23
24
25

namespace AMDiS {

  void ParallelProblemStatBase::buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
						  bool assembleMatrix,
						  bool assembleVector)
  {
    FUNCNAME("ParallelProblemStatBase::buildAfterCoarsen()");

26
27
    TEST_EXIT_DBG(MeshDistributor::globalMeshDistributor != NULL)
      ("Should not happen!\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
28

29
    MeshDistributor::globalMeshDistributor->checkMeshChange();
30
31
32
    ProblemStatSeq::buildAfterCoarsen(adaptInfo, flag, 
				      assembleMatrix, 
				      assembleVector);
33

34
#if (DEBUG != 0)
35
    double vm, rss;
36
37
38
    processMemUsage(vm, rss);   
    vm /= 1024.0;
    rss /= 1024.0;
39
    
40
    MSG("My memory usage is VM = %.1f MB    RSS = %.1f MB\n", vm, rss);
41
42
43
    
    mpi::globalAdd(vm);
    mpi::globalAdd(rss);
44

45
    MSG("Overall memory usage is VM = %.1f MB    RSS = %.1f MB\n", vm, rss);
46
#endif
47
48
49
  }


50
51
52
  void ParallelProblemStatBase::initialize(Flag initFlag,
					   ProblemStatSeq *adoptProblem,
					   Flag adoptFlag)
53
  {
54
55
56
    ProblemStatSeq::initialize(initFlag, adoptProblem, adoptFlag);

    MeshDistributor::addProblemStatGlobal(this);
57

58
    meshDistributor = MeshDistributor::globalMeshDistributor;
59
60
  }

61
62
63
64
65
66
67
68
69
70

  void ParallelProblemStatBase::addPeriodicBC(BoundaryType type, int row, int col)
  {
    FUNCNAME("ParallelProblemStatBase::addPeriodicBC()");

    if (MeshDistributor::globalMeshDistributor->isInitialized())
      return;

    ProblemStatSeq::addPeriodicBC(type, row, col);
  }
71
}