Dear PETSc team,

What is the difference between the following two methods to get the local
dimensions of a square matrix A? If they do the same, which one is
recommended? Should I use MPI_Scan after both?

1)

PetscInt local_size = PETSC_DECIDE;

MatSetSizes(A, local_size, local_size, N, N);


2)

PetscInt local_size = PETSC_DECIDE;

PetscSplitOwnership(PETSC_COMM_WORLD, &local_size, &N);

MPI_Scan(&local_size, &end_row, 1, MPIU_INT, MPI_SUM, PETSC_COMM_WORLD);
begin_row = end_row - local_size;


Thanks in advance,
Massoud

Reply via email to