views:

591

answers:

3

My interactive 32-bit Windows app (now moving from Delphi [Ent] 2007 to 2009) uses command-line interactions to spawn child processes that do computationally-intensive tasks, which in turn write text files that the GUI parent app parses and analyzes - resulting in an interactive graphical display of the results.

I have access to a multiprocessor (multi-user) Linux cluster (via ssh), and would like to off-load the heavy lifting to that cluster. My question is how to spawn the processes in Linux from my Windows app. I can envision using secure FTP to put and get files, but not sure how to spawn the child processes in Linux.

Some leads for further reading would be fine - but code/pseudocode would be ideal. I can imagine that this may be more about Windows-Linux interaction than Delphi.

+6  A: 

if you have access to ssh, one option is to issue commands through that. For example:

ssh user@host ls -l ~

will in the ssh terminal show the files in the user's home directory. I'm not sure if this is what you really want. But it would likely work.

If you do this, you almost certainly want to setup SSH password less logins

However, A more ideal solution would likely be to setup a daemon on the linux boxes whose sole job is to run specific long running tasks in the background and let you fetch the results later.

Evan Teran
I did not know about that style of remote command - easy to try, anyway.
Argalatyr
+3  A: 

You're going to have to install something on the Linux machine to run the process. You might find some kind of clustering or batch job submission API you can install and access from Windows. You might have to code a custom server. You might be able to run everything over ssh if you can drive an ssh process from Windows and if you have sshd installed on the Linux side. But my preference would be to write a webservice or simple CGI script on the Linux side designed to take your arguments and data and return the result over plain old http (or https as the case might be).

One way or another, this is going to encompass more than just coding on the Windows side.

skiphoppy
I agree that this is probably the ideal solution, but as you suggest it presents a bit more of a learning curve for me - which might be a good thing in the long-term!
Argalatyr
+1 Using a custom server has a lot of advantages. Especially that (depending on the language used to write it) stuff can be written and debugged on Windows (locally), and then be deployed on lots of different platforms, even without sshd. If you use FPC or Mono you can make use of your Pascal / Delphi knowledge, so you have a head start. It has also the benefit that controlling the process and reading / writing data uses the same mechanism. Easier to scale on multi-processor server nodes as well.
mghie
+5  A: 

I would download the full "putty" package.

As well as the excellent secure shell terminal, it includes PSCP to transfer files securely and PLINK to remote execute commands over SSH.

Hint: you will need to set up the full public/private key configuration for PLINK to work without an annoying password prompt. There is a useful guide http://unixwiz.net/techtips/putty-openssh.html>here.

James Anderson
I'm using putty but had overlooked plink - very helpful, thanks.
Argalatyr