<div dir="ltr">Quick update for the list:  Matt and I were emailing back and forth a bit and I at least have a workaround for now.<div><br></div><div>It turns out that MVAPICH2 does include their own implementations of malloc/calloc .  Matt believes (and I agree) that they should be private to the library though.  It looks like something about the way Julia is loading the library is exposing those to PETSc.</div><div><br></div><div>For now: I've worked around the issue by hardcore hacking the MVAPICH source to remove the definitions of malloc/calloc... and it DOES fix the "problem"... but, is definitely not the right answer.</div><div><br></div><div>I'm going to talk to the Julia guys here at MIT tomorrow and see if I can get to the bottom of why those symbols are getting exposed when libmpi is getting loaded.</div><div><br></div><div>Thanks Matt, for the help!</div><div><br></div><div>Derek<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 5, 2016 at 11:56 PM Derek Gaston <<a href="mailto:friedmud@gmail.com">friedmud@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Please excuse the slightly off-topic post: but I'm pulling my hair out here and I'm hoping someone else has seen this before.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I'm calling PETSc from Julia and it's working great on my Mac with MPICH but I'm seeing a segfault on my Linux cluster using MVAPICH2.  I get the same segfault both with the "official" PETSc.jl and my own smaller wrapper MiniPETSc.jl: <a href="https://github.com/friedmud/MiniPETSc.jl" class="gmail_msg" target="_blank">https://github.com/friedmud/MiniPETSc.jl</a></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Here is the stack trace I'm seeing:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">signal (11): Segmentation fault</div><div class="gmail_msg">while loading /home/gastdr/projects/falcon/julia_mpi.jl, in expression starting on line 5</div><div class="gmail_msg">_int_malloc at /home/gastdr/projects/falcon/root/lib/libmpi.so.12 (unknown line)</div><div class="gmail_msg">calloc at /home/gastdr/projects/falcon/root/lib/libmpi.so.12 (unknown line)</div><div class="gmail_msg">PetscOptionsCreate at /home/gastdr/projects/falcon/petsc-3.7.3/src/sys/objects/options.c:2578</div><div class="gmail_msg">PetscInitialize at /home/gastdr/projects/falcon/petsc-3.7.3/src/sys/objects/pinit.c:761</div><div class="gmail_msg">PetscInitializeNoPointers at /home/gastdr/projects/falcon/petsc-3.7.3/src/sys/objects/pinit.c:111</div><div class="gmail_msg">__init__ at /home/gastdr/.julia/v0.5/MiniPETSc/src/MiniPETSc.jl:14</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The script I'm running is simply just run.jl :</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">using MiniPETSc<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">It feels like libmpi is not quite loaded correctly yet.  It does get loaded by MPI.jl here: <a href="https://github.com/JuliaParallel/MPI.jl/blob/master/src/MPI.jl#L29" class="gmail_msg" target="_blank">https://github.com/JuliaParallel/MPI.jl/blob/master/src/MPI.jl#L29</a> and I've verified that that code is running before PETSc is being initialized.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">It looks ok to me... and I've tried a few variations on that dlopen() call and nothing makes it better.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">BTW: MPI.jl is working fine on its own.  I can write pure MPI Julia apps and run them in parallel on the cluster.  Just need to get this initialization of PETSc straightened out.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks for any help!</div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Derek</div></div></blockquote></div></div></div>