Changeset 2a5451 for src/base/timer.cpp


Ignore:
Timestamp:
May 11, 2012, 8:36:18 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
2d4211
Parents:
36d56c
Message:

vmg now succeeds on test_comm.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/base/timer.cpp

    r36d56c r2a5451  
    185185  Comm& comm = *MG::GetComm();
    186186  char name[80];
    187   int rank, size;
    188 
    189   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    190   MPI_Comm_size(MPI_COMM_WORLD, &size);
     187
     188  int rank = comm.GlobalRank();
     189  int size = comm.GlobalSize();
    191190
    192191  vmg_float times[size];
     
    196195
    197196  int timer_size = Timer::td.size();
    198   MPI_Bcast(timer_size, 1, MPI_INT, 0, MPI_COMM_WORLD);
     197  comm.GlobalBroadcast(timer_size);
    199198
    200199  if (rank == 0) {
    201200      for (iter=Timer::td.begin(); iter!=Timer::td.end(); ++iter) {
    202201        std::strcpy(name, iter->first.c_str());
    203         MPI_Bcast(name, 80, MPI_CHAR, 0, MPI_COMM_WORLD);
    204         MPI_Gather(&Timer::td[name].duration, 1, MPI_DOUBLE, times, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
    205         MPI_Gather(&Timer::td[name].total, 1, MPI_INT, calls, 1, MPI_INT, 0, MPI_COMM_WORLD);
     202        comm.GlobalBroadcast(name);
     203        comm.GlobalGather(Timer::td[name].duration, times);
     204        comm.GlobalGather(Timer::td[name].total, calls);
    206205
    207206        int min_calls, max_calls;
     
    227226  }else {
    228227    for (int i=0; i<timer_size; ++i) {
    229       MPI_Bcast(name, 80, MPI_CHAR, 0, MPI_COMM_WORLD);
    230       MPI_Gather(&Timer::td[name].duration, 1, MPI_DOUBLE, times, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
    231       MPI_Gather(&Timer::td[name].total, 1, MPI_INT, calls, 1, MPI_INT, 0, MPI_COMM_WORLD);
     228      comm.GlobalBroadcast(name);
     229      comm.GlobalGather(Timer::td[name].duration, times);
     230      comm.GlobalGather(Timer::td[name].total, calls);
    232231    }
    233232  }
Note: See TracChangeset for help on using the changeset viewer.