[Ipopt] MPI Issue in IPOPT 3.11.7 / Mumps

Tony Kelman kelman at berkeley.edu
Fri Feb 21 02:54:24 EST 2014


Damien's suggestion does sound better than mine, thanks! Was hoping someone 
would know better than I do.

I compiled Ipopt with debugging info and ran hs071_c under GDB with 
breakpoints set in the constructor and destructor of MumpsSolverInterface, 
and interestingly saw the constructor (with its MPI_Init) for the second 
solve being called before the destructor (with its MPI_Finalize) from the 
first solve. Why would these happen in this order? Something strange with 
smart pointers maybe?

-Tony

-----Original Message----- 
From: Dominique Orban
Sent: Thursday, February 20, 2014 11:36 PM
To: Damien
Cc: ipopt at list.coin-or.org
Subject: Re: [Ipopt] MPI Issue in IPOPT 3.11.7 / Mumps

Thanks Damien. Your suggestion solves the problem of the C test, and
all tests now pass. I got in touch with Mumps guys to see what they
suggest regarding MPI_Initialized() and MPI_Finalized() in the
sequential scenario.

Cheers,
Dominique


On Thu, Feb 20, 2014 at 9:50 PM, Damien <damien at khubla.com> wrote:
> Apologies for my previous reply about sequential, I didn't read it
> correctly.  What you're seeing is the result of MPI_Init() being called
> twice without an MPI_Finalize() between the calls.  I don't have the Ipopt
> code in front of me right now, but: If there's an exit path from the
> parallel MPI MUMPS that doesn't call MPI_Finalize() after a completed 
> Ipopt
> solve, when you warm-start Ipopt, MPI_Init gets called again and MPI 
> aborts.
>
> Making Ipopt fully MPI compliant at the top level of Ipopt is not the 
> right
> software engineering answer.  MUMPS is the MPI solver, so the 
> responsibility
> should be in the MUMPS wrapper.  Keeping MPI alive or not should be a
> MUMPS-specific option.
>
> To check if MPI is initialised or not:
>
>  int is_initialized = 0;
>  MPI_Initialized(&is_initialized);
>  if(!is_initialized)
>  {
>     MPI_Init(&argc, &argv);
>  }
>
>
> and to check if it's finalised:
>
>  int is_finalized = 0;
>  MPI_Finalized(&is_finalized);
>  if(!is_finalized)
>  {
>     MPI_Finalize();
>  }
>
>
>
> Just putting these in will likely fix most of the problems, but if there's 
> a
> path to finish a solve without calling MPI_Finalize, that's a bug that 
> needs
> fixing.
>
> Also note that the MUMPS fake MPI for sequential (in the MUMPS libseq
> directory) doesn't have an implementation for MPI_Initialized or
> MPI_Finalized and those stubs need to be added to compile the code above.
>
> Cheers,
>
> Damien
>
>



More information about the Ipopt mailing list