[petsc-users] question about MatXAIJSetPreallocation

Geoffrey Irving irving at naml.us
Tue Oct 2 18:48:58 CDT 2012


The dnnz argument to MatXAIJSetPreallocation is described as

    dnnz - number of nonzero blocks per block row of diagonal part of
parallel matrix

To me, this implies that if the matrix has size m and the block size
is bs, dnnz should have size m/bs.  However, the loop inside the
routine looks like

     for (i=0; i<m*bs; i++) {
        if (dnnz) sdnnz[i] = dnnz[i/bs] * bs;
        if (onnz) sonnz[i] = onnz[i/bs] * bs;
      }

which implies that dnnz should have m entries.  Is this a bug, or am I
misinterpreting the meaning of dnnz?

Thanks,
Geoffrey


More information about the petsc-users mailing list