firedrakeproject / firedrake

Firedrake is an automated system for the portable solution of partial differential equations using the finite element method (FEM)
https://firedrakeproject.org
Other
520 stars 160 forks source link

tinyasm - use PetscMPIInt not PetscInt for PetscSFGetRootRanks #3803

Closed JHopeCollins closed 1 month ago

JHopeCollins commented 1 month ago

Description

If building with 64 bit integers, compiling tinyasm results in the following error:

    tinyasm/tinyasm.cpp:184:47: error: cannot convert ‘PetscInt*’ {aka ‘long int*’} to ‘PetscMPIInt*’ {aka ‘int*’}
      184 |             ierr = PetscSFGetRootRanks(sf[i], &nranks, &ranks, NULL, NULL, NULL);CHKERRQ(ierr);
          |                                               ^~~~~~~
          |                                               |
          |                                               PetscInt* {aka long int*}

PetscSFGetRootRanks has the following signature (https://petsc.org/release/manualpages/PetscSF/PetscSFGetRootRanks/):

PetscSFGetRootRanks(PetscSF sf, PetscMPIInt *nranks, const PetscMPIInt **ranks, ...)

but nranks is declared as PetscInt.

This PR changes the declaration of nranks to PetscMPIInt. The j variable is also changed to PetscMPIInt - this is fine because the only thing j is used for is a loop index with maximum extent nranks.

connorjward commented 1 month ago

This is obviously right.

github-actions[bot] commented 1 month ago
TestsPassed ✅Skipped ⏭️Failed ❌
Firedrake complex8068 ran6487 passed1581 skipped0 failed
github-actions[bot] commented 1 month ago
TestsPassed ✅Skipped ⏭️Failed ❌
Firedrake real8074 ran7288 passed786 skipped0 failed