Page 1 of 1

Stopping the simulation

Posted: Tue Jun 25, 2013 3:49 pm
by laurint
I've been using FLUKA Monta Carlo code occasionally, and it has a feature that you can end the run during the simulation without losing what has been done so far. The code checks before every primary particle (source particle) the existence of fluka.stop file in the current directory and if found, the run is ended and outputs written in proper manner, not merely killing the process.

My suggestion is that Serpent could have similar property, stopping current run/burn up-step: sss2.break/sss2.continue -files to be checked for example after every transport cycle.

Re: Stopping the simulation

Posted: Tue Jun 25, 2013 5:39 pm
by Jaakko Leppänen
Actually, the same thing could be accomplished using signals, without any file I/O. The problem is recovering the data. Restart option is certainly in my TODO-list, but it may take some time before I get to working on it.

Re: Stopping the simulation

Posted: Wed Jun 26, 2013 1:35 pm
by laurint
I didn't mean a sort of full restart option with chaining files (Elmfire guys talk about chaining files, I'm not sure it is a generally used term) or similar. I added few lines to transportcycle.c to get the feature i was looking for.

Now it checks before every transport cycle, external source or criticality source, if sss2.stop file exists and breaks if it does. Also, for burnup calculations, it removes sss2.stop file just to avoid problems with the next burnup step and its transport cycle.

The new transportcycle.c would be as an attachment if forum would accept .c or even .txt extensions. Now you need to cope with diff report:

Code: Select all

17d16
< #include <unistd.h>
94,102d92
< 
<         /*Check if user wants to stop simulation */
< 
<         if ((!access("sss2.stop",F_OK)) && (nb > 1))
<           {
<             remove("sss2.stop");
<             break;
<           }
< 
419,427d408
< 
<         /* check if user wants to stop simulation */
<         
<         if ((!access("sss2.stop",F_OK)) && (nb > (long)RDB[DATA_CRIT_SKIP]+1))
<           {
<             remove("sss2.stop");
<             break;
<           }
<