diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index 6619ecb44..478ec79a6 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -225,7 +225,7 @@ jobs: # Download scotch only if used if: matrix.scotch == 'on' run: | - git clone --branch v7.0.7 https://gitlab.inria.fr/scotch/scotch.git + git clone --branch v7.0.11 https://gitlab.inria.fr/scotch/scotch.git cmake -Sscotch -Bbuild-scotch -DCMAKE_INSTALL_PREFIX=scotch-install \ -DBUILD_PTSCOTCH=OFF -DCMAKE_C_FLAGS=-fPIC ${{ env.FORT_FLG }} \ ${{ env.BISON_FLG }} diff --git a/src/common/librnbg.c b/src/common/librnbg.c index 65ed81646..9f669dcbd 100644 --- a/src/common/librnbg.c +++ b/src/common/librnbg.c @@ -38,6 +38,23 @@ #include "librnbg_private.h" +/** + * \param lhs pointer to the first {box, vertex} pair. + * \param rhs pointer to the second {box, vertex} pair. + * \return a negative value, zero or a positive value if the first box index + * is respectively lower than, equal to or greater than the second one. + * + * Compare the box index of two Scotch partition pairs. + * + */ +static int +MMG5_compareScotchPairsFirst(const void *lhs, const void *rhs) { + const SCOTCH_Num *a = (const SCOTCH_Num *)lhs; + const SCOTCH_Num *b = (const SCOTCH_Num *)rhs; + + return (a[0] > b[0]) - (a[0] < b[0]); +} + /** * \param graf pointer to the input graph structure. * \param vertNbr the number of vertices. @@ -125,7 +142,8 @@ int MMG5_kPartBoxCompute(SCOTCH_Graph *graf, MMG5_int vertNbr, MMG5_int boxVertN } // Sorting the tabular, which contains box values and vertex numbers - _SCOTCHintSort2asc1(sortPartTb, vertNbr); + qsort(sortPartTb, (size_t)vertNbr, 2 * sizeof(*sortPartTb), + MMG5_compareScotchPairsFirst); /* Infering the new numbering */ diff --git a/src/common/librnbg_private.h b/src/common/librnbg_private.h index c7db0f606..0d73c78f0 100644 --- a/src/common/librnbg_private.h +++ b/src/common/librnbg_private.h @@ -49,7 +49,6 @@ #define CHECK_SCOTCH(t,m,e) if(0!=t){perror(m);return e;} -int _SCOTCHintSort2asc1(SCOTCH_Num * sortPartTb, MMG5_int vertNbr); int MMG5_kPartBoxCompute(SCOTCH_Graph*, MMG5_int, MMG5_int, SCOTCH_Num*,MMG5_pMesh); void MMG5_swapNod(MMG5_pMesh,MMG5_pPoint, double*, MMG5_pSol,MMG5_int*, MMG5_int, MMG5_int, int);