Simfactory aborts when --basedir is added as option to 'sim create-submit'

Issue #1573 closed
Bruno Mundim created an issue

I was trying to group several simulations under the same directory name and thought of using the option --basedir to overwrite my machine default. I was able to submit the job without a problem:

 sim create-submit BLAH --config blahblah --machine loewe --basedir /path/to/new/basedir --parfile blah.par --walltime 2:00:00 --num-threads 12 --procs 96

The simulation directory and paths to executable, run and submit scripts were correctly created and saved in properties.ini in the simulation SIMFACTORY directory. However when the job was supposed to start running, Simfactory aborted with the following error message:

Error: unable to load simulation BLAH for execution
Aborting Simfactory.

I suspect this error occurs because the run command doesn't inherit the new --basedir option. I tracked down message in the definition of command_run() in sim-manage.py. Looking at SimRestart in simrestart.py we can see it loads the basedir from the machine entry:

self.BaseDir = simlib.GetBaseDir(machineEntry)

Would it be possible to save basedir to properties.ini and avoid loading it from the machine entry? This would allow the user to overwrite the machine entry.

Keyword:

Comments (8)

  1. Erik Schnetter
    • removed comment

    Saving it into the simulation's properties.ini file doesn't make sense since this file is located in basedir, so basedir needs to be known to find this file.

    I assume that the simfactory command in the submit script template (*.sub file) needs a --basedir=@BASEDIR@ option. Can you try this? You would either modify the submit script that is stored with the executable, or rebuild the executable with a --submitscript=... option.

  2. Bruno Mundim reporter
    • removed comment

    Hi Erik:

    Saving it into the simulation's properties.ini file doesn't make sense since this file is located in basedir, so basedir needs to be known to find this file.

    I had the impression the simulation info was stored there after submission and loaded when needed to run.

    I assume that the simfactory command in the submit script template (*.sub file) needs a --basedir=@BASEDIR@ option. Can you try this? You would either modify the submit script that is stored with the executable, or rebuild the executable with a --submitscript=... option.

    I tried your suggestion but unfortunately it didn't work. The submission script was updated correctly in the Cactus/config/<config_name> directory. The submission script was copied correctly to

    /path/to/new/basedir/SIMFACTORY/run/Submitscript
    

    here however I see that @MACHINE@ was already replaced while @BASEDIR@ wasn't:

    --basedir=@BASEDIR@  --machine=loewe
    

    and at last, in the output directory

    output-0000/SIMFACTORY
    

    Submitscript had still @BASEDIR@ not replaced.

    So somewhere in this chain info about basedir is not loaded or loaded directly from the machine definition. I added the option --basedir=/path/to/blah both when I 'sim build' and 'sim create-submit'.

    Thanks, Bruno.

  3. Erik Schnetter
    • removed comment

    Yes, simulation info is stored in properties.ini. However, basedir determines where the simulation is stored, so Simfactory cannot find simulation X unless it knows the basedir where X is stored.

    It seems that BASEDIR is not expanded when the submissions script is copied. This should be easy to add.

  4. Erik Schnetter
    • removed comment

    Can you try this patch?

    Index: lib/simrestart.py
    ===================================================================
    --- lib/simrestart.py   (revision 2304)
    +++ lib/simrestart.py   (working copy)
    @@ -1224,6 +1224,7 @@
             DefineDatabase.Set("EMAIL", email)
             DefineDatabase.Set("MACHINE", simenv.LocalMachine)
             DefineDatabase.Set("CONFIGURATION", configuration)
    +        DefineDatabase.Set("BASEDIR", self.BaseDir)
    
             localsourcebasedir = simlib.GetLocalSourceBaseDir()
    
  5. Bruno Mundim reporter
    • changed status to open
    • removed comment

    This patch worked well for me. Thanks! Please apply it. Would it be possible to back port it to Noether release?

  6. Log in to comment