Changeset 2a5451 for src/base/timer.cpp
- Timestamp:
- May 11, 2012, 8:36:18 PM (14 years ago)
- Children:
- 2d4211
- Parents:
- 36d56c
- File:
-
- 1 edited
-
src/base/timer.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/base/timer.cpp
r36d56c r2a5451 185 185 Comm& comm = *MG::GetComm(); 186 186 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(); 191 190 192 191 vmg_float times[size]; … … 196 195 197 196 int timer_size = Timer::td.size(); 198 MPI_Bcast(timer_size, 1, MPI_INT, 0, MPI_COMM_WORLD);197 comm.GlobalBroadcast(timer_size); 199 198 200 199 if (rank == 0) { 201 200 for (iter=Timer::td.begin(); iter!=Timer::td.end(); ++iter) { 202 201 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); 206 205 207 206 int min_calls, max_calls; … … 227 226 }else { 228 227 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); 232 231 } 233 232 }
Note:
See TracChangeset
for help on using the changeset viewer.
