Menu

re-run error in OSMPS

Users
2017-04-11
2018-12-11
  • Marie McLain

    Marie McLain - 2017-04-11

    I am just curious if these errors mean anything to you, specifically the part in red:

    Traceback (most recent call last):
    File "DWStatics2.py", line 276, in <module>
    main(pp)
    File "DWStatics2.py", line 137, in main
    PostProcess=PostProcess)
    File "/gpfs/lb/scratch/mamclain/MPS/MPSPyLib/Paralleltools.py", line 148, in WriteMPSParallelFiles
    PostProcess=PostProcess)
    File "/gpfs/lb/scratch/mamclain/MPS/MPSPyLib/tools.py", line 938, in WriteFiles
    append_hash2map(p, GsHash)
    File "/gpfs/lb/scratch/mamclain/MPS/MPSPyLib/tools.py", line 997, in append_hash2map
    raise ValueError("Cannot rerun simulation with different params!")
    ValueError: Cannot rerun simulation with different params!

     
  • Daniel Jaschke

    Daniel Jaschke - 2017-04-12

    Hallo Marie,

    yes, I can help you with this error. You were running a simulation, then you changed some parameters and tried to run it again. It is prevented if the filenames (directory + job_ID + unique_ID) are the same. If you think this was not the case and you get the error anyway, please let me know.

    Kind regards,

    Daniel

     
  • Weijie Huang

    Weijie Huang - 2018-12-09

    I have a same problem.
    I change codes of example 01_IsingStatics as below:

    H = mps.MPO(Operators)
    H.AddMPOTerm('bond', ['sigmaz', 'sigmaz'], hparam='J', weight=-1.0)
    H.AddMPOTerm('site', 'sigmax', hparam='g', weight=-1.0)
    myObservables = mps.Observables(Operators)
    myObservables.AddObservable('corr', ['sigmaz', 'sigmaz'], 'zz')
    
    myConv = mps.MPSConvParam(max_bond_dimension=20, max_num_sweeps=6,
                              local_tol=1E-14)
    **J0=np.array([1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0])**
    glist = np.linspace(0, 2, 21)
    parameters = []
    L = 30
    
    for g in glist:
        parameters.append({
            'simtype'                   : 'Finite',
            'job_ID'                    : 'Ising_Statics',
            'unique_ID'                 : 'g_' + str(g),
            'Write_Directory'           : 'TMP_01/',
            'Output_Directory'          : 'OUTPUTS_01/',
            'L'                         : L,
        'J'                 : J0,
            'g'                         : g,
            'verbose'                   : 1,
            'MPSObservables'            : myObservables,
            'MPSConvergenceParameters'  : myConv,
            'logfile'                   : True
        })
    
            when I run it ,some errors :
           Traceback (most recent call last):
    

    File "01_IsingStatics.py", line 105, in <module>
    main(PostProcess=Post)
    File "01_IsingStatics.py", line 65, in main
    PostProcess=PostProcess)
    File "/usr/local/lib/python2.7/dist-packages/MPSPyLib/tools.py", line 1242, in WriteFiles
    append_hash2map(p, GsHash)
    File "/usr/local/lib/python2.7/dist-packages/MPSPyLib/tools.py", line 1307, in append_hash2map
    raise ValueError("Cannot rerun simulation with different params!")
    ValueError: Cannot rerun simulation with different params!</module>

     
  • Daniel Jaschke

    Daniel Jaschke - 2018-12-09

    Dear Weijie,

    Thank you for your posting and we are happy to clarify this question. But please give us some time to answer before posting the same question in another topic of our forum. It makes it easier for us to administrate questions.

    The error "Cannot rerun simulation with different params!" usually occurs with the following usage of OSMPS:

    1) You run a simulation. Automatically, each unique ID gets associated with a hash, where the hash is generated from the parameters influencing the static results, e.g., Hamiltonian and measurements. (From the hash we can avoid running statics twice without checking every feature of the simulation as they are contained in the hash.)

    2) Now, you decide to that you want slightly different parameters, e.g., the alternating term J, and modify the python script.

    3) You try to run the simulation again. We re-generate a hash and find that it does not match the hash stored for the same unique ID in (1). This raises the error "Cannot rerun simulation ..."

    But you can avoid this by doing one of the following additional step between two and three.

    • If you do not need your previous results, delete the folders TMP and OUTPUTS.
    • Otherwise, make a copy of your script and change the name of TMP and OUTPUTS folder in the python-dictionary. Now you have both settings in different scripts and can track results back. Run the new script.

    There are some more options, but they are not as convenient if you want to track back where your results came from.

    But if you found a case where you get the error after deleting TMP and OUTPUTS and re-running your simulation twice without modifications, please let us know and share the script. Then, we will figure out why the hashes are different.

    I hope that helps you.

    Best regards,

    Daniel

     
  • Weijie Huang

    Weijie Huang - 2018-12-11

    Hi Daniel,

    It works well- thanks for all your help very much!

    Best,
    Weijie

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.