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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:20:19+00:00 2026-05-30T14:20:19+00:00

I use MPI library for C and I would like to know is it

  • 0

I use MPI library for C and I would like to know is it possible to call the MPI collective communication methods from different parts of code by different processes?

Pseudo Example:

MPI_Rank(&rank,MPI_COMM_WORLD);

switch(rank) {
 case 0:
     MPI_Bcast(buf1,count, type, 0, comm);
     break;
 case 1:
     MPI_Bcast(buf1,count, type, 0, comm);
     break;
 case 2:
     MPI_Bcast(buf1,count, type, 0, comm);
     break;
}

or it must be called from same line of code for every process?

     MPI_Bcast(buf1,count, type, 0, comm);

Sorry for trivial question but I googled it and failed to find the answer.

Thank You !

  • 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-30T14:20:20+00:00Added an answer on May 30, 2026 at 2:20 pm

    It can be called from different parts of the code, but you must make sure that all processes in the communicator actually call MPI_Bcast to avoid deadlocking. This might be slightly more difficult to ensure if all processes follow different execution paths.

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

Sidebar

Related Questions

I would like to compile a simple C90 code utilizing math library: main.c: #include
This code sampler is used to learn MPI programming. The MPI package I use
I plan to use MPI for my C++ code. I have installed MPICH2 on
Which is best way for inter process(from different users) communication in objective c? Can
I am planning to use pure C MPI library in C++ application, I don't
I am trying to use MPI to sort digits, after sorting by the different
I plan to use MPI to build a solver that supports asynchronous communication. The
Does any body know how can I use MS_MPI in my VC++ MFC project?
I coded a mpi matrix multification program, which use scanf(%d, &size) , designate matrix
I have some parallel code (implemented using MPI) that needs to be documented. I'd

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.