simfactory doesn't know how to handle 'old' simulations

Create issue
Issue #1262 closed
Frank Löffler created an issue

Trying to restart a simulation after an update of simfactory I get

$ sim submit A3_oct --procs=256
Assigned restart id: 2 
Traceback (most recent call last):
  File "/home/knarf/utils/simfactory/bin/../lib/sim.py", line 148, in <module>
    main()
  File "/home/knarf/utils/simfactory/bin/../lib/sim.py", line 144, in main
    CommandDispatch()
  File "/home/knarf/utils/simfactory/bin/../lib/sim.py", line 106, in CommandDispatch
    module.main()
  File "/home/knarf/utils/simfactory/lib/sim-manage.py", line 397, in main
    CommandDispatch()
  File "/home/knarf/utils/simfactory/lib/sim-manage.py", line 376, in CommandDispatch
    exec("command_%s()" % command)
  File "<string>", line 1, in <module>
  File "/home/knarf/utils/simfactory/lib/sim-manage.py", line 267, in command_submit
    restart.userSubmit(simulationName)
  File "/home/knarf/utils/simfactory/lib/simrestart.py", line 353, in userSubmit
    self.submit(submitScript)
  File "/home/knarf/utils/simfactory/lib/simrestart.py", line 590, in submit
    (nodes, ppn_used, procs, ppn, procs_requested, num_procs, num_threads, num_smt) = simlib.GetProcs(existingProperties)
  File "/home/knarf/utils/simfactory/lib/simlib.py", line 834, in GetProcs
    num_smt = existingProperties.numsmt
AttributeError: SimProperties instance has no attribute 'numsmt'

Keyword:

Comments (12)

  1. Frank Löffler reporter
    • changed status to open
    • removed comment

    I could restart using the following change, but I am not sure if this would be the correct way to patch it:

    Index: lib/simlib.py
    ===================================================================
    --- lib/simlib.py       (revision 1990)
    +++ lib/simlib.py       (working copy)
    @@ -830,7 +830,7 @@
         suggested_num_smt = int(GetMachineOption('num-smt'))
         num_smt = simenv.OptionsManager.GetOption('num-smt')
         if num_smt == None:
    -        if existingProperties != None:
    +        if existingProperties != None and existingProperties.numsmt != None:
                 num_smt = existingProperties.numsmt
             else:
                 num_smt = GetMachineOption('num-smt')
    
  2. anonymous
    • removed comment

    It seemed to work, but only because the previous (aborted) invocation wrote a new output-000? directory and the next invocation didn't find an old simulation there and didn't try to restart but started anew. oh well. Btw: the same bug also caused already queued simulations to about when they finally started after I updated simfactory.

    This patch now works:

    Index: lib/simlib.py
    ===================================================================
    --- lib/simlib.py       (revision 1990)
    +++ lib/simlib.py       (working copy)
    @@ -831,7 +831,10 @@
         num_smt = simenv.OptionsManager.GetOption('num-smt')
         if num_smt == None:
             if existingProperties != None:
    -            num_smt = existingProperties.numsmt
    +            try:
    +                num_smt = existingProperties.numsmt
    +            except AttributeError:
    +                num_smt = GetMachineOption('num-smt')
             else:
                 num_smt = GetMachineOption('num-smt')
         try:
    
  3. Frank Löffler reporter
    • removed comment

    I edited the comment which contains the patch. I now also added it as file.

  4. Erik Schnetter
    • changed status to open
    • removed comment

    Did you test this for both cases (num_smt exists and does not exist)? If so, please apply.

  5. Frank Löffler reporter
    • removed comment

    I tested when num_smt didn't exist, and it worked. I didn't test for num_smt exists yet, as I don't have such a simulation to restart right now. However, what could go wrong here given the simplicity of the patch? :)

  6. Log in to comment