Added and verified support for 64bit labels

To compile with 64bit labels set

WM_LABEL_SIZE=64

in ~/OpenFOAM/dev/prefs.sh

source ~/.bashrc

then Allwmake in OpenFOAM-dev.

This will build into for example OpenFOAM-dev/platforms/linux64ClangDPInt64Opt

If WM_LABEL_SIZE is unset or set to 32:

WM_LABEL_SIZE=32

the build would be placed into OpenFOAM-dev/platforms/linux64ClangDPInt32Opt

Thus both 32bit and 64bit label builds can coexist without problem.
This commit is contained in:
Henry
2014-12-31 19:02:52 +00:00
parent 38998d5e1f
commit 325b003b6e
116 changed files with 1515 additions and 1242 deletions

View File

@ -50,11 +50,11 @@ namespace Foam
// Call Metis with options from dictionary.
Foam::label Foam::metisDecomp::decompose
(
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
)
{
// C style numbering
@ -65,10 +65,10 @@ Foam::label Foam::metisDecomp::decompose
// k-way: multi-level k-way
word method("recursive");
int numCells = xadj.size()-1;
label numCells = xadj.size()-1;
// decomposition options
List<int> options(METIS_NOPTIONS);
List<label> options(METIS_NOPTIONS);
METIS_SetDefaultOptions(options.begin());
// processor weights initialised with no size, only used if specified in
@ -76,10 +76,10 @@ Foam::label Foam::metisDecomp::decompose
Field<floatScalar> processorWeights;
// cell weights (so on the vertices of the dual)
List<int> cellWeights;
List<label> cellWeights;
// face weights (so on the edges of the dual)
List<int> faceWeights;
List<label> faceWeights;
// Check for externally provided cellweights and if so initialise weights
@ -170,7 +170,7 @@ Foam::label Foam::metisDecomp::decompose
//{
// Info<< "metisDecomp : Using cell-based weights." << endl;
//
// IOList<int> cellIOWeights
// IOList<label> cellIOWeights
// (
// IOobject
// (
@ -209,8 +209,8 @@ Foam::label Foam::metisDecomp::decompose
(
&numCells, // num vertices in graph
&ncon, // num balancing constraints
const_cast<List<int>&>(xadj).begin(), // indexing into adjncy
const_cast<List<int>&>(adjncy).begin(), // neighbour info
const_cast<List<label>&>(xadj).begin(), // indexing into adjncy
const_cast<List<label>&>(adjncy).begin(), // neighbour info
cellWeights.begin(),// vertexweights
NULL, // vsize: total communication vol
faceWeights.begin(),// edgeweights
@ -228,8 +228,8 @@ Foam::label Foam::metisDecomp::decompose
(
&numCells, // num vertices in graph
&ncon, // num balancing constraints
const_cast<List<int>&>(xadj).begin(), // indexing into adjncy
const_cast<List<int>&>(adjncy).begin(), // neighbour info
const_cast<List<label>&>(xadj).begin(), // indexing into adjncy
const_cast<List<label>&>(adjncy).begin(), // neighbour info
cellWeights.begin(),// vertexweights
NULL, // vsize: total communication vol
faceWeights.begin(),// edgeweights

View File

@ -53,10 +53,10 @@ class metisDecomp
label decompose
(
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cellWeights,
List<int>& finalDecomp
List<label>& finalDecomp
);
//- Disallow default bitwise copy construct and assignment

View File

@ -163,11 +163,11 @@ void Foam::ptscotchDecomp::check(const int retVal, const char* str)
//Foam::label Foam::ptscotchDecomp::decomposeZeroDomains
//(
// const fileName& meshPath,
// const List<int>& initadjncy,
// const List<int>& initxadj,
// const List<label>& initadjncy,
// const List<label>& initxadj,
// const scalarField& initcWeights,
//
// List<int>& finalDecomp
// List<label>& finalDecomp
//) const
//{
// globalIndex globalCells(initxadj.size()-1);
@ -210,7 +210,7 @@ void Foam::ptscotchDecomp::check(const int retVal, const char* str)
//
// // Number of cells to send to the next processor
// // (is same as number of cells next processor has to receive)
// List<int> nSendCells(Pstream::nProcs(), 0);
// List<label> nSendCells(Pstream::nProcs(), 0);
//
// for (label procI = nSendCells.size()-1; procI >=1; procI--)
// {
@ -262,10 +262,10 @@ void Foam::ptscotchDecomp::check(const int retVal, const char* str)
// // Send cells to next processor
// OPstream toNextProc(Pstream::blocking, Pstream::myProcNo()+1);
//
// int nCells = nSendCells[Pstream::myProcNo()];
// int startCell = xadj.size()-1 - nCells;
// int startFace = xadj[startCell];
// int nFaces = adjncy.size()-startFace;
// label nCells = nSendCells[Pstream::myProcNo()];
// label startCell = xadj.size()-1 - nCells;
// label startFace = xadj[startCell];
// label nFaces = adjncy.size()-startFace;
//
// // Send for all cell data: last nCells elements
// // Send for all face data: last nFaces elements
@ -311,7 +311,7 @@ void Foam::ptscotchDecomp::check(const int retVal, const char* str)
// {
// IPstream fromNextProc(Pstream::blocking, Pstream::myProcNo()+1);
//
// List<int> nextFinalDecomp(fromNextProc);
// List<label> nextFinalDecomp(fromNextProc);
//
// if (nextFinalDecomp.size() != nSendCells[Pstream::myProcNo()])
// {
@ -330,10 +330,10 @@ void Foam::ptscotchDecomp::check(const int retVal, const char* str)
// {
// OPstream toPrevProc(Pstream::blocking, Pstream::myProcNo()-1);
//
// int nToPrevious = nSendCells[Pstream::myProcNo()-1];
// label nToPrevious = nSendCells[Pstream::myProcNo()-1];
//
// toPrevProc <<
// SubList<int>
// SubList<label>
// (
// finalDecomp,
// nToPrevious,
@ -351,14 +351,14 @@ void Foam::ptscotchDecomp::check(const int retVal, const char* str)
Foam::label Foam::ptscotchDecomp::decompose
(
const fileName& meshPath,
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
) const
{
List<int> dummyAdjncy(1);
List<int> dummyXadj(1);
List<label> dummyAdjncy(1);
List<label> dummyXadj(1);
dummyXadj[0] = 0;
return decompose
@ -378,13 +378,13 @@ Foam::label Foam::ptscotchDecomp::decompose
Foam::label Foam::ptscotchDecomp::decompose
(
const fileName& meshPath,
const int adjncySize,
const int adjncy[],
const int xadjSize,
const int xadj[],
const label adjncySize,
const label adjncy[],
const label xadjSize,
const label xadj[],
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
) const
{
if (debug)
@ -477,7 +477,7 @@ Foam::label Foam::ptscotchDecomp::decompose
// Graph
// ~~~~~
List<int> velotab;
List<label> velotab;
// Check for externally provided cellweights and if so initialise weights
@ -766,7 +766,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose
);
// Decompose using default weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose
(
mesh.time().path()/mesh.name(),
@ -819,7 +819,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose
);
// Decompose using weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose
(
mesh.time().path()/mesh.name(),
@ -866,7 +866,7 @@ Foam::labelList Foam::ptscotchDecomp::decompose
CompactListList<label> cellCells(globalCellCells);
// Decompose using weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose
(
"ptscotch",

View File

@ -64,22 +64,22 @@ class ptscotchDecomp
label decompose
(
const fileName& meshPath,
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
) const;
//- Low level decompose
label decompose
(
const fileName& meshPath,
const int adjncySize,
const int adjncy[],
const int xadjSize,
const int xadj[],
const label adjncySize,
const label adjncy[],
const label xadjSize,
const label xadj[],
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
) const;
//- Disallow default bitwise copy construct and assignment

View File

@ -173,11 +173,11 @@ void Foam::scotchDecomp::check(const int retVal, const char* str)
Foam::label Foam::scotchDecomp::decompose
(
const fileName& meshPath,
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
)
{
if (!Pstream::parRun())
@ -204,8 +204,8 @@ Foam::label Foam::scotchDecomp::decompose
// Send all to master. Use scheduled to save some storage.
if (Pstream::master())
{
Field<int> allAdjncy(nTotalConnections);
Field<int> allXadj(globalCells.size()+1);
Field<label> allAdjncy(nTotalConnections);
Field<label> allXadj(globalCells.size()+1);
scalarField allWeights(globalCells.size());
// Insert my own
@ -224,8 +224,8 @@ Foam::label Foam::scotchDecomp::decompose
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
IPstream fromSlave(Pstream::scheduled, slave);
Field<int> nbrAdjncy(fromSlave);
Field<int> nbrXadj(fromSlave);
Field<label> nbrAdjncy(fromSlave);
Field<label> nbrXadj(fromSlave);
scalarField nbrWeights(fromSlave);
// Append.
@ -244,7 +244,7 @@ Foam::label Foam::scotchDecomp::decompose
allXadj[nTotalCells] = nTotalConnections;
Field<int> allFinalDecomp;
Field<label> allFinalDecomp;
decomposeOneProc
(
meshPath,
@ -259,7 +259,7 @@ Foam::label Foam::scotchDecomp::decompose
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
OPstream toSlave(Pstream::scheduled, slave);
toSlave << SubField<int>
toSlave << SubField<label>
(
allFinalDecomp,
globalCells.localSize(slave),
@ -267,7 +267,7 @@ Foam::label Foam::scotchDecomp::decompose
);
}
// Get my own part (always first)
finalDecomp = SubField<int>
finalDecomp = SubField<label>
(
allFinalDecomp,
globalCells.localSize()
@ -278,7 +278,7 @@ Foam::label Foam::scotchDecomp::decompose
// Send my part of the graph (already in global numbering)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< adjncy << SubField<int>(xadj, xadj.size()-1)
toMaster<< adjncy << SubField<label>(xadj, xadj.size()-1)
<< cWeights;
}
@ -295,11 +295,11 @@ Foam::label Foam::scotchDecomp::decompose
Foam::label Foam::scotchDecomp::decomposeOneProc
(
const fileName& meshPath,
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
)
{
// Dump graph
@ -372,7 +372,7 @@ Foam::label Foam::scotchDecomp::decomposeOneProc
// Graph
// ~~~~~
List<int> velotab;
List<label> velotab;
// Check for externally provided cellweights and if so initialise weights
@ -625,7 +625,7 @@ Foam::labelList Foam::scotchDecomp::decompose
);
// Decompose using default weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose
(
mesh.time().path()/mesh.name(),
@ -677,7 +677,7 @@ Foam::labelList Foam::scotchDecomp::decompose
);
// Decompose using weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose
(
mesh.time().path()/mesh.name(),
@ -725,7 +725,7 @@ Foam::labelList Foam::scotchDecomp::decompose
CompactListList<label> cellCells(globalCellCells);
// Decompose using weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose
(
"scotch",

View File

@ -59,20 +59,20 @@ class scotchDecomp
label decompose
(
const fileName& meshPath,
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
);
//- Decompose non-parallel
label decomposeOneProc
(
const fileName& meshPath,
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
);
//- Disallow default bitwise copy construct and assignment