Commit f88d85ba authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: have dummy versions for thirdparty libraries

The dummyThirdParty tree builds libraries which are drop-in
(but non-functional) versions of some thirdparty libraries. This will
make it easier to ship binary versions without having to ship thirdparty packs.
parent f37cfd52
......@@ -8,5 +8,4 @@ EXE_LIBS = \
-lfiniteVolume \
-ldecompositionMethods \
-lmeshTools \
-ldynamicMesh \
-L$(FOAM_MPI_LIBBIN) -lparMetisDecompositionMethod
-ldynamicMesh
......@@ -28,6 +28,8 @@ wmake libso surfMesh
wmake libso triSurface
# Decomposition methods needed by meshTools
parallel/AllwmakeLnInclude
dummyThirdParty/Allwmake
wmake libso parallel/decompositionMethods
wmake libso parallel/metisDecomp
......
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso scotchDecomp
wmake libso metisDecomp
wmake libso parMetisDecomp
wmake libso MGridGen
# ----------------------------------------------------------------- end-of-file
dummyMGridGen.C
LIB = $(FOAM_LIBBIN)/dummy/libMGridGen
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
//extern "C"
//{
#include "mgridgen.h"
//}
#include "error.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
static const char* notImplementedMessage =
"You are trying to use MGridGen but do not have the MGridGen library loaded.\n"
"This message is from the dummy MGridGen stub library instead.\n"
"\n"
"Normally the MGridGen library will be loaded through the LD_LIBRARY_PATH\n"
"environment variable but you are picking up this dummy library from the\n"
"$FOAM_LIBBIN/dummy directory. Please install MGridGen and make sure the\n"
"libMGridGen.so is in your LD_LIBRARY_PATH.";
#ifdef __cplusplus
extern "C"
#endif
void MGridGen(int, idxtype *, realtype *, realtype *, idxtype *, realtype *,
int, int, int *, int *, int *, idxtype *)
{
FatalErrorIn("MGridGen(..)")
<< notImplementedMessage
<< Foam::exit(Foam::FatalError);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Namespace
C linkage
Description
Dummy stub for mgridgen library functions.
Only implements the absolute minimum we are using.
SourceFiles
dummyMGridGen.C
\*---------------------------------------------------------------------------*/
#ifndef mgridgen_H
#define mgridgen_H
#include "scalar.H"
#ifndef idxtype
#define idxtype int
#define realtype Foam::scalar
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
/*---------------------------------------------------------------------------*\
Class metis Declaration
\*---------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C"
#endif
void MGridGen(int, idxtype *, realtype *, realtype *, idxtype *, realtype *,
int, int, int *, int *, int *, idxtype *);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
dummyMetisDecomp.C
LIB = $(FOAM_LIBBIN)/dummy/libmetisDecomp
EXE_INC = \
-I$(FOAM_SRC)/parallel/decompositionMethods/lnInclude \
-I$(FOAM_SRC)/parallel/metisDecomp/lnInclude
LIB_LIBS =
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "metisDecomp.H"
#include "addToRunTimeSelectionTable.H"
#include "Time.H"
static const char* notImplementedMessage =
"You are trying to use metis but do not have the metisDecomp library loaded."
"\nThis message is from the dummy metisDecomp stub library instead.\n"
"\n"
"Please install metis and make sure that libmetis.so is in your "
"LD_LIBRARY_PATH.\n"
"The metisDecomp library can then be built in $FOAM_SRC/decompositionMethods/"
"metisDecomp\n";
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(metisDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
metisDecomp,
dictionaryMesh
);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::label Foam::metisDecomp::decompose
(
const List<int>& adjncy,
const List<int>& xadj,
const scalarField& cellWeights,
List<int>& finalDecomp
)
{
FatalErrorIn
(
"labelList metisDecomp::decompose"
"("
"const List<int>&, "
"const List<int>&, "
"const scalarField&, "
"List<int>&"
")"
) << notImplementedMessage << exit(FatalError);
return -1;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::metisDecomp::metisDecomp
(
const dictionary& decompositionDict,
const polyMesh& mesh
)
:
decompositionMethod(decompositionDict),
mesh_(mesh)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::labelList Foam::metisDecomp::decompose
(
const pointField& points,
const scalarField& pointWeights
)
{
FatalErrorIn
(
"labelList metisDecomp::decompose"
"("
"const pointField&, "
"const scalarField&"
")"
) << notImplementedMessage << exit(FatalError);
return labelList();
}
Foam::labelList Foam::metisDecomp::decompose
(
const labelList& agglom,
const pointField& agglomPoints,
const scalarField& agglomWeights
)
{
FatalErrorIn
(
"labelList metisDecomp::decompose"
"("
"const labelList&, "
"const pointField&, "
"const scalarField&"
")"
) << notImplementedMessage << exit(FatalError);
return labelList();
}
Foam::labelList Foam::metisDecomp::decompose
(
const labelListList& globalCellCells,
const pointField& cellCentres,
const scalarField& cellWeights
)
{
FatalErrorIn
(
"labelList metisDecomp::decompose"
"("
"const labelListList&, "
"const pointField&, "
"const scalarField&"
")"
) << notImplementedMessage << exit(FatalError);
return labelList();
}
// ************************************************************************* //
dummyParMetisDecomp.C
LIB = $(FOAM_LIBBIN)/dummy/libparMetisDecomp
EXE_INC = \
-I$(FOAM_SRC)/parallel/decompositionMethods/lnInclude \
-I$(FOAM_SRC)/parallel/parMetisDecomp/lnInclude
LIB_LIBS =
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "parMetisDecomp.H"
#include "addToRunTimeSelectionTable.H"
#include "polyMesh.H"
#include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(parMetisDecomp, 0);
addToRunTimeSelectionTable
(
decompositionMethod,
parMetisDecomp,
dictionaryMesh
);
}
static const char* notImplementedMessage =
"You are trying to use parMetis but do not have the parMetisDecomp library "
"loaded.\n"
"This message is from the dummy parMetisDecomp stub library instead.\n"
"\n"
"Please install parMetis and make sure that libparMetis.so is in your "
"LD_LIBRARY_PATH.\n"
"The parMetisDecomp library can then be built in $FOAM_SRC/decompositionMethods/"
"parMetisDecomp\n";
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
//- Does prevention of 0 cell domains and calls parmetis.
Foam::label Foam::parMetisDecomp::decompose
(
Field<int>& xadj,
Field<int>& adjncy,
const pointField& cellCentres,
Field<int>& cellWeights,
Field<int>& faceWeights,
const List<int>& options,
List<int>& finalDecomp
)
{
FatalErrorIn
(
"label parMetisDecomp::decompose"
"("
"Field<int>&, "
"Field<int>&, "
"const pointField&, "
"Field<int>&, "
"Field<int>&, "
"const List<int>&, "
"List<int>&"
")"
)<< notImplementedMessage << exit(FatalError);
return -1;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::parMetisDecomp::parMetisDecomp
(
const dictionary& decompositionDict,
const polyMesh& mesh
)
:
decompositionMethod(decompositionDict),
mesh_(mesh)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::labelList Foam::parMetisDecomp::decompose
(
const pointField& cc,
const scalarField& cWeights
)
{
FatalErrorIn
(
"labelList parMetisDecomp::decompose"
"("
"const pointField&, "
"const scalarField&"
")"
) << notImplementedMessage << exit(FatalError);
return labelList();
}
Foam::labelList Foam::parMetisDecomp::decompose
(
const labelList& cellToRegion,
const pointField& regionPoints,
const scalarField& regionWeights
)
{
FatalErrorIn
(
"labelList parMetisDecomp::decompose"
"("
"const labelList&, "
"const pointField&, "
"const scalarField&"
")"
) << notImplementedMessage << exit(FatalError);
return labelList();
}
Foam::labelList Foam::parMetisDecomp::decompose
(
const labelListList& globalCellCells,
const pointField& cellCentres,
const scalarField& cWeights
)
{
FatalErrorIn
(
"labelList parMetisDecomp::decompose"
"("
"const labelListList&, "
"const pointField&, "
"const scalarField&"
")"
) << notImplementedMessage << exit(FatalError);
return labelList();
}
void Foam::parMetisDecomp::calcMetisDistributedCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
)
{
FatalErrorIn
(
"void parMetisDecomp::calcMetisDistributedCSR"
"("
"const polyMesh&, "
"List<int>&, "
"List<int>&"
")"
) << notImplementedMessage << exit(FatalError);
}
// ************************************************************************* //
dummyScotchDecomp.C
LIB = $(FOAM_LIBBIN)/dummy/libscotchDecomp
EXE_INC = \
-I$(FOAM_SRC)/parallel/decompositionMethods/lnInclude \
-I$(FOAM_SRC)/parallel/scotchDecomp/lnInclude
LIB_LIBS =
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
From scotch forum:
By: Francois PELLEGRINI RE: Graph mapping 'strategy' string [ reply ]
2008-08-22 10:09 Strategy handling in Scotch is a bit tricky. In order
not to be confused, you must have a clear view of how they are built.
Here are some rules:
1- Strategies are made up of "methods" which are combined by means of
"operators".
2- A method is of the form "m{param=value,param=value,...}", where "m"
is a single character (this is your first error: "f" is a method name,
not a parameter name).
3- There exist different sort of strategies : bipartitioning strategies,
mapping strategies, ordering strategies, which cannot be mixed. For
instance, you cannot build a bipartitioning strategy and feed it to a
mapping method (this is your second error).
To use the "mapCompute" routine, you must create a mapping strategy, not
a bipartitioning one, and so use stratGraphMap() and not
stratGraphBipart(). Your mapping strategy should however be based on the
"recursive bipartitioning" method ("b"). For instance, a simple (and
hence not very efficient) mapping strategy can be :
"b{sep=f}"
which computes mappings with the recursive bipartitioning method "b",
this latter using the Fiduccia-Mattheyses method "f" to compute its
separators.
If you want an exact partition (see your previous post), try
"b{sep=fx}".
However, these strategies are not the most efficient, as they do not
make use of the multi-level framework.
To use the multi-level framework, try for instance:
"b{sep=m{vert=100,low=h,asc=f}x}"
The current default mapping strategy in Scotch can be seen by using the
"-vs" option of program gmap. It is, to date:
b
{
job=t,
map=t,
poli=S,
sep=
(
m
{