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

The Archive Base Latest Questions

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

is there a boost::MPI equivalent of the following C MPI code? I’m trying to

  • 0

is there a boost::MPI equivalent of the following C MPI code? I’m trying to port the following standard MPI code which is a basic master slave template found here. Following from the boost mpi documentation theres only 3 parameters , for an mpi_send or mpi_recv rank, tag and buffer.

while (work != NULL) {

    /* Receive results from a slave */

    MPI_Recv(&result,           /* message buffer */
             1,                 /* one data item */
             MPI_INT,        /* of type double real */
             MPI_ANY_SOURCE,    /* receive from any sender */
             MPI_ANY_TAG,       /* any type of message */
             MPI_COMM_WORLD,    /* default communicator */
             &status);          /* info about the received message */

    /* Send the slave a new work unit */

    MPI_Send(&work,             /* message buffer */
             1,                 /* one data item */
             MPI_INT,           /* data item is an integer */
             status.MPI_SOURCE, /* to who we just received from */
             WORKTAG,           /* user chosen message tag */
             MPI_COMM_WORLD);   /* default communicator */

    /* Get the next unit of work to be done */

    work = get_next_work_item();
  }
  • 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-16T03:35:35+00:00Added an answer on June 16, 2026 at 3:35 am

    From the boost.MPI documentation:

    • MPI_ANY_SOURCE becomes any_source
    • MPI_ANY_TAG becomes any_tag

    The communicator::recv() method returns an instance of the status class that provides all the information that you need:

    • status.MPI_SOURCE is returned by status::source()
    • status.MPI_TAG is returned by status::tag()

    It also provides two cast operators to covert its content to MPI_Status structure.

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

Sidebar

Related Questions

Is there anything like boost::thread_group in C++11? I'm just trying to port my program
I am following these instructions trying to build Boost MPI .lib files, but I
There is the following example code in the BOOST MPL documentation of the find
There have been proposals for C++ delegates which have lower overhead than boost::function :
I am trying to understand the boost array . The code can be read
There are a lot of impressive Boost libraries such as Boost.Lambda or Boost.Phoenix which
Boost is essentially a c++03 library (which stimulated the c++11 standard). I'm contemplating of
Background Hi All, I'm trying to use Boost::MPI, at the moment I'm just trying
Is there a boost equivalent for memcpy? Thanks! EDIT: Sorry, I didn't realize memcpy
I'm wondering if there is a boost equivalent of ManualResetEvent? Basically, I'd like 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.