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 6826467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:09:03+00:00 2026-05-26T22:09:03+00:00

In a cluster running MPI code, is a copy of all the declared-variables, sent

  • 0

In a cluster running MPI code, is a copy of all the declared-variables, sent to all nodes , so that all nodes can access it locally, and not perform a remote memory access ?

  • 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-05-26T22:09:04+00:00Added an answer on May 26, 2026 at 10:09 pm

    No, MPI itself can’t do this for you in single call.

    There is an own state of memory in every MPI process, and every value may be different in any of MPI process.

    The only way of sending/receiving data is to use explicit calls of MPI, like Send or Recv. You can pack most of your data into some memory space and send this area of memory to each MPI Process, but this area will not contain ‘every declared variable’, only variables placed manually into this area.

    Update:

    Each node runs a copy of the program. Each copy will initialize variables as it want (it can be the same initialization, or individual, based on MPI Process number, called Rank; got from MPI_Comm_Rank function). So every variable exist in N copyes; one set per MPI Process. Every process sees variables, but only the set it owns. Values of variables are unsyncronized automatically.

    So, task of programmer is to syncronize values of variables between Nodes (mpi processes).
    E.g. here is small MPI program to compute Pi:

    http://www.mcs.anl.gov/research/projects/mpi/usingmpi/examples/simplempi/cpi_c.htm

    It will send value of the ‘n‘ variable from first process to all other (MPI_Bcast); and every process will send its own ‘mypi‘ after calculation into ‘pi‘ variable of first process (with addition of individual values via MPI_Reduce function).

    Only first process will be able to read N from user (via scanf) and this code is conditionally executed based on rank of process; other processes must get the N from the first because they didn’t read it from user directly.

    Update2 (sorry for late answer):
    This is syntax of MPI_Bcast. Programmer should give an address of variable into this function. Each of MPI processes will give the address of its own ‘n’ variable (it can be different). And the MPI_Bcast will

    • check the rank of current process and compare with other argument, the rank of “Broadcaster”.
    • If the current process is broadcaster, MPI_Bcast will read value, placed in memory at given address (it will read value of the ‘n’ variable on “Broadcaster”); then the value will be send via network.
    • Else, if the current process is not a broadcaster, it is an “receiver”. MPI_Bcast at receiver will get the value from “Broadcaster” (Using MPI Library internals, via network) and store the value in memory of current process at given address.

    So, the address is given to this function because on some nodes the function will write to the variable. Only value is send via network.

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

Sidebar

Related Questions

I have access to a grid (running condor) that would (potentially) allow to very
Let's say I'm running a cluster with two Weblogic server nodes on two servers
I have some legacy scientific code running on a Rocks cluster, with SGE. I
Say you have a 4-node J2EE application server cluster, all running instances of a
I have an application running in cluster mode (two nodes) under tomcat/Linux. Unfortunately I've
I have a web service that is running on a cluster of servers. This
I'm running a 4-node Cassandra cluster. Some of our nodes have some very large
I am having cassandra cluster of 12 nodes on EC2 running cassandra-0.8.2. While compaction
Hey everybody, i am deploying my code from a cluster running on ubuntu onto
I am currently running a hadoop cluster with 6 nodes 1 master and 5

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.