2013-07-04

Re-starting makemap after an interupt or crash

makemap can take a very long time to run, and it is very annoying if a power failure, or some system glitch causes it to crash after several hours. The good news is that it is now possible to re-start it from (more or less) where it left off, so long as you follow a couple of requirements when running makemap:

  1. You must include "itermap=1" or "itermap=2" in yourt config.
  2. You must assign a value to the "ITERMAPS" ADAM parameter when running makemap. This new parameter specifies the file in which the itermaps are to be placed. Previously, there was no choice about where the itermaps went - they went into the SMURF extension of the main output NDF. Now, you can specify an alternative place using ITERMAPS - note, this is an ADAM parameter and so goes on the makemap command line, NOT a config parameter. The benefit of specifying an alternative  location for itermaps is that, unlike the main output NDF, the specified file will be closed properly after writing each itermap. This means the itermaps will be usable even if makemap crashes, so long as you are not really unlucky and the crash occurs whilst it is actually writing an itermap.  
If you follow the above requirements when running makemap, you will be able to re-start makemap in the event of a crash by running makemap again in exactly the same way as you did before, but with the following changes:
  1. Add "initialsky=xyz" to your config, replacing "xyz" by one of the ADAM parameter names - "REF", "MASK1" or "MASK2".
  2. On the command line, set the chosen ADAM parameter to the path of the last itermap created by the previous run of makemap.  
  3. In the config, add "noi.calcfirst=1"


For instance:

% cat conf
...
itermap=1
...

% makemap in=^infiles out=out config=^conf itermaps=fred
..
..

oops - the computer died... OK, not to worry, I've got 67 itermaps in fred.sdf so I can re-start at iteration 68...

% makemap in=^infiles out=out config="'^conf,initialsky=ref,noi.calcfirst=1'" \
                       ref=fred.ch00i067

Note, the re-started makemap will still need to go through the labourious task of cleaning the input time series data again, before it starts iterating. 

No comments: