diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-09-21 15:23:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-09-21 15:23:00 +0000 |
commit | 399c6db76559b95ce13f38ca5c8238745de4d750 (patch) | |
tree | c5e42bbdbfdb58f72876c3619221e7f419c78d93 /Carpet/CarpetLib/src | |
parent | e927fec0377421da162413225c95ab36351b6110 (diff) |
CarpetLib: Use busy waiting instead of usleep to calibrate timers
darcs-hash:20070921152348-dae7b-8a3a55574196b28f86afba561d064c89c386c955.gz
Diffstat (limited to 'Carpet/CarpetLib/src')
-rw-r--r-- | Carpet/CarpetLib/src/timestat.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Carpet/CarpetLib/src/timestat.cc b/Carpet/CarpetLib/src/timestat.cc index fad45be58..c6bc82c4d 100644 --- a/Carpet/CarpetLib/src/timestat.cc +++ b/Carpet/CarpetLib/src/timestat.cc @@ -85,12 +85,15 @@ namespace CarpetLib { double const rdummy3 = rdtsc (); double const rstart = rdtsc (); double const wstart = MPI_Wtime (); - int const ierr = usleep (1000 * 1000); + // int const ierr = usleep (1000 * 1000); + while (MPI_Wtime() < wstart + 1.0) { + // do nothing, just wait + } double const rend = rdtsc (); double const wend = MPI_Wtime (); - if (ierr) { - CCTK_WARN (1, "Could not determine a reliable rdtsc timer resolution"); - } + // if (ierr) { + // CCTK_WARN (1, "Could not determine a reliable rdtsc timer resolution"); + // } rdtsc_cputick *= (wend - wstart) / (rend - rstart); } |