Date: 2025-03-29T05:58:31+00:00

Actual source code: zpartitionf.c

      1: #include <../src/mat/impls/adj/mpi/mpiadj.h>
      2: #include <petsc/private/ftnimpl.h>
      3: #include <petscmat.h>

      5: #if defined(PETSC_HAVE_FORTRAN_CAPS)
      6:   #define matpartitioningsetvertexweights_ MATPARTITIONINGSETVERTEXWEIGHTS
      7: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
      8:   #define matpartitioningsetvertexweights_ matpartitioningsetvertexweights
      9: #endif

     11: PETSC_EXTERN void matpartitioningsetvertexweights_NOTODAY(MatPartitioning *part, const PetscInt weights[], PetscErrorCode *ierr)
     12: {
     13:   PetscInt  len;
     14:   PetscInt *array;
     15:   *ierr = MatGetLocalSize((*part)->adj, &len, NULL);
     16:   if (*ierr) return;
     17:   *ierr = PetscMalloc1(len, &array);
     18:   if (*ierr) return;
     19:   *ierr = PetscArraycpy(array, weights, len);
     20:   if (*ierr) return;
     21:   *ierr = MatPartitioningSetVertexWeights(*part, array);
     22: }