Skip to content

Commit

Permalink
Add workaround for bug in montage.mosaic() — background_match=True
Browse files Browse the repository at this point in the history
There is a known bug in montage.mosaic() that raises an error if both
the 'mpi' and 'background_match' keyword arguments are set to True. As
a temporary workaround, set --cores to 1, automatically disabling MPI,
when the --background-match option is given by the user.

mpirun process exiting without calling "finalize":
astropy/montage-wrapper#18
  • Loading branch information
Víctor Terrón committed Jan 23, 2015
1 parent bc2cae5 commit a8ec3c5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mosaic.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,21 @@ def main(arguments = None):
print style.error_exit_message
return 1

# Workaround for a bug in montage.mosaic() that raises an error ('mpirun
# has exited due to process rank [...] without calling "finalize"...') if
# mpi = True and background_match = True. Until this is fixed, we can only
# use one core if the --background-match option is given by the user.

if options.background_match and options.ncores > 1:
options.ncores = 1
for msg in (
"{0}Warning: --background-match is incompatible with --cores > 1.",
"{0}Setting the --cores option to a value of one.",
"{0}This is a workaround for a known bug in montage-wrapper:",
"{0}https://github.com/astropy/montage-wrapper/issues/18"):
print msg.format(style.prefix)
print

# Map each filter to a list of FITSImage objects
files = fitsimage.InputFITSFiles()

Expand Down

0 comments on commit a8ec3c5

Please sign in to comment.