<div dir="ltr"><div dir="ltr">On Tue, Aug 24, 2021 at 5:47 AM Janne Ruuskanen (TAU) <<a href="mailto:janne.ruuskanen@tuni.fi">janne.ruuskanen@tuni.fi</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">PETSc was built without mpi with the command:<br>
<br>
<br>
./configure --with-openmp --with-mpi=0 --with-shared-libraries=1 --with-mumps-serial=1 --download-mumps --download-openblas --download-metis --download-slepc --with-debugging=0 --with-scalar-type=real --with-x=0 COPTFLAGS='-O3' CXXOPTFLAGS='-O3' FOPTFLAGS='-O3';<br>
<br>
so the MPI_UNI  mpi wrapper of petsc collides in names with the actual MPI used to compile sparselizard.<br></blockquote><div><br></div><div>Different MPI implementations are not ABI compatible and therefore cannot be used in the same program. You must</div><div>build all libraries in an executable with the same MPI. Thus, rebuild PETSc with the same MPI as saprselizard.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-Janne<br>
<br>
<br>
-----Original Message-----<br>
From: Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> <br>
Sent: Monday, August 23, 2021 4:45 PM<br>
To: Janne Ruuskanen (TAU) <<a href="mailto:janne.ruuskanen@tuni.fi" target="_blank">janne.ruuskanen@tuni.fi</a>><br>
Cc: <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
Subject: Re: [petsc-users] issues with mpi uni<br>
<br>
Did you build PETSc with the same openmpi [as what sparselizard is built with]?<br>
<br>
Satish<br>
<br>
On Mon, 23 Aug 2021, Janne Ruuskanen (TAU) wrote:<br>
<br>
> Hi,<br>
> <br>
> Assumingly, I have an issue using petsc and openmpi together in my c++ code.<br>
> <br>
> See the code there:<br>
> <a href="https://github.com/halbux/sparselizard/blob/master/src/slmpi.cpp" rel="noreferrer" target="_blank">https://github.com/halbux/sparselizard/blob/master/src/slmpi.cpp</a><br>
> <br>
> <br>
> So when I run:<br>
> <br>
> slmpi::initialize();<br>
> slmpi::count();<br>
> slmpi::finalize();<br>
> <br>
> I get the following error:<br>
> <br>
> <br>
> *** The MPI_Comm_size() function was called before MPI_INIT was invoked.<br>
> *** This is disallowed by the MPI standard.<br>
> *** Your MPI job will now abort.<br>
> <br>
> <br>
> Have you experienced anything similar with people trying to link openmpi and petsc into the same executable?<br>
> <br>
> Best regards,<br>
> Janne Ruuskanen<br>
> <br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>