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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:08:49+00:00 2026-05-18T11:08:49+00:00

Let me explain. Consider 4 slave nodes 1, 2, 3, 4 and a master

  • 0

Let me explain. Consider 4 slave nodes 1, 2, 3, 4 and a master node 0. Now, 1, 2, 3, 4, need to send data to 0. 0 receives this data in the following format.

for(int proc = 1;proc<procCount;proc++) // for each processor cpu (procCount = 5)
{
    for(int p = 0;p<50;p++)
    {

    std::cout<<proc<<"\tA\t"<<p<<std::endl;

    // read in binary datas
   int chunkP;
   int realP;
   real fitnessVal;
   real fitnessValB;
   real fitnessValC;
   int conCount;
   real subConCount;
   real networkEnergyLoss;
   real movementEnergyLoss;
   long spikeCount;

   MPI_Recv (reinterpret_cast < char *>(&chunkP),
      sizeof (chunkP),
                     MPI_CHAR,proc,MPI_ANY_TAG,MPI_COMM_WORLD,&stat);
   MPI_Recv (reinterpret_cast < char *>(&realP),
      sizeof (realP),
                        .
                        .
                        .
           }
     }

Clearly, the order in which 1, 2, 3 and 4 send the data to 0 cannot be assumed (since they are all operating independently of each other — 2 might send data before 1). So assuming 2 does send its data before 1 (for example), the receiving loop in 0 shown above won’t initiate until the source tag ‘proc’ in the MPI_Recv command is matched to the processor ‘1’ because the outer for loop forces this ordering.

So what happens is the loop ‘waits’ until there is data incoming from 1 before it can do anything else even if there is already data arriving from 2, 3 and 4. What happens to this data arriving from 2,3 and 4 if it arrives before 1? Can it be ‘forgotten’ in the sense that once data from ‘1’ does start arriving and then proc increments to 2, the data that it originally tried to receive from 2 is simply not there any more? If it is ‘forgotten’, the whole distributed simulation will just hang, because it never ends up being able to process the data of a particular slave process correctly.

Thanks,
Ben.

  • 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-18T11:08:50+00:00Added an answer on May 18, 2026 at 11:08 am

    Firstly, do you really mean to receive an MPI_CHAR into chunkP – an int – shouldn’t you receive an MPI_INT?

    The messages from ranks 1:4 will not get lost – they will get queued until rank 0 chooses to receive them. This behaviour is mandated by the MPI standard.

    If the messages are large enough, ranks 1:4 may block until they can actually send their messages to rank 0 (most MPI implementations have limited buffering).

    You might also consider having rank 0 do an MPI_ANY_SOURCE receive for the first receive to see who’s ready to send. You’ll need to take care though to ensure that subsequent receives are posted for the corresponding source – look in the MPI_Status struct to see where the message was actually sent from.

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

Sidebar

Related Questions

Let me explain: this is path to this folder: > www.my_site.com/images And images are
First, let me explain what I am doing. I need to take an order,
This question might not seem programming related at first, but let me explain. I'm
Alright let me explain my situation first: I am part of an organization that
Title might be a bit confusing, so let me explain. I have a website
Is it possible to wipe strings in Delphi? Let me explain: I am writing
How would you begin improving on a really bad system? Let me explain what
How can I document a member inline in .Net? Let me explain. Most tools
Can PL/SQL procedure in Oracle know it's own name? Let me explain: CREATE OR
I know the question title isn't the best. Let me explain. I do a

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.