<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">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.<div class=""><br class=""></div><div class="">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.<br class=""><div class=""><br class=""></div><div class="">Gabe<br class=""><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On Oct 20, 2015, at 2:15 AM, max leo correa cordova <<a href="mailto:max-leo-19@hotmail.com" class="">max-leo-19@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">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:<br class=""><br class=""><font size="1" style="font-size: 8pt;" class="">#include "IpIpoptApplication.hpp"</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">#include "IpSolveStatistics.hpp"</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">#include "MyNLP.hpp"</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">#include "mpi.h"</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">#include <iostream></font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">using namespace Ipopt;</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">using namespace std;</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">int main(int argc, char** argv)</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">{</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    int size, rank;</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    int i; double begin, end;</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    ApplicationReturnStatus status;</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    MPI_Init(&argc, &argv);<span class="Apple-converted-space"> </span></font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">     MPI_Comm_size(MPI_COMM_WORLD, &size);<span class="Apple-converted-space"> </span></font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    MPI_Comm_rank(MPI_COMM_WORLD, &rank);</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    begin = MPI_Wtime();</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    if(rank == 0){</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">        SmartPtr<IpoptApplication> app = IpoptApplicationFactory();</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">        status = app->Initialize();</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">        SmartPtr<TNLP> mynlp = new MyNLP();</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">        status = app->OptimizeTNLP(mynlp);</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    }</font><font size="1" style="font-size: 8pt;" class=""><br class="">else{<br class=""><br class="">     }<br class=""></font><font size="1" style="font-size: 8pt;" class="">    end = MPI_Wtime();</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    MPI_Finalize();</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    cout<< end-begin<<endl;</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">    return (int) status;</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">}</font><br class=""><br class="">I compiles fine with:<br class=""><font size="1" style="font-size: 8pt;" class="">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</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><br class="">and run with:<br class=""><font size="1" style="font-size: 8pt;" class="">mpirun -np 3 ./example<br class=""><br class=""><font size="3" style="font-size: 12pt;" class="">but i get this message error<br class=""><font size="1" style="font-size: 8pt;" class="">*** The MPI_comm_size() function was called before MPI_INIT was invoked.</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">*** This is disallowed by the MPI standard.</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">*** Your MPI job will now abort.</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><font size="1" style="font-size: 8pt;" class="">[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!</font><font size="1" style="font-size: 8pt;" class=""><br class=""></font><br class="">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?</font></font><span id="result_box" class="short_text" lang="en"><span class="hps"><font size="3" style="font-size: 12pt;" class=""><span class="Apple-converted-space"> </span>I</font>'ll be</span><span class="Apple-converted-space"> </span><span class="hps">grateful for your help.<br class="">Thanks in advance<span class="Apple-converted-space"> </span><br class="">max<br class=""></span></span></div><span style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Ipopt mailing list</span><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:Ipopt@list.coin-or.org" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Ipopt@list.coin-or.org</a><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://list.coin-or.org/mailman/listinfo/ipopt" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://list.coin-or.org/mailman/listinfo/ipopt</a></div></blockquote></div><br class=""></div></div></div></body></html>