Skip to content

Commit

Permalink
Merge pull request #38 from ntouran/covFix2
Browse files Browse the repository at this point in the history
Fix coverage combintions during MPI cases
  • Loading branch information
ntouran committed Mar 18, 2020
2 parents 4dbede2 + 543ef30 commit 6de79e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions armi/cases/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import coverage

import armi
from armi import context
from armi import settings
from armi import operators
from armi import runLog
Expand Down Expand Up @@ -321,6 +322,12 @@ def run(self):
cov = coverage.Coverage(
config_file=os.path.join(armi.RES, "coveragerc"), debug=["dataio"]
)
if context.MPI_SIZE > 1:
# interestingly, you cannot set the parallel flag in the constructor
# without auto-specifying the data suffix. This should enable
# parallel coverage with auto-generated data file suffixes and
# combinations.
cov.config.parallel = True
cov.start()

profiler = None
Expand Down Expand Up @@ -371,9 +378,12 @@ def run(self):
armi.MPI_COMM.barrier() # force waiting for everyone to finish

if armi.MPI_RANK == 0 and armi.MPI_SIZE > 1:
# combine all the parallel coverage data files into one and make
# the XML and HTML reports for the whole run.
combinedCoverage = coverage.Coverage(
config_file=os.path.join(armi.RES, "coveragerc"), debug=["dataio"]
)
combinedCoverage.config.parallel = True
# combine does delete the files it merges
combinedCoverage.combine()
combinedCoverage.save()
Expand Down

0 comments on commit 6de79e7

Please sign in to comment.