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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:52:49+00:00 2026-05-27T10:52:49+00:00

I am writing some code that uses MPI and I was keeping noticing some

  • 0

I am writing some code that uses MPI and I was keeping noticing some memory leaks when running it with valgrind. While trying to identify where the problem was, I ended up with this simple (and totally useless) main:

#include "/usr/include/mpi/mpi.h"

int main(int argc,char** argv)
{
MPI_Init(&argc, &argv);
MPI_Finalize();
return 0;
}

As you can see, this code doesn’t do anything and shouldn’t create any problem. However, when I run the code with valgrind (both in the serial and parallel case), I get the following summary:

==28271== HEAP SUMMARY:

==28271== in use at exit: 190,826 bytes in 2,745 blocks

==28271== total heap usage: 11,214 allocs, 8,469 frees, 16,487,977 bytes allocated

==28271==

==28271== LEAK SUMMARY:

==28271== definitely lost: 5,950 bytes in 55 blocks

==28271== indirectly lost: 3,562 bytes in 32 blocks

==28271== possibly lost: 0 bytes in 0 blocks

==28271== still reachable: 181,314 bytes in 2,658 blocks

==28271== suppressed: 0 bytes in 0 blocks

I don’t understand why there are these leaks. Maybe it’s just me not able to read the valgrind output or to use MPI initialization/finalization correctly…

I am using OMPI 1.4.1-3 under ubuntu on a 64 bit architecture, if this can help.

Thanks a lot for your time!

  • 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-27T10:52:50+00:00Added an answer on May 27, 2026 at 10:52 am

    You’re not doing anything wrong. Memcheck false positives with valgrind are common, the best you can do is suppress them.

    This page of the manual speaks more about these false positives. A quote near the end:

    The wrappers should reduce Memcheck’s false-error rate on MPI
    applications. Because the wrapping is done at the MPI interface, there
    will still potentially be a large number of errors reported in the MPI
    implementation below the interface. The best you can do is try to
    suppress them.

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

Sidebar

Related Questions

I'm writing some code that uses dynamic shared libraries as plugins. My command line
I'm writing some code that uses some unmanaged calls into user32 functions such as
I'm writing some code that looks like this: while(true) { switch(msg->state) { case MSGTYPE:
I'm writing some python code to interact with a C DLL that uses structures
I'm writing some code on a mobile device that uses a REST service to
I'm writing some code that uses a Tree (a regular tree that can have
I am writing some code in VB.NET that uses a switch statement but in
I am writing some JavaScript code that uses a string rendered with PHP. How
I've been writing WinForms code that uses a BackgroundWorker to do some async work,
I'm writing Cocoa code that uses some classes defined in a C++ library. I

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.