yade-users team mailing list archive
Mailing list archive
Re: [Question #698152]: Resuming long interrupted calculations
Question #698152 on Yade changed:
Status: Open => Solved
Olivier Gillia confirmed that the question is solved:
I found another solution by the use of pickle. I have defined de OmegaParallel space, in which I put all the variables I want to retrieve when resuming. I do :
path_name1 = './RESULTATS/'
test_case = table.test_case
filename_save = path_name1 + test_case + '-sauv.bin'
filename_savePara = path_name1 + test_case + '-sauvPara.bin'
print "Retrieving saved configuration in file :",filename_save
print " and in file :",filename_savePara
OParaFile = open(filename_savePara,'rb')
OPara = pickle.load(OParaFile)
print "Resuming calculation at cycle no :",OPara.n_cycle
print " at phase no :",OPara.n_phase
print " at time :",('%6.4f' % (O.time))
print " at iter :",O.iter
… calculations takes place here …
#====== Saving the configuration for later possible resuming
OParaFile = open(OPara.filename_savePara,'wb')
print "Saving at :"
The only thing that you need to do is to declare a omegaParallel class as an external module, and import it at the beginning :
while the omegaParallel.py file contains :
def __init__(self, s):
self.s = s
r1 = 0.0
You received this question notification because your team yade-users is
an answer contact for Yade.