[petsc-dev] MatAXPY with DIFFERENT_NONZERO_PATTERN

Alexander Grayver agrayver at gfz-potsdam.de
Mon Apr 23 02:39:17 CDT 2012


Jed,

Thanks. However:

[ 19%] Building C object CMakeFiles/petsc.dir/src/sys/ftn-custom/zstartf.c.o
[ 19%] Building C object CMakeFiles/petsc.dir/src/sys/ftn-custom/zsys.c.o
Building C object CMakeFiles/petsc.dir/src/sys/ftn-custom/zutils.c.o
/panfs/panfs.gfz-hpcc.cluster/home/mt/agrayver/lib/petsc-dev1/src/sys/ftn-custom/zstart.c(117): 
error: expected a type specifier
   extern MPI_Op MPIU_SUM;
                 ^
/panfs/panfs.gfz-hpcc.cluster/home/mt/agrayver/lib/petsc-dev1/src/sys/ftn-custom/zstart.c(117): 
error: "MPI_Op" has already been declared in the current scope
   extern MPI_Op MPIU_SUM;
                 ^
/panfs/panfs.gfz-hpcc.cluster/home/mt/agrayver/lib/petsc-dev1/src/sys/ftn-custom/zstart.c(128): 
error: function "MPI_Op" is not a type name
   extern  MPI_Op PetscMaxSum_Op;
           ^
/panfs/panfs.gfz-hpcc.cluster/home/mt/agrayver/lib/petsc-dev1/src/sys/ftn-custom/zstart.c(220): 
error: function "MPI_Op" is not a type name
   extern  MPI_Op PetscADMax_Op;
           ^
/panfs/panfs.gfz-hpcc.cluster/home/mt/agrayver/lib/petsc-dev1/src/sys/ftn-custom/zstart.c(221): 
error: function "MPI_Op" is not a type name
   extern  MPI_Op PetscADMin_Op;
           ^
/panfs/panfs.gfz-hpcc.cluster/home/mt/agrayver/lib/petsc-dev1/src/sys/ftn-custom/zstart.c(343): 
error: expression must be an lvalue or a function designator
     *ierr = MPI_Op_create(PetscSum_Local,1,&MPIU_SUM);

On 23.04.2012 03:23, Jed Brown wrote:
> Thanks for the test case. Fixed here:
>
> http://petsc.cs.iit.edu/petsc/petsc-dev/rev/7ac7040f19d7
>
> On Sun, Apr 22, 2012 at 08:11, Alexander Grayver 
> <agrayver at gfz-potsdam.de <mailto:agrayver at gfz-potsdam.de>> wrote:
>
>     Matt,
>
>     Here are matrices (double complex, 3 MB each):
>     http://dl.dropbox.com/u/60982984/X.dat
>     http://dl.dropbox.com/u/60982984/Y.dat
>
>     Code:
>
>     static char help[] = "";
>     int main(int argc,char **args)
>     {
>       Mat            A,B;
>       PetscErrorCode ierr;
>       PetscViewer    viewer;
>       PetscScalar    cone;
>
>       PetscInitialize(&argc,&args,(char *)0,help);
>
>       ierr =
>     PetscViewerBinaryOpen(PETSC_COMM_WORLD,"Y.dat",FILE_MODE_READ,&viewer);CHKERRQ(ierr);
>       ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr);
>       ierr = MatSetFromOptions(A);CHKERRQ(ierr);
>       ierr = MatLoad(A,viewer);CHKERRQ(ierr);
>       ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
>
>       ierr =
>     PetscViewerBinaryOpen(PETSC_COMM_WORLD,"X.dat",FILE_MODE_READ,&viewer);CHKERRQ(ierr);
>       ierr = MatCreate(PETSC_COMM_WORLD,&B);CHKERRQ(ierr);
>       ierr = MatSetFromOptions(B);CHKERRQ(ierr);
>       ierr = MatLoad(B,viewer);CHKERRQ(ierr);
>       ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
>
>       cone = 1.0;
>       ierr = MatAYPX(A,cone,B,DIFFERENT_NONZERO_PATTERN);
>       ierr = PetscFinalize();
>       return 0;
>     }
>
>     It works fine if you run it with:
>     mpirun -n 10 solveTest -mat_type aij
>
>     and crashes if n > 10
>
>     Thanks.
>
>
>     On 22.04.2012 14:51, Matthew Knepley wrote:
>>     On Sun, Apr 22, 2012 at 8:41 AM, Alexander Grayver
>>     <agrayver at gfz-potsdam.de <mailto:agrayver at gfz-potsdam.de>> wrote:
>>
>>         Sorry, I don't quite get. Is this something I can avoid by
>>         doing preallocation properly or petsc issue that will be fixed?
>>
>>
>>     This looks like a PETSc bug to me, but it would be nice to get
>>     input that triggers it.
>>
>>       Thanks,
>>
>>          Matt
>>
>>         On 20.04.2012 14:23, Jed Brown wrote:
>>>         On Fri, Apr 20, 2012 at 05:18, Matthew Knepley
>>>         <knepley at gmail.com <mailto:knepley at gmail.com>> wrote:
>>>
>>>             Did someone intend to fix this, and then
>>>             stop? MatAXPY_BasicWithPreallocation() is the same
>>>             as MatAXPY_Basic().
>>>
>>>
>>>         Look how it's called. I don't know what's going on here.
>>>
>>>             ierr =
>>>         MatAXPYGetPreallocation_SeqAIJ(yy->A,xx->A,nnz_d);CHKERRQ(ierr);
>>>             ierr =
>>>         MatAXPYGetPreallocation_SeqAIJ(yy->B,xx->B,nnz_o);CHKERRQ(ierr);
>>>             ierr =
>>>         MatMPIAIJSetPreallocation(B,0,nnz_d,0,nnz_o);CHKERRQ(ierr);
>>>             ierr =
>>>         MatAXPY_BasicWithPreallocation(B,Y,a,X,str);CHKERRQ(ierr);
>>>
>>
>>
>>         -- 
>>         Regards,
>>         Alexander
>>
>>
>>
>>
>>     -- 
>>     What most experimenters take for granted before they begin their
>>     experiments is infinitely more interesting than any results to
>>     which their experiments lead.
>>     -- Norbert Wiener
>
>
>     -- 
>     Regards,
>     Alexander
>
>


-- 
Regards,
Alexander

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120423/17793ebb/attachment.html>


More information about the petsc-dev mailing list