Stopping the simulation

Suggest new ideas here
Post Reply
laurint
Posts: 2
Joined: Mon Sep 24, 2012 2:54 pm
Security question 1: No
Security question 2: 92

Stopping the simulation

Post by laurint » Tue Jun 25, 2013 3:49 pm

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.

User avatar
Jaakko Leppänen
Site Admin
Posts: 2179
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Stopping the simulation

Post by Jaakko Leppänen » Tue Jun 25, 2013 5:39 pm

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.
- Jaakko

laurint
Posts: 2
Joined: Mon Sep 24, 2012 2:54 pm
Security question 1: No
Security question 2: 92

Re: Stopping the simulation

Post by laurint » Wed Jun 26, 2013 1:35 pm

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;
<           }
< 

Post Reply