#include "petscsf.h" PetscErrorCode PetscSFWindowSetFlavorType(PetscSF sf,PetscSFWindowFlavorType flavor)Logically Collective
sf | - star forest for communication | |
flavor | - flavor type |
PETSCSF_WINDOW_FLAVOR_CREATE: creates a new window every time, uses MPI_Win_create
PETSCSF_WINDOW_FLAVOR_DYNAMIC: uses MPI_Win_create_dynamic/MPI_Win_attach and tries to reuse windows by comparing the root array. Intended to be used on repeated applications of the same SF, e.g. for i=1 to K PetscSFOperationBegin(rootdata1,leafdata_whatever); PetscSFOperationEnd(rootdata1,leafdata_whatever); ... PetscSFOperationBegin(rootdataN,leafdata_whatever); PetscSFOperationEnd(rootdataN,leafdata_whatever); endfor The following pattern will instead raise an error PetscSFOperationBegin(rootdata1,leafdata_whatever); PetscSFOperationEnd(rootdata1,leafdata_whatever); PetscSFOperationBegin(rank ? rootdata1 : rootdata2,leafdata_whatever); PetscSFOperationEnd(rank ? rootdata1 : rootdata2,leafdata_whatever);
PETSCSF_WINDOW_FLAVOR_ALLOCATE: uses MPI_Win_allocate, reuses any pre-existing window which fits the data and it is not in use
PETSCSF_WINDOW_FLAVOR_SHARED: uses MPI_Win_allocate_shared, reusage policy as for PETSCSF_WINDOW_FLAVOR_ALLOCATE