I wrapped DMPlexCreateFromCellList so that only rank 0 executes it, now I get this new error for np >= 2 (still works fine with np=1). The new error is:
[1]PETSC ERROR: --------------------- Error Message ------------------------------------
[1]PETSC ERROR: Invalid argument!
[1]PETSC ERROR: Wrong type of object: Parameter # 1!
[1]PETSC ERROR: ------------------------------------------------------------------------
[1]PETSC ERROR: Petsc Development GIT revision: dd831807ccae33b4bba0c6456b55575ff17239c3 GIT Date: 2013-06-03 14:26:06 -0600
[1]PETSC ERROR: See docs/changes/index.html for recent updates.
[1]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[1]PETSC ERROR: See docs/index.html for manual pages.
[1]PETSC ERROR: ------------------------------------------------------------------------
[1]PETSC ERROR: ./test on a arch-linux2-cxx-debug named Puget-101334 by user Wed Jul 31 16:37:07 2013
[1]PETSC ERROR: Libraries linked from /home/user/Desktop/LIBRARIES/petsc/arch-linux2-cxx-debug/lib
[1]PETSC ERROR: Configure run at Mon Jun 3 14:29:12 2013
[1]PETSC ERROR: Configure options --download-boost --download-chaco --download-ctetgen --download-f-blas-lapack --download-fiat --download-generator --download-hdf5 --download-metis --download-ml --download-mpich --download-parmetis --download-scientificpython --download-triangle --with-clanguage=cxx --with-dynamic-loading --with-openmp --with-pthreadclasses --with-shared-libraries --with-sieve --with-threadcomm PETSC_ARCH=arch-linux2-cxx-debug
[1]PETSC ERROR: ------------------------------------------------------------------------
[1]PETSC ERROR: DMPlexDistribute() line 2772 in /home/user/Desktop/LIBRARIES/petsc/src/dm/impls/plex/plex.c
Should I be doing some sort of collective instantiation on dm or dm_distrib before I attempt to distribute dm? I tried adding
call DMPlexCreate(PETSC_COMM_WORLD, dm, ierr)
CHKERRQ(ierr)
before the call to DMPlexCreateFromCellList but then the code just hangs for np >= 2 (again np=1 is fine).
A complete test code is below:
program test
implicit none
#include <finclude/petsc.h90>
DM :: dm, dm_distrib
PetscViewer :: viewer
PetscErrorCode :: ierr
PetscInt :: rank
PetscInt, dimension(6) :: cell_list
PetscReal, dimension(8) :: vertex_coords
call PetscInitialize(PETSC_NULL_CHARACTER,ierr)
CHKERRQ(ierr)
call MPI_Comm_rank(PETSC_COMM_WORLD,rank,ierr)
CHKERRQ(ierr)
cell_list = (/ 0 , 1 , 2 , 1 , 3 , 2 /)
vertex_coords = 0.0
!call DMPlexCreate(PETSC_COMM_WORLD, dm, ierr)
!CHKERRQ(ierr)
if (rank==0) then
call DMPlexCreateFromCellList(PETSC_COMM_WORLD, 2, 2, 4, 3, 1 , cell_list , 2 , vertex_coords , dm, ierr)
CHKERRQ(ierr)
end if
call DMPlexDistribute(dm,'chaco',1,dm_distrib,ierr)
CHKERRQ(ierr)
call PetscFinalize(ierr)
CHKERRQ(ierr)
end program test
-Chris
Chris Eldred <chris.eldred@gmail.com> writes:Which process executes this line? DMPlexDistribute expects rank 0 to
> Here is my relevant code:
>
> cell_list = (/ 0 , 1 , 2 , 1 , 3 , 2 /)
> vertex_coords = 0.0
>
> call DMPlexCreateFromCellList(PETSC_COMM_WORLD, 2, 2, 4, 3, 1 , cell_list
> , 2 , vertex_coords , dm, ierr)
> CHKERRQ(ierr)
hold the mesh to be distributed. If this doesn't fix the problem, can
you send a test code so we can debug and add it to our test suite?
> call DMPlexDistribute(dm,'chaco',0,dm_distrib,ierr)
> CHKERRQ(ierr)
>
> I am running the code with mpirun -np 2 ./test (it also segfaults with
> higher values for np).
>
> Any ideas? The code works fine with mpirun -np 1 (presumably since it is
> not actually attempting to distribute the mesh).