[petsc-users] loosing preallocation information

Jed Brown jed at 59A2.org
Sun Mar 6 09:49:22 CST 2011


On Sun, Mar 6, 2011 at 07:39, Alexander Grayver <agrayver at gfz-potsdam.de>wrote:

> Hello,
>
> I'm newbie in PETSc.
>
> I use PETSc from FORTRAN under Windows, my build configuration is:
> Configure options: --with-cc="win32fe cl" --with-fc="win32fe ifort"
> --with-cxx="win32fe cl" --with-windows-graphics=0 --download-f-blas-lapack=1
> --with-precision=double --with-scalar-type=complex --with-clanguage=cxx
> --with-mpi-include=/cygdrive/d/Dev/HPC_2008_SDK/Include
> --with-mpi-lib="[/cygdrive/d/Dev/HPC_2008_SDK/Lib/amd64/msmpi.lib,/cygdrive/d/Dev/HPC_2008_SDK/Lib/amd64/msmpifec.lib]"
> --with-shared=0 --with-debugging=0 --with-fortran-kernels=1 --useThreads=0
>
> I wrote this code:
>
>                  call MatCreateSeqAIJ(PETSC_COMM_SELF, n, m, 2, PETSC_NULL,
> Gmat, ierr)
>                  CHKERRQ(ierr)
>
>                  call cpu_time(timetest(1))
>
>                  do irow=1,UBOUND(G, dim=1)
>                    call MatSetValue(Gmat, ir(i)-1, ic(i)-1, G(irow),e
> INSERT_VALUES, ierr)
>                  enddo
>
>                  call cpu_time(timetest(2))
>                  write(*,*) 'Time of setting matrix G was ', timetest(2) -
> timetest(1), ' seconds'
>
>                  call MatAssemblyBegin(Gmat,MAT_FINAL_ASSEMBLY,ierr)
>                  call MatAssemblyEnd(Gmat,MAT_FINAL_ASSEMBLY,ierr)
>

Are you sure this is how your code looks, in particular that there is no
MatAssembly before setting the values. Could you send the whole file.

If you are familiar with debuggers, you could call

MatSetOption(Gmat,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_TRUE,ierr)

and then run with -start_in_debugger to find the first insertion that was
not preallocated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110306/8e998e50/attachment.htm>


More information about the petsc-users mailing list