Pause and resume simulation

Post Reply
[email protected]
Posts: 54
Joined: Tue Mar 02, 2021 2:34 am

Pause and resume simulation

Post by [email protected] » Mon Nov 01, 2021 1:50 am

Dear STKO Team,

I would like to have the option to pause (save state) and then resume my simulations using openseesmp. Is this possible with some tcl script or is this a feature available as default for opensees? If so, how can it be done?

Thank you for your time!

Bence

marafini.f
Posts: 363
Joined: Fri Nov 13, 2020 1:52 pm

Re: Pause and resume simulation

Post by marafini.f » Mon Nov 01, 2021 10:22 am

Dear bence,

I know of a pause command in tcl developed by Alex Baker that you can find here,
https://github.com/ambaker1/public/blob ... /debug.tcl
but I never tried to use it in a parallel process. You can have a look and let us know if it works, you can use it through the custom command in the analysis steps.

Enjoy your modelling. :geek:
Francesca

[email protected]
Posts: 54
Joined: Tue Mar 02, 2021 2:34 am

Re: Pause and resume simulation

Post by [email protected] » Tue Nov 02, 2021 2:39 am

Ok. I'll give it a try.
Thank you!!

[email protected]
Posts: 54
Joined: Tue Mar 02, 2021 2:34 am

Re: Pause and resume simulation

Post by [email protected] » Tue Nov 02, 2021 5:32 am

The code works for parallel runs. However, it can not be resumed. I mean, it probably can I just faced a variable reference issue within the code. I am attaching the output from openseesmp as well as the code for 'pause' so you can see where the error occurs. If you have a suggestion on what may be going wrong please let me know.
FYI: I am sourcing the debug.tcl (source for "pause") in the main script and issuing the 'pause' statement using custom command in the analysis steps via STKO.

Opensees output:
Untitled.png
Untitled.png (6.34 KiB) Viewed 4738 times
Pause source code with stdin variable:
Untitled1.png
Untitled1.png (39.34 KiB) Viewed 4738 times

marafini.f
Posts: 363
Joined: Fri Nov 13, 2020 1:52 pm

Re: Pause and resume simulation

Post by marafini.f » Wed Nov 03, 2021 9:11 am

Dear Bence,
yes, so I guess that command, get stdin, does not work when the script is run on each processor. If you google it you see that in the manual it is not recommended to use it for a parametric study.
As of now, there is no other way that I can think of, I'll let you know if I find something!
Francesca :)

[email protected]
Posts: 54
Joined: Tue Mar 02, 2021 2:34 am

Re: Pause and resume simulation

Post by [email protected] » Wed Nov 03, 2021 9:52 am

I see. That's too bad. I will do without it.

Thanks a lot for the responses!:)

marafini.f
Posts: 363
Joined: Fri Nov 13, 2020 1:52 pm

Re: Pause and resume simulation

Post by marafini.f » Wed Nov 03, 2021 11:36 am

You are welcome!
Let's keep in touch
Francesca

STKO Team
Posts: 3066
Joined: Tue Oct 29, 2019 8:45 am

Re: Pause and resume simulation

Post by STKO Team » Wed Nov 03, 2021 2:31 pm

The pause command is used to temporarily stop the Tcl interpreter so that you can query your model or debug it, but it works for interactive mode.

What you are looking for is a method to stop the analysis, save the current state and close opensees. Later on, you may want to start opensees and resume the saved state so that you can start from there... is it correct?

In this case, you should have a look at the DataBase command:
https://opensees.berkeley.edu/wiki/inde ... e_Commands

But I'm pretty sure it will not work well, as it is not mainained from a long time, if I remember correctly

[email protected]
Posts: 54
Joined: Tue Mar 02, 2021 2:34 am

Re: Pause and resume simulation

Post by [email protected] » Thu Nov 04, 2021 1:34 am

Yes, you are right it can not collect the state from multiple cores at the same time. Thank you for the tip though!

STKO Team
Posts: 3066
Joined: Tue Oct 29, 2019 8:45 am

Re: Pause and resume simulation

Post by STKO Team » Thu Nov 04, 2021 9:46 am

You are welcome :)

Post Reply