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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:21:29+00:00 2026-05-22T01:21:29+00:00

I am trying to compile a code in C++ using code from : https://stackoverflow.com/questions/5953979/sending-and-receiving-array-using-mpi-part-2

  • 0

I am trying to compile a code in C++ using code from : https://stackoverflow.com/questions/5953979/sending-and-receiving-array-using-mpi-part-2.

I use the following command to compile: mpiicpc -o <filename> xxxx.cc -lmpi

After I compile, all my errors seem to refer to the two functions i have defined in my source code to print output values and do the MPI Isend and MPI Irecv. Specifically, I get two types of errors

  1. Error: Identifier “variable” is undefined
  2. Error: Too few arguments in function call: MPI_Isend/MPI_Irecv and MPI Waitall();
    Finally, it exists with this message: compilation aborted for xxxx.cc (code 2).

Could you please point to what I must be doing wrong while defining the variables?

Here is an excerpt of my source code (The code in its entirety is available at https://stackoverflow.com/questions/5953979/sending-and-receiving-array-using-mpi-part-2):

int main (int argc, char *argv[])
{
int my_rank;
int p;
int source; 
int dest;
int tag = 0;

//Allocating Memory
double *A = new double[Rows*sizeof(double)];
double *B = new double[Rows*sizeof(double)];
....
....
....

//MPI Commands
MPI_Status status;
MPI_Init (&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
MPI_Comm_size(MPI_COMM_WORLD, &p);

//For number of beats

for (ibeat=0;ibeat<beats;ibeat++)
{
    for (i=0; i<Cols/2; i++)
    {
        for (y=0; y<Rows/2; y++)
        {
            if (my_rank == 0)
                if (i < 48)
                    if (y<48)
                       V[i][y] = 0;

            if (my_rank ==
              .....
                ....
                  ....        
        }
    }

    //Load the Array with the edge values
    for (r=0; r<Rows/2; y++)
    {
        if ((my_rank == 0) || (my_rank == 1))
        {
            A[r] = V[r][48];
            BB[r] = V[r][48];
        }

        if ((my_rank
            ...
            ...
    }

    prttofile ();
    outputpass ();
    ibeat = ibeat+1;
 }

 MPI_Finalize ();
}


void prttofile ()
{
for (i = 0; i<Cols/2; i++)
  {
    for (y = 0; y<Rows/2; y++)
    {
        if (my_rank == 0)
           fout << V[i][y] << " " ;
        ....
           .... 
    }
  }

if (my_rank == 0)
    fout << endl;
 ....
}


void outputpass ()
{
int test = 2;
if ((my_rank%test) == 0)
{
    MPI_Isend(C, Rows, MPI_DOUBLE, my_rank+1, MPI_COMM_WORLD); //Non blocking Send
    MPI_Irecv(CC, Rows, MPI_DOUBLE, my_rank+1, MPI_COMM_WORLD, &status); //Non Blocking Recv
}
else if ((my_rank%test) == 1)
....
....

MPI_Waitall ();
}
  • 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-22T01:21:30+00:00Added an answer on May 22, 2026 at 1:21 am

    MPI_Isend() requires a lot more arguments than what you’ve supplied. Here’s your line:

    MPI_Isend(C, Rows, MPI_DOUBLE, my_rank+1, MPI_COMM_WORLD);
    

    Where’s the tag? Where’s the request?

    Similarly, your MPI_Waitall() doesn’t have any arguments at all! You need the array of requests, the number of requests, and an array of statuses.

    I suggest you read an example of non-blocking communication in MPI.

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

Sidebar

Related Questions

I am trying to dynamicaly compile code using CodeDom. I can load other assemblies,
I'm trying to compile such code: #include <iostream> using namespace std; class CPosition {
I'm trying to compile the following simple DL library example code from Program-Library-HOWTO with
hI, I'm trying to get this code from Larry Nyhoff's book to compile in
I'm trying to implement a pattern I read from Don Syme's blog ( https://blogs.msdn.microsoft.com/dsyme/2010/01/09/async-and-parallel-design-patterns-in-f-parallelizing-cpu-and-io-computations/
I am trying to compile code checked out of SVN from another developer. Eclipse
I'm trying to extract two blocks of code from a text file using Java
I'm trying to compile this little piece of code from the boost documentation: (http://www.boost.org/doc/libs/1_46_1/libs/iostreams/doc/tutorial/filter_usage.html)
I am trying to compile the following code: private String dataToString(){ Map data =
I'm trying to compile a POCO with this code public class MenuItem { public

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.