Commit 26da91a1 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15698 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 82cac1a0
Loading
Loading
Loading
Loading
+20 −3
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@
#include "timer.h"
#include "error.h"

// DEBUG
#include "update.h"

using namespace LAMMPS_NS;

#define BIG 1.0e20
@@ -54,6 +57,7 @@ void ImbalanceTime::compute(double *weight)

  // cost = CPU time for relevant timers since last invocation
  // localwt = weight assigned to each owned atom
  // just return if no time yet tallied

  double cost = -last;
  cost += timer->get_wall(Timer::PAIR);
@@ -61,6 +65,19 @@ void ImbalanceTime::compute(double *weight)
  cost += timer->get_wall(Timer::BOND);
  cost += timer->get_wall(Timer::KSPACE);

  /*
  printf("TIME %ld %d %g %g: %g %g %g %g\n",
         update->ntimestep,atom->nlocal,last,cost,
         timer->get_wall(Timer::PAIR),
         timer->get_wall(Timer::NEIGH),
         timer->get_wall(Timer::BOND),
         timer->get_wall(Timer::KSPACE));
  */

  double maxcost;
  MPI_Allreduce(&cost,&maxcost,1,MPI_DOUBLE,MPI_MAX,world);
  if (maxcost <= 0.0) return;

  int nlocal = atom->nlocal;
  double localwt = 0.0;
  if (nlocal) localwt = cost/nlocal;