00001
00005
00006 #include "converse.h"
00007
00008 #include "LBProfit.h"
00009
00010
00011
00012 int LBProfit::profitable(BaseLB::ProcStats *procArray, int np)
00013 {
00014 int doit = 1;
00015 double lmax = 0.0;
00016 double ltotal = 0.0;
00017 for (int i=0; i<np; i++) {
00018 BaseLB::ProcStats &p = procArray[i];
00019
00020 double objTime = p.total_walltime - p.idletime - p.bg_walltime;
00021 if (objTime > lmax) lmax = objTime;
00022 ltotal += objTime;
00023 }
00024 double lavg = ltotal/np;
00025 if ((lmax - lavg) / lavg < 0.01) doit = 0;
00026
00027 return doit;
00028 }
00029