Running scripts remotely

Asked by Rinaldi Giuseppe on 2012-03-28

Hi all,

I have to run a long simulation on remote computer of my professor.
This simulation takes many days so I want the simulation to run also if my laptop (from where I launch the simulation) is closed.

So I'm using the command:

yade-daily-batch scriptname.py

But if I close my laptop for more than one hour then the simulation stops on the remote computer.

Anyone now a better way to launch the script remotely?

Thanks all,

Giuseppe

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Rinaldi Giuseppe
Solved:
2012-03-30
Last query:
2012-03-30
Last reply:
2012-03-28
Christian Jakob (jakob-ifgt) said : #1

Maybe your Computer switch into power saving mode after one hour, so the calculation will be stopped.
Just try to switch power saving mode option off in your laptop settings.

Jan Stránský (honzik) said : #2

Hi Rinaldi,

how do you connect to the remote computer? via SSH? if so, try
following:

ssh username@domain
yade-daily-batch scriptname.py &
logout

the ampresand (&) character makes the process run in backround and it
will run even after logout. If you need to check the output, you can use

yade-daily-batch scriptname.py > output.log &

the > output.log will redirect all stdout (everythin what is normally
printed to terminal) to output.log file, so tomorrow you can log in
again and check what everything happened.

hopefully it will help you

regards
Jan

Rinaldi Giuseppe píše v St 28. 03. 2012 v 11:05 +0000:
> New question #191926 on Yade:
> https://answers.launchpad.net/yade/+question/191926
>
> Hi all,
>
> I have to run a long simulation on remote computer of my professor.
> This simulation takes many days so I want the simulation to run also if my laptop (from where I launch the simulation) is closed.
>
>
> So I'm using the command:
>
> yade-daily-batch scriptname.py
>
> But if I close my laptop for more than one hour then the simulation stops on the remote computer.
>
> Anyone now a better way to launch the script remotely?
>
> Thanks all,
>
> Giuseppe
>
>

Anton Gladky (gladky-anton) said : #3

Hi,

you can use "screen"-program on the remote machine [1].
I use it for all stimulations, which do not require qt-module.

You can create as many screens as you want, they can run your
simulations in background.

[1] http://savannah.gnu.org/projects/screen

Anton

Giulia Macaro (giulia-macaro) said : #4

Hey Giuseppe,

I use the command "screen", both from ubuntu and mac os terminal.
After you download it, you open the terminal, type "screen", launch the simulation.
The simulation will then continue even if you close the terminal (or the remote access).

It works when you launch the simulation directly on your pc, or with a remote access.

Hope it helps,
Giulia

Luc Sibille (luc-sibille) said : #5

Hi,

Personnally I use NX:
http://www.nomachine.com/
 when you log out the remote computer, you can choose the option "disconnect", in this case your session in the remote computer stays open and the simulation continues when you leave the remote access and turn off your laptop.

Luc

Rinaldi Giuseppe (ciosrin) said : #6

thanks to all of you!

Giuseppe