A set of system tests for the SMS++ core library and several other modules.
Since most of the tests we devised for the SMS++ project require multiple modules, shipping them with a single module would add unnecessary requirements to that module. For this reason, we ship them in a separate repository.
The following tests are provided:
-
BendersBFunction: a test of theBendersBFunctioncomponent on a "hand-made"Blockfor Capacitated Facility Location (CFL) problems. -
BinaryKnapsackBlock: a tester of the eponymousBlockfor (mixed-integer) binary knapsack problems that cross-checks all its equivalentSolver(the core DP, theBranchAndXSolverin each exploration mode, with the greedy relaxation bracketing) against a standardMILPSolver, both on random instances and against the published optima of the curated Pisinger benchmark. -
BoxSolver, a tester which provides very comprehensive tests forBoxSolver(a very simpleCDASolverfor extremely simple problems where eachColVariablecan be dealt with separately subject only to bound and integrality constraints and a linear or quadraticObjective, ignoring any other kind ofConstraintif they are there) as well as to anyCDASolverable to handle Linear Programs (such asMILPSolverand its derived classesCPXMILPSolverandSCIPMILPSolver), and for some of the mechanics of the SMS++ core library. -
CapacitatedFacilityLocation, a tester that can be used to test several things together within a slope scaling approach to the Capacitated Facility Location (CFL) problem where the continuous relaxation can be solved with either standard LP tools (aMILPSolver), or via a Min-Cost Flow relaxation cast as aMCFBlockand using customMCFSolver, or, finally, via a Lagrange-friendly reformulation as a bunch ofBinaryKnapsackBlock, so that aLagrangianDualSolvercan be used to compute a stronger bound. -
compare_formulations, very simple tester for testing different formulations of some problem obtained byBlockConfig-uring in two different ways two copies of the same:Blockand solving them with two copies of the same:Solver. -
InvestmentBlock, a tester that solves the investment problem defined by anInvestmentBlock(loaded from a netCDF file) with the configured:Solver. -
LagBFunction, a tester which provides very comprehensive tests forLagBFunction,PolyhedralFunctionBlock,PolyhedralFunction, anyCDASolverable to handleC05Functionin the objective (such asBundleSolver, for which some specific provisions are made), anyCDASolverable to handle Linear Programs (such asMILPSolverand its derived classesCPXMILPSolverandSCIPMILPSolver), as well as for quite a lot of the mechanics of the SMS++ core library. -
LagrangianDualSolver_Box, a tester which provides very comprehensive tests forLagrangianDualSolver,LagBFunction,BoxSolver, anyCDASolverable to handleC05Functionin theObjective, anyCDASolverable to handle Linear Programs (such asMILPSolverand its derived classesCPXMILPSolverandSCIPMILPSolver), as well as for quite a lot of the mechanics of the SMS++ core library. -
LagrangianDualSolver_MMCF, a tester which provides initial tests forLagrangianDualSolver,LagBFunction, anyCDASolverable to handleC05Functionin theObjective(such asBundleSolver), anyCDASolverable to handle Linear Programs (such asMILPSolverand its derived classesCPXMILPSolverandSCIPMILPSolver),MMCFBlockandMCFBlock, as well as for quite a lot of the mechanics of the SMS++ core library. -
LagrangianDualSolver_UC, a tester which provides initial tests forLagrangianDualSolver,LagBFunction, anyCDASolverable to handleC05Functionin theObjective(such asBundleSolver), anyCDASolverable to handle Linear Programs (such asCPXMILPSolverandSCIPMILPSolver), theUCBlockset ofBlockfor Unit-Commitment problems, as well as for quite a lot of the mechanics of the SMS++ core library. -
LukFiBlock: a very simple main for running tests with LukFiBlock. It just creates one and loads it from a stream; little more than a compilation check. -
MCF_MILP: solve aMCFBlockwith both aMILPSolverand aMCFSolverand compare the results. This is a test forMCFBlock,MCFSolver,MILPSolverand its derived classes (CPXMILPSolverandSCIPMILPSolver), as well as for some of the mechanics of the SMS++ core library. -
MMCFBlock, a tester which provides initial tests forMMCFBlock(in particular, a way to retrieve/generate some sets of Multicommodity Min-Cost Flow instances) and anySolverable to handle Linear Programs (such asMILPSolverand its derived classesCPXMILPSolverandSCIPMILPSolver), as well as for a few of the mechanics of the SMS++ core library. -
PolyhedralFunction, a tester which provides very comprehensive tests forPolyhedralFunctionand some tests for anyCDASolverable to handleC05Functionin the objective (such asBundleSolver) and anyCDASolverable to handle Linear Programs (such asMILPSolverand its derived classesCPXMILPSolverandSCIPMILPSolver), as well as for some of the mechanics of the SMS++ core library. -
PolyhedralFunctionBlock, a tester which provides very comprehensive tests forPolyhedralFunctionand especiallyPolyhedralFunctionBlock, plus quite a few tests for anyCDASolverable to handle multipleC05Functionin the objective (such asBundleSolver) and anyCDASolverable to handle Linear Programs (such asMILPSolverand its derived classesCPXMILPSolverandSCIPMILPSolver), as well as for some of the mechanics of the SMS++ core library. -
QuadraticTests, a tester which provides very comprehensive tests for anyCDASolverable to handle Quadratic Programs (such asMILPSolverand its derived classesCPXMILPSolver,SCIPMILPSolver,GRBMILPSolverandHiGHSMILPSolver). -
ThermalUnitBlock_Solver, a tester for theThermalUnitExtDPSolverspecialised Dynamic Programming:SolverforThermalUnitBlockas compared with a:MILPSolveron some of the (many) different formulations supported byThermalUnitBlock. -
TwoStageStochasticBlock, a tester that loads aTwoStageStochasticBlockfrom a netCDF file, attaches one or two:Solverthrough aBlockSolverConfigand compares their results. -
Write-Read, a tester for the functionAbstractBlock::read_mpsand some tests for anyCDASolverable to handle Linear Programs (such asMILPSolverand its derived classesCPXMILPSolver,SCIPMILPSolver,GRBMILPSolverandHiGHSMILPSolver), as well as for some of the mechanics of the "core" SMS++ library. A random MILP is constructed in anAbstractBlockand saved to a.mpsfile. A newAbstractBlockis created and read back to the file, two:Solverare attached to the twoAbstractBlockand the results are compared. The firstAbstractBlockis randomly changed many times and the process is repeated.
The tests run as traditional command line executables. Most of the tests can also run as a CTest suite.
These instructions will let you build and run the SMS++ System Tests on your system.
- See each test for its requirements.
Configure and build all the tests using CMake:
mkdir build
cd build
cmake ..
cmake --build .Carefully hand-crafted makefiles have also been developed for those unwilling to use CMake. Makefiles build the executable in-source (in the same directory tree where the code is) as opposed to out-of-source (in the copy of the directory tree constructed in the build/ folder) and therefore it is more convenient when having to recompile often, such as when developing/debugging a new module, as opposed to the compile-and-forget usage envisioned by CMake.
Each of the executables in the individual folders has its own makefile which
includes the "main makefile" of the concerned modules, typically either
makefile-c including all necessary libraries comprised the "core SMS++" one,
or makefile-s including all necessary libraries but not the "core SMS++"
one (for the common case in which this is used together with other modules
that already include them). The makefiles in turn recursively include all the
required other makefiles, hence one should only need to edit the makefile
of each executable for compilation type (C++ compiler and its options) and it
all should be good to go. In case some of the external libraries are not at
their default location, it should only be necessary to create the
../extlib/makefile-paths out of the extlib/makefile-default-paths-* for
your OS * and edit the relevant bits (commenting out all the rest).
Check the SMS++ installation wiki for further details.
Each tester has an executable built in the corresponding directory (or in the
corresponding directory in the copy of the directory tree in the build/ folder
if you use CMake); look at the README.md in the folder and/or run it for
instructions. In several cases a (bash) batch is available to run
a default sequence of tests (this may take a while).
In case you use CMake, you can see all the (bash) batch tests available by running:
ctest -Nand run them all at one with:
ctest -V -C Releaseor you can choose a specific one from the batch test list and run it with:
ctest -V -R <batch-test-name> -C ReleaseIf you need support, you want to submit bugs or propose a new feature, you can open a new issue.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting merge requests to us.
-
Enrico Calandrini
Dipartimento di Informatica
Universita' di Pisa -
Antonio Frangioni
Dipartimento di Informatica
Università di Pisa -
Rafael Durbano Lobato
Dipartimento di Informatica
Università di Pisa
-
Federica Di Pasquale
Dipartimento di Informatica
Università di Pisa -
Ali Ghezelsoflu
Dipartimento di Informatica
Università di Pisa -
Enrico Gorgone
Dipartimento di Matematica ed Informatica
Università di Cagliari -
Niccolò Iardella
Dipartimento di Informatica
Università di Pisa
This code is provided free of charge under the GNU Lesser General Public License version 3.0 - see the LICENSE file for details.
The code is currently provided free of charge under an open-source license. As such, it is provided "as is", without any explicit or implicit warranty that it will properly behave or it will suit your needs. The Authors of the code cannot be considered liable, either directly or indirectly, for any damage or loss that anybody could suffer for having used it. More details about the non-warranty attached to this code are available in the license description file.