Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
20 changes: 19 additions & 1 deletion src/common/librnbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion src/common/librnbg_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading