Vector containing one number
Berend van Wachem
berend at chalmers.se
Fri Jan 19 02:59:59 CST 2007
Hi,
I have problems running it if np>1. I am using open-mpi, is that the
problem, you think? Other PETSc examples seem to be working fine on
multiple processors.
Thanks
Berend.
$ mpirun -np 2 ex1
[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/petsc-as/documentation/troubleshooting.html#Signal[0]PETSC
ERROR: or try http://valgrind.org on linux or man libgmalloc on Apple
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: ------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 2.3.2, Patch 3, Fri Sep 29
17:09:34 CDT 2006 HG revision:
9215af156a9cbcdc1ec666e2b5c7934688ddc526
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC
ERROR: ------------------------------------------------------------------------
> Runs fine for me:
>
> knepley at knepley-laptop:/PETSc3/petsc/petsc-dev/src/vec/vec/examples/
>tutorials$ $MPIRUN -np 4 ./ex1001 -vec_view
> Process [0]
> 3
> Process [1]
> Process [2]
> Process [3]
>
> Matt
>
> On 1/18/07, Berend van Wachem <berend at chalmers.se> wrote:
> > Hi,
> >
> > In one of the input/output routines, I want to write one number to
> > a viewer. I created a vector with global size one, wrote the
> > number to the vector, and then viewed the vector. In the latest
> > version of Petsc, this does not seem to work anymore. What do you
> > suggest as a work around? Hereby an example code which crashes on
> > more than 1 processor:
> >
> > static char help[] = "Just a simple test";
> > #undef __FUNCT__
> > #define __FUNCT__ "main"
> > int main(int argc,char **args)
> > {
> > Vec Onevec;
> > PetscInt size,ierr;
> > PetscScalar var = 3.0;
> >
> > PetscInitialize(&argc,&args,(char *)0,help);
> > ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size);CHKERRQ(ierr);
> > ierr = VecCreateMPI(PETSC_COMM_WORLD, PETSC_DECIDE, 1,
> > &Onevec);CHKERRQ(ierr);
> > ierr = VecSetValue(Onevec, 0, var, INSERT_VALUES);
> > CHKERRQ(ierr);
> > ierr = VecAssemblyBegin(Onevec);
> > CHKERRQ(ierr);
> > ierr = VecAssemblyEnd(Onevec);
> > CHKERRQ(ierr);
> >
> > VecDestroy(Onevec);
> > ierr = PetscFinalize();CHKERRQ(ierr);
> > return 0;
> > }
> >
> > Thanks,
> >
> > Berend.
More information about the petsc-users
mailing list