Index
Subject
: Re: LUG: Screen command video & related question
From
: "Daniel Underwood" <daniel.underwood@ncsu.[redacted]>
Date
: Wed, 18 Mar 2009 14:26:55 -0400
Parent
Alex,
Right, I understand and agree with most (if not all) of what you said.
In truth, the example I gave was just something off the top of my head.
I use c/c++ for most of my research. Matlab does, however, make
multi-core processing simpler. In developing and testing certain models,
we may prefer to use parallel computing via Matlab rather than taking
the time to mess with pthreads, for example. But like you said, there's
no compelling reason here not to use the command line.
I guess I'm just curious, more than anything.
To answer your question, I'm forwarding X11 over ssh. If in fact running
the program in the background will prevent it from ending upon exiting
the ssh session, I still wouldn't know how to "resume" the X11 display I
was using. Any ideas?
Thanks,
Daniel
--
Daniel Underwood
North Carolina State University
Graduate Student - Operations Research
email: daniel.underwood@ncsu.[redacted]
phone: XXX.302.3291
web: http://www4.ncsu.edu/~djunderw/
First off, doesn't running it in the background (&) automatically hand it off so it lives past logout?
I do a lot of remote computational simulations, and I always just login and run
$ python mysimulation.py &
or whatnot, and its still going when I log in again the next morning.
As for your example, you can run matlab from the command line, so running it with ampersand should be sufficient.
However, if you have to run a graphical application remotely for a long time (past login/logoff etc) ....
....you've been using Windows too long.
I would ask you to rethink why it has to be running a 3D graphical application on a remote computational run.
Maybe it would be more feasible (and less of a burn on resources) to have your program output data to a file at regular intervals. When you want to check on it you could log in and have a much smaller Matlab program just display the last data saved by your algorithm (in whatever 3D form you want) and then when you're done you close the 3D program and logout, all without interrupting the ongoing simulation.
This comes from working in a computational chemistry lab with shared resources, so we had to streamline the simulations run.
A question for you would be how are you running the graphical application? are you using ssh and tunneling X events to your local X server? Or are you actually running the program graphically on the remote machine?
As a end note: In my experience of dealing with MATLAB, I've found Python will always outrun it in the long term. For example some algorithms might be (marginally) faster to write in MATLAB, or even run faster. But when it comes to production time, and you want to incorporate sockets, or string formatting or file operations or external commands, Python beats Matlab hands down.
Also, if an algorithm I need (like DFFT) is too slow in Python I use a C implementation, which when done properly can be faster than Matlab.
All of the above IMHO.
~Alex'' (Alex Prime Prime)
On Wed, Mar 18, 2009 at 1:36 PM, Daniel Underwood
<
daniel.underwood@ncsu.[redacted]
>
wrote:
While the first stop for help should almost always be the man pages,
some commands are so unfamiliar that you may not realize their purpose
until you see them demonstrated. For me, "screen" was such a command.
There is a great (and thankfully short) video on the LinuxJournal
website demonstrating the screen command:
<
http://www.linuxjournal.com/video/transfer-your-terminal-screen
>
Ok, so many of you may be thinking: yeah, yeah, I know about screen. But
I sent this email to extend the question that originally pointed me
toward the screen command. To the point, what about continuing
non-terminal applications? Does anyone have any ideas? (Note that this
is of course in the context of remote logins.)
For example, suppose I am running an optimzation routine on Matlab, and
there is an accompanying 3D density plot providing real-time information
on the progress of the routine. If I have to logout of my ssh session, I
do not know how to prevent the Matlab process from hanging-up, being
killed, or whichever signal the process receives.
Any ideas?
--
Daniel Underwood
North Carolina State University
Graduate Student - Operations Research
email:
daniel.underwood@ncsu.[redacted]
phone: XXX.302.3291
web:
http://www4.ncsu.edu/~djunderw/
Replies
: