[petsc-users] Segmentation violation in DMPlexDistribute on MacOS

Maximilian Hartig imilian.hartig at gmail.com
Tue Nov 6 04:14:08 CST 2018


Hello petsc team,

I’ve run into an issue using DMPlexDistribute on Mac OS 10.14.1. Here’s my dilemma:
- Compiling with petsc in debug mode (—with-debugging=true); the problem does not occur
- On two other (linux) machines, the error does not occur
- valgrind is not available for Mac OS Mojave at this point in time and it is unclear until when it will be
- SEGV occurs with mesh from gmsh file and  DMPlexCreateBoxMesh copied from https://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/plex/examples/tutorials/ex1.c.html <https://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/plex/examples/tutorials/ex1.c.html>
- I use the lastest petsc on maint/ branch from git
- petsc itself compiles and runs its tests (make […] check)  without problems on one and two processors.


Here’s the code I run for testing:

#include <petscds.h>
#include <petscdmplex.h>

int main(int argc, char **args) {
    PetscErrorCode ierr;
    PetscPartitioner part;
    DM dm, distributedDm;
    const char help[] = "no help";

    PetscInitialize(&argc,&args,(char*)0,help);

    ierr = DMPlexCreateFromFile(PETSC_COMM_WORLD,"cylinder_smallring.msh",PETSC_TRUE,&dm); CHKERRQ(ierr);
    // ierr = DMPlexCreateBoxMesh(PETSC_COMM_WORLD, 2, PETSC_TRUE, NULL, NULL, NULL, NULL, PETSC_TRUE, &dm); CHKERRQ(ierr);
    ierr = DMPlexGetPartitioner(dm, &part); CHKERRQ(ierr);
    ierr = PetscPartitionerSetFromOptions(part); CHKERRQ(ierr);
    // ierr = PetscPartitionerSetType(part, PETSCPARTITIONERPARMETIS); CHKERRQ(ierr);
    ierr = DMPlexDistribute(dm, 0, NULL, &distributedDm); CHKERRQ(ierr);
    if(distributedDm){
        ierr = DMDestroy(&dm); CHKERRQ(ierr);
        dm = distributedDm;
    }
    ierr = DMDestroy(&dm); CHKERRQ(ierr);

    PetscFinalize();
    return 0;
}

Here’s the error message:

scc-wkit-clx-237-216:cimply_playground maximilianhartig$ ~/petsc/arch-darwin-c/bin/mpiexec -np 2 ./meshTest
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run 
[0]PETSC ERROR: to get more information on the crash.
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Signal received
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.10.2, unknown 
[0]PETSC ERROR: ./meshTest on a arch-darwin-c named Maximilians-MacBook.local by maximilianhartig Tue Nov  6 11:02:14 2018
[0]PETSC ERROR: Configure options PETSC_ARCH=arch-darwin-c --with-debugging=false --download-mumps --download-chacoa --download-scalapack --download-mpich --with-fc=gfortran-mp-6 --download-triangle --with-cc=gcc-mp-6 --with-cxx=g++-mp-6 --download-fblaspack --download-parmetis --download-metis --download-hdf5 --download chaco
[0]PETSC ERROR: #1 User provided function() line 0 in  unknown file
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0


I don’t know how to proceed with this and would be thankful for a pointer in the right direction.
Thanks,

Max

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181106/b5ad17f6/attachment.html>


More information about the petsc-users mailing list