[Ipopt] MPI error using Ipopt

Gabriel Hackebeil gabe.hackebeil at gmail.com
Tue Oct 20 05:30:52 EDT 2015

The first thing I would try is rebuilding Ipopt without the ThirdParty/Mumps package. From what I recall, it includes a dummy “mpi.h” file to effectively serialize its own code. It’s very possible that your application is seeing that mpi.h file before the real one.

Actually, you might first just try deleting the dummy mpi.h file from the Ipopt include/coin/ThirdParty installation directory, but that may or may not cause a different set of issues.


> On Oct 20, 2015, at 2:15 AM, max leo correa cordova <max-leo-19 at hotmail.com> wrote:
> Hello! I am new using Ipopt and have tested some example problems with c++ interface. I want to use MPI for solving in parallel multiple NLP, but when runnning with MPI I get an error message. My cpp main file is:
> #include "IpIpoptApplication.hpp"
> #include "IpSolveStatistics.hpp"
> #include "MyNLP.hpp"
> #include "mpi.h"
> #include <iostream>
> using namespace Ipopt;
> using namespace std;
> int main(int argc, char** argv)
> {
>     int size, rank;
>     int i; double begin, end;
>     ApplicationReturnStatus status;
>     MPI_Init(&argc, &argv); 
>      MPI_Comm_size(MPI_COMM_WORLD, &size); 
>     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
>     begin = MPI_Wtime();
>     if(rank == 0){
>         SmartPtr<IpoptApplication> app = IpoptApplicationFactory();
>         status = app->Initialize();
>         SmartPtr<TNLP> mynlp = new MyNLP();
>         status = app->OptimizeTNLP(mynlp);
>     }
> else{
>      }
>     end = MPI_Wtime();
>     MPI_Finalize();
>     cout<< end-begin<<endl;
>     return (int) status;
> }
> I compiles fine with:
> mpic++ -O3 -o example example.cpp -I/home/max/CoinIpopt/build/include/coin -L/home/max/CoinIpopt/build/lib -lipopt -llapack -ldl -lcoinmumps -lblas -lgfortran -lm -lquadmath -lcoinhsl -lcoinmetis
> and run with:
> mpirun -np 3 ./example
> but i get this message error
> *** The MPI_comm_size() function was called before MPI_INIT was invoked.
> *** This is disallowed by the MPI standard.
> *** Your MPI job will now abort.
> [master:4655] Local abort before MPI_INIT completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed!
> I am not sure why this error exists. It seems that using the ipopt linkers produce this error. Could you help me please?? Is there something wrong in the compilation step or how can I make ipopt run using MPI? I'll be grateful for your help.
> Thanks in advance 
> max
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org <mailto:Ipopt at list.coin-or.org>
> http://list.coin-or.org/mailman/listinfo/ipopt <http://list.coin-or.org/mailman/listinfo/ipopt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20151020/89f6e4cd/attachment.html>

More information about the Ipopt mailing list