Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9006971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:33:25+00:00 2026-06-16T01:33:25+00:00

I am trying to utilize parallel nodes to run numerical simulations. I have Nodes

  • 0

I am trying to utilize parallel nodes to run numerical simulations. I have Nodes #0 though 12 and I wish to utilize them each individually to run a separate part of the simulation. Essentially, I need to evaluate f(x) for x=1 through 4 on one node, then f(x) for x=5 through 9 on the next node, and then f(x) for x = 10 through 14 one the next one, and then so on from there. Initially, I tried using a loop like:

n=0
while [ $n -le 12 ]
do
   ssh compute-0-$n
   #evaluate the f(x) for the x values that I want
   exit
   n=$(($n+1))
done

But this did not work because whenever I used the ssh compute-0-$n command to jump to a node the connection to the original shell script seemed to cease, when I would exit the node, the shell script seemed to continue along its merry way… I suppose there is a better way to accomplish this, but I am relatively new to this, can anyone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:33:27+00:00Added an answer on June 16, 2026 at 1:33 am

    The first thing to understand is that when you run ssh (without the &), ssh itself runs until completion. It opens up a new shell on the remote host, and reads commands — but not the commands from the script that launched it. The ssh session has no knowledge of the script that launched it; it’s waiting for commands from stdin.

    You need to do three things:

    1. Take all the code from inside your loop after the ssh line, and put
      it into its own script (call it docompute.sh).
    2. Put that script on
      each compute node, in a directory in the $PATH variable of the
      executing user, and
    3. in the parent script, replace everything in the
      loop with ssh compute-0-$n docompute.sh &. The & will get you
      the parallelism you want, by running the ssh process in the
      background.

    See running same script over many machines for discussion of something quite similar. The use of & to run the command in the background is key there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine I have two (three, four, whatever) tasks that have to run in parallel.
I am trying to utilize Google's AJAX Language API to translate each value in
I have been migrating from Windows Forms to WPF and am trying to utilize
I have build an external framework, and I am trying to utilize some images
I have just inherited a project that uses SecureSWF. I am trying to utilize
I'm trying to utilize the Maybe type in Haskell. I have a lookup for
I am trying to utilize incase-sensitive case for JSON response on NSDictionary as sometimes
I’m trying to utilize the .NET Framework 3.5 Client Profile in my application but
I'm trying to utilize CAS to perform SSO on the same domain name. however
I'm trying to utilize the power of wordpress to set up a blog on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.