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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:10:36+00:00 2026-05-24T02:10:36+00:00

I’m making a matriz multiplication program in OpenMPI, and I got this error message:

  • 0

I’m making a matriz multiplication program in OpenMPI, and I got this error message:

[Mecha Liberta:12337] *** Process received signal ***
[Mecha Liberta:12337] Signal: Segmentation fault (11)
[Mecha Liberta:12337] Signal code: Address not mapped (1)
[Mecha Liberta:12337] Failing at address: 0xbfe4f000
--------------------------------------------------------------------------
mpirun noticed that process rank 1 with PID 12337 on node Mecha Liberta exited on signal 11 (Segmentation fault).
--------------------------------------------------------------------------

That’s how I define the matrices:

  int **a, **b, **r;

  a = (int **)calloc(l,sizeof(int));

  b = (int **)calloc(l,sizeof(int));

  r = (int **)calloc(l,sizeof(int));

  for (i = 0; i < l; i++)
      a[i] = (int *)calloc(c,sizeof(int));

  for (i = 0; i < l; i++)
      b[i] = (int *)calloc(c,sizeof(int));      

   for (i = 0; i < l; i++)
      r[i] = (int *)calloc(c,sizeof(int)); 

And here’s my Send/Recv (i’m pretty sure my problem should be here):

  MPI_Send(&sent, 1, MPI_INT, dest, tag, MPI_COMM_WORLD); 
  MPI_Send(&lines, 1, MPI_INT, dest, tag, MPI_COMM_WORLD);   
  MPI_Send(&(a[sent][0]), lines*NCA, MPI_INT, dest, tag, MPI_COMM_WORLD); 
  MPI_Send(&b, NCA*NCB, MPI_INT, dest, tag, MPI_COMM_WORLD);

and:

MPI_Recv(&sent, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);  
MPI_Recv(&lines, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
MPI_Recv(&a, lines*NCA, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
MPI_Recv(&b, NCA*NCB, MPI_INT, 0, tag, MPI_COMM_WORLD, &status); 

Can anyone see where is the problem?

  • 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-24T02:10:37+00:00Added an answer on May 24, 2026 at 2:10 am

    This is a common problem with C and multidimensional arrays and MPI.

    In this line, say:

    MPI_Send(&b, NCA*NCB, MPI_INT, dest, tag, MPI_COMM_WORLD);
    

    you’re telling MPI to send NCAxNCB integers starting at b to dest,MPI_COMM_WORLD with tag tag. But, b isn’t a pointer to NCAxNCB integers; it’s a pointer to NCA pointers to NCB integers.

    So what you want to do is to ensure your arrays are contiguous (probably better for performance anyway), using something like this:

    int **alloc_2d_int(int rows, int cols) {
        int *data = (int *)malloc(rows*cols*sizeof(int));
        int **array= (int **)malloc(rows*sizeof(int*));
        for (int i=0; i<rows; i++)
            array[i] = &(data[cols*i]);
    
        return array;
    }
    
      /* .... */
    
      int **a, **b, **r;
    
      a = alloc_2d_int(l, c);
      b = alloc_2d_int(l, c);
      r = alloc_2d_int(l, c);
    

    and then

      MPI_Send(&sent, 1, MPI_INT, dest, tag, MPI_COMM_WORLD); 
      MPI_Send(&lines, 1, MPI_INT, dest, tag, MPI_COMM_WORLD);  
      MPI_Send(&(a[sent][0]), lines*NCA, MPI_INT, dest, tag, MPI_COMM_WORLD); 
      MPI_Send(&(b[0][0]), NCA*NCB, MPI_INT, dest, tag, MPI_COMM_WORLD);
    
    MPI_Recv(&sent, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);  
    MPI_Recv(&lines, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
    MPI_Recv(&(a[0][0]), lines*NCA, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
    MPI_Recv(&(b[0][0]), NCA*NCB, MPI_INT, 0, tag, MPI_COMM_WORLD, &status); 
    

    should work more as expected.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
i got an object with contents of html markup in it, for example: string
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker

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.