diff --git a/src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java b/src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java index 1250ee5b867cdfbf50629b85f06ddc4bbc6a8998..2b268e5b92ef29a307470c56d5df8b6680c8c077 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java @@ -280,7 +280,7 @@ public class DisaggCalc { log.info(PROGRAM + " (return period): calculating ..."); - HazardExport handler = HazardExport.create(model, config, sites, log); + HazardExport handler = HazardExport.create(model, config, sites); Path disaggDir = handler.outputDir().resolve("disagg"); Files.createDirectory(disaggDir); @@ -310,17 +310,18 @@ public class DisaggCalc { GSON.toJson(response, writer); writer.close(); - if (i % logInterval == 0) { + int count = i + 1; + if (count % logInterval == 0) { log.info(String.format( " %s of %s sites completed in %s", - i + 1, sites.size(), stopwatch)); + count, sites.size(), stopwatch)); } } handler.expire(); log.info(String.format( PROGRAM + " (return period): %s sites completed in %s", - handler.resultCount(), handler.elapsedTime())); + sites.size(), stopwatch.stop())); exec.shutdown(); return handler.outputDir(); @@ -396,16 +397,17 @@ public class DisaggCalc { GSON.toJson(response, writer); writer.close(); - if (i % logInterval == 0) { + int count = i + 1; + if (count % logInterval == 0) { log.info(String.format( " %s of %s sites completed in %s", - i + 1, sites.size(), stopwatch)); + count, sites.size(), stopwatch)); } } log.info(String.format( PROGRAM + " (IML): %s sites completed in %s", - sites.size(), stopwatch)); + sites.size(), stopwatch.stop())); exec.shutdown(); return outDir; diff --git a/src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java b/src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java index 9815cc2b2fe31faf43c60920ed99c5d603609ffd..3342bca22cd0ef921c542fb752dd5a1907e1423d 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java @@ -172,7 +172,7 @@ public class HazardCalc { log.info("Threads: " + ((ThreadPoolExecutor) exec).getCorePoolSize()); log.info(PROGRAM + ": calculating ..."); - HazardExport handler = HazardExport.create(model, config, sites, log); + HazardExport handler = HazardExport.create(model, config, sites); CalcTask.Builder calcTask = new CalcTask.Builder(model, config, exec); WriteTask.Builder writeTask = new WriteTask.Builder(handler); @@ -184,10 +184,11 @@ public class HazardCalc { Site site = sites.get(i); Hazard hazard = calcTask.withSite(site).call(); out = exec.submit(writeTask.withResult(hazard)); - if (i % logInterval == 0) { + int count = i + 1; + if (count % logInterval == 0) { log.info(String.format( " %s of %s sites completed in %s", - i + 1, sites.size(), stopwatch)); + count, sites.size(), stopwatch)); } } /* Block shutdown until last task is returned. */ @@ -197,7 +198,7 @@ public class HazardCalc { exec.shutdown(); log.info(String.format( PROGRAM + ": %s sites completed in %s", - handler.resultCount(), handler.elapsedTime())); + handler.resultCount(), stopwatch.stop())); return outputDir; }