Restart on CS3.0 after interruption

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
zeph67
Posts: 53
Joined: Tue Oct 23, 2012 5:54 pm

Restart on CS3.0 after interruption

Post by zeph67 »

Hello,

I'd like to restart a calculation, after an interruption due to an electrical power outage.

I guess I must put the "checkpoint" folder into the DATA directory (am I wrong ?)

But I need to know exactly at which time step the restart will be made. I couldn't find this information neither in "main" nor in "auxiliary". NTSUIT is set to 0, which corresponds to a periodic saving. But how can I get the precise information I need ?

Thanks in advance.
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Restart on CS3.0 after interruption

Post by Yvan Fournier »

Hello,

The answer depends on the version of the code you are using. That is why providing the information specified in the forum recommendations is useful.

Regards,

Yvan
zeph67
Posts: 53
Joined: Tue Oct 23, 2012 5:54 pm

Re: Restart on CS3.0 after interruption

Post by zeph67 »

The version is 3.0.0 (I mentionned 3.0 in the subject title).

Do you need the listing file ? It is heavy, I prefer not to post it here, by default, but if it is necessary, I'll do it.
Some samples parameters :
NTSUIT = 0
NTMABS = 142411

Thanks a lot, best regards.
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Restart on CS3.0 after interruption

Post by Yvan Fournier »

Hello,

Sorry, I missed the title.

With version 3.0, you do not need to put the checkpoint directory in DATA anymore, but simply select a previous checkpoint directory using the GUI (checkpoint/restart section), or provide its path in cs_user_scripts.py if you are not using the GUI (an example is provided in that file).

By default, 4 evenly spaced checkpoints are done for each run (at least above 10 time steps). This may be changed either in the GUI or in cs_user_parameters.f90 (ntsuit).

To check the time step of a given checkpoint file, you may run

<install_prefix>/libexec/code_saturne/cs_io_dump -n <path_to_checkpoint>/main

to obtain a dump of binary file info, in which the time step will appear near the top.

The simplest is just to use a checkpoint and see at which time step the calculation restarts.

Regards,

Yvan
zeph67
Posts: 53
Joined: Tue Oct 23, 2012 5:54 pm

Re: Restart on CS3.0 after interruption

Post by zeph67 »

Thank you.

One thing I don't understand, is how to put the path to the desired 'checkpoint' is cs_user_scripts.py. Sorry, but I just don't understand the domain_auto_restart part...
Especially, isuite is defined nowhere, and it seems it doesn't matter if I specify isuite=1 in cs_user_parameters.f90

Thanks in advance.
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Restart on CS3.0 after interruption

Post by Yvan Fournier »

Hello,

The domain/auto_restart part is an example of how a user can run successive restarts, without needing to modify the xml or user subroutines to increase the number of time steps; it is useful when time slots are a bit short using a batch system, but you can ignore it in your case.

And forget about setting isuite. Starting with Code_Saturne 3.0, it has become an internal variable, whose value is determined by the existence of the "restart" directory (or symbolic link to a directory) in the execution directory. This allows managing restart behavior using just the path of the file, instead of requiring both a path and a keyword.

Regards,

Yvan
zeph67
Posts: 53
Joined: Tue Oct 23, 2012 5:54 pm

Re: Restart on CS3.0 after interruption

Post by zeph67 »

Thanks for your explanations. So, what must I do ?
To be clear, I just do not understand how to tell CS that I'd like to restart from a given checkpoint.

My idea :

cd DATA/
mkdir restart/
cp <the checkpoint I want to start from>/* restart/.

Is this right ?

Thanks.
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Restart on CS3.0 after interruption

Post by Yvan Fournier »

Hello,

No, do not copy anything in DATA. As explained in my previous posts, this is not necessary anymore with Code_Saturne 3.0.

Just select your checkpoint directory using the GUI, and run the code.

If you are not using the GUI, adapt domain.restart_input in cs_user_scripts.py (but if you are not comfortable with cs_user_scripts.py, you should be using the GUI).

Regards,

Yvan
zeph67
Posts: 53
Joined: Tue Oct 23, 2012 5:54 pm

Re: Restart on CS3.0 after interruption

Post by zeph67 »

I just insisted on copying because I didn't understand other solutions. Your last explanation is clearer now.

Nevertheless, I don't use the GUI because I don't feel comfortable with it, and thus did not install it.

Anyway, I tried what you told me. It still does not work. The calculation restarts from NTCABS = 1, although I modified domain.restart_input.

Here you'll find my cs_user_scripts.py

Thanks in advance.
Attachments
cs_user_scripts.py.txt
(12.89 KiB) Downloaded 401 times
Jacques Fontaine
Posts: 118
Joined: Mon Feb 20, 2012 2:07 pm

Re: Restart on CS3.0 after interruption

Post by Jacques Fontaine »

Hello,

You should complete "domain.restart_input" in the function "define_domain_parameters" line 141 in ur script.
Regards,
Post Reply