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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:15:57+00:00 2026-05-13T21:15:57+00:00

Sorry I cannot post any source code… I have a code running a master/slave

  • 0

Sorry I cannot post any source code…

I have a code running a master/slave red-black algorithm for a G.S. solver. In the simple case, the matrix is split into 4 evenly sized computational pieces. The images 1-3 perform their part of the computation, and send back buffers with the results to image 0. The problem is this:

I have malloc’d an array large enough to hold all of the pieces so that I can map the individual results back into a single grid. The problem seem sto be that on image 0, after the MPI_Recv call, that process is no longer aware that the grid was malloc’d for holding the whole thing. I get an error any time I try to put something in that grid. The only workaround I have found that works is to perform a malloc on all processes, and a malloc again for process zero right before the MPI_Recv.

Any ideas why it is seemingly losing the reference to that previously allocated memory?

In psuedocode:

Malloc whole[][] Have to have this allocated
Malloc partial[]
Perform compute on whole[]

If(image!= 0) MPI_Send(whole[])
Else (if image==0) 
  Malloc whole[][] again!  and this allocated otherwise the problem happens
  Loop over other images
  MPI_Recv(partial)
  Put partial[] into whole[][] Here is where the problem occurs
Endif

Thanks for the help in advance

  • 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-13T21:15:57+00:00Added an answer on May 13, 2026 at 9:15 pm

    very very unlikely it is a library bug.
    Without seen source code is nearly impossible to find problem.
    My guess you do not allocate correctly or you overwrite allocated pointers with some junk.
    To test it out, print pointer values right after allocation and right before/after mpi receive.

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

Sidebar

Related Questions

EDIT Sorry for the half post :( It seems I cannot use a column
First, I'm sorry for what must be a duplicate post. I cannot seem to
Sorry I cannot be more descriptive, basically what happened is I went to open
I'd like to remove the popup message 'Sorry this video cannot be played' from
sorry for the dummy question but I cannot find a simple and clean way
[Updated, sorry about the change but now to the real problem] I cannot include
Sorry I am very new to open graph and have been having difficulty to
We want to have two .NET apps running on the same machine communicate with
I have a website, and I need it to post status updates to a
I have a MyTouch 4g user that has submitted the following screenshots (sorry can't

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.