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

  • Home
  • SEARCH
  • 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 8669087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:23:00+00:00 2026-06-12T18:23:00+00:00

I have a project which requires ‘n’ number of processes to work until the

  • 0

I have a project which requires ‘n’ number of processes to work until the problem is solved. Each slave process executes the same code. When a certain condition arises, the process needs to notify all of the other processes in a non-blocking way. The other processes also need to receive this message in a non-blocking way.

Is there a way to do with without threading a separate loop?

  • 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-12T18:23:02+00:00Added an answer on June 12, 2026 at 6:23 pm

    It’s been a while since I’ve used MPI. But the I functions are non-blocking. Maybe something like this:

    int comm_size = comm.Get_size();
    int comm_rank = comm.Get_rank();
    
    int* data = new int[comm_size];
    
    while (some_condition)
    {
        //During each iteration, check for messages from other nodes
        for (int node = 0; node < comm_size; node++)
        {
            if (node != comm_rank)
            {
                if (comm.Iprobe(node, TAG_NUM))
                {
                    comm.Irecv(data[node], 1, MPI_INT, node, TAG_NUM);
                }
            }
        }
    
        if (some_other_condition)
        {
            //Send the message to every node
            for (int node = 0; node < comm_size; node++)
            {
                if (node != comm_rank)
                {
                    comm.Isend(data[node], 1, MPI_INT, node, TAG_NUM);
                }
            }
        }
    
        //do normal work here.
    }
    
    delete [] data;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .NET 4.0 ASP.NET project which requires some threading work I've never
I have a project which requires creating Classes dynamically at runtime, where the only
I have started working on a project which requires Natural Language Processing. We have
I have a project which requires printing an HTML table with many rows. My
I have a project which requires me to setup an subscription-based online learning site
I have a setup project which, as a prerequisite, requires the .Net 4 framework
I have taken on a project from a client which requires me to set
I am starting a new project which requires content managment and have decided to
I have a project for a class which requires that if a database is
I have to work on a project in which I have to convert 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.