1d8606c27SBarry Smith! 2d8606c27SBarry Smith! Test AO with on IS with 0 entries - Fortran version of ex4.c 3d8606c27SBarry Smith! 4d8606c27SBarry Smith#include <petsc/finclude/petscao.h> 5*c5e229c2SMartin Diehlprogram main 6d8606c27SBarry Smith use petscao 7d8606c27SBarry Smith implicit none 8d8606c27SBarry Smith 9d8606c27SBarry Smith PetscErrorCode ierr 10d8606c27SBarry Smith AO ao 11d8606c27SBarry Smith PetscInt localvert(4), nlocal 12d8606c27SBarry Smith PetscMPIInt rank 13d8606c27SBarry Smith IS is 14d8606c27SBarry Smith PetscInt one, zero 15d8606c27SBarry Smith 167de69702SBarry Smith! Needed to work with 64-bit integers from Fortran 17d8606c27SBarry Smith one = 1 18d8606c27SBarry Smith zero = 0 19d8606c27SBarry Smith 20d8606c27SBarry Smith PetscCallA(PetscInitialize(ierr)) 21d8606c27SBarry Smith PetscCallMPIA(MPI_Comm_rank(PETSC_COMM_WORLD, rank, ierr)) 22d8606c27SBarry Smith 23d8606c27SBarry Smith nlocal = 0 244820e4eaSBarry Smith if (rank == 0) then 25d8606c27SBarry Smith nlocal = 4 26d8606c27SBarry Smith localvert(1) = 0 27d8606c27SBarry Smith localvert(2) = 1 28d8606c27SBarry Smith localvert(3) = 2 29d8606c27SBarry Smith localvert(4) = 3 30d8606c27SBarry Smith end if 31d8606c27SBarry Smith 32d8606c27SBarry Smith! Test AOCreateBasic() 335d83a8b1SBarry Smith PetscCallA(AOCreateBasic(PETSC_COMM_WORLD, nlocal, localvert, PETSC_NULL_INTEGER_ARRAY, ao, ierr)) 34d8606c27SBarry Smith PetscCallA(AODestroy(ao, ierr)) 35d8606c27SBarry Smith 36d8606c27SBarry Smith! Test AOCreateMemoryScalable() 375d83a8b1SBarry Smith PetscCallA(AOCreateMemoryScalable(PETSC_COMM_WORLD, nlocal, localvert, PETSC_NULL_INTEGER_ARRAY, ao, ierr)) 38d8606c27SBarry Smith PetscCallA(AODestroy(ao, ierr)) 39d8606c27SBarry Smith 40d8606c27SBarry Smith PetscCallA(AOCreate(PETSC_COMM_WORLD, ao, ierr)) 41d8606c27SBarry Smith PetscCallA(ISCreateStride(PETSC_COMM_WORLD, one, zero, one, is, ierr)) 42d8606c27SBarry Smith PetscCallA(AOSetIS(ao, is, is, ierr)) 43d8606c27SBarry Smith PetscCallA(AOSetType(ao, AOMEMORYSCALABLE, ierr)) 44d8606c27SBarry Smith PetscCallA(ISDestroy(is, ierr)) 45d8606c27SBarry Smith PetscCallA(AODestroy(ao, ierr)) 46d8606c27SBarry Smith 47d8606c27SBarry Smith PetscCallA(PetscFinalize(ierr)) 48d8606c27SBarry Smithend 49d8606c27SBarry Smith 50d8606c27SBarry Smith!/*TEST 51d8606c27SBarry Smith! 52d8606c27SBarry Smith! test: 533886731fSPierre Jolivet! output_file: output/empty.out 54d8606c27SBarry Smith! 55d8606c27SBarry Smith! test: 56d8606c27SBarry Smith! suffix: 2 57d8606c27SBarry Smith! nsize: 2 583886731fSPierre Jolivet! output_file: output/empty.out 59d8606c27SBarry Smith! 60d8606c27SBarry Smith!TEST*/ 61