[petsc-dev] Question about DMCreateDomainDecomposition()

Lawrence Mitchell lawrence.mitchell at imperial.ac.uk
Mon Jul 18 10:06:00 CDT 2016



On 18/07/16 15:49, Lulu Liu wrote:
> Hi,
> 
> I add the following lines in the example
> /petsc/src/snes/examples/tutorials/ex19. When I run this example using
> different numbers of processors, n always equals to 1. However,
> according to the manual, n is the number of subproblems in the domain
> decomposition. I feel confused why n does not return the number of
> processors, could you explain it? Thanks!
> 
>  PetscInt n;
>  DM *subdms;
>  ierr
> =DMCreateDomainDecomposition(da,&n,NULL,NULL,NULL,&subdms);CHKERRQ(ierr);
>  PetscPrintf(PETSC_COMM_WORLD,"### n==%d\n", n);
>

You need to do -da_local_subdomains nsubdomain_per_process

or else call DMDASetNumLocalSubdomains

Cheers,

Lawrence

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160718/2bf1c9bc/attachment.sig>


More information about the petsc-dev mailing list