Skip to content

Commit

Permalink
Remove HAVE_TMS code (#2815)
Browse files Browse the repository at this point in the history
  • Loading branch information
alkino authored Apr 9, 2024
1 parent 821f828 commit 6de86fc
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions src/parallel/bbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,9 @@
#include "bbsrcli.h"
#endif

#if defined(HAVE_TMS) && !NRNMPI
#include <time.h>
#include <sys/times.h>
#include <limits.h>
static struct tms tmsbuf, tms_start_;
static clock_t starttime;
#endif

extern int nrn_global_argc;
extern char** nrn_global_argv;
extern double nrn_timeus();

bool BBSImpl::is_master_ = false;
bool BBSImpl::started_ = false;
Expand Down Expand Up @@ -132,11 +125,7 @@ double BBSImpl::time() {
#if NRNMPI
return nrnmpi_wtime();
#else
#ifdef HAVE_TMS
return double(times(&tmsbuf)) / 100.;
#else
return 0.;
#endif
return nrn_timeus();
#endif
}

Expand Down Expand Up @@ -493,26 +482,11 @@ void BBSImpl::done() {
return;
}
done_ = true;
#ifdef HAVE_TMS
clock_t elapsed = times(&tmsbuf) - starttime;
printf("%d tasks in %g seconds. %g seconds waiting for tasks\n",
etaskcnt,
total_exec_time,
worker_take_time);
printf("user=%g sys=%g elapsed=%g %g%%\n",
(double) (tmsbuf.tms_utime - tms_start_.tms_utime) / 100,
(double) (tmsbuf.tms_stime - tms_start_.tms_stime) / 100,
(double) (elapsed) / 100,
100. * (double) (tmsbuf.tms_utime - tms_start_.tms_utime) / (double) elapsed);
#endif
}

void BBSImpl::start() {
if (started_) {
return;
}
started_ = 1;
#ifdef HAVE_TMS
starttime = times(&tms_start_);
#endif
}

0 comments on commit 6de86fc

Please sign in to comment.