[Ipopt] MPI error using Ipopt
Seth Watts
seth.e.watts at gmail.com
Tue Oct 20 07:22:09 EDT 2015
I had the same problem, and replacing Mumps as the solver was the
work-around I used. It works well. Trying to delete the dummy mpi.h file
would be an easier fix if it works - I'd try that first, but be ready to
replace Mumps in the event removing the dummy header breaks it.
- Seth
On Tuesday, October 20, 2015, Gabriel Hackebeil <gabe.hackebeil at gmail.com>
wrote:
> 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.
>
> Gabe
>
> On Oct 20, 2015, at 2:15 AM, max leo correa cordova <
> max-leo-19 at hotmail.com
> <javascript:_e(%7B%7D,'cvml','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
> <javascript:_e(%7B%7D,'cvml','Ipopt at list.coin-or.org');>
> http://list.coin-or.org/mailman/listinfo/ipopt
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__list.coin-2Dor.org_mailman_listinfo_ipopt&d=BQMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=nyAMh1egK9edrgq59St5xGhDKYuF8MSeAbmuBm--9_Q&m=fJBHla6FIclN0ECrHUQPUyRuaMPdAEPPDfUoA8Mk28c&s=qqTAWJO9qEJ7XZr1OlEDUORxQNNncnZA26yh5XK8lbw&e=>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20151020/39143465/attachment-0001.html>
More information about the Ipopt
mailing list