Permalink
Browse files

modified: ../CMakeLists.txt

	modified:   ../apps/BasicDemos/CMakeLists.txt
	modified:   ../apps/PerformanceGeom/LifOne.cpp
	modified:   ../apps/UnitMPILib/DelayAssemblyTest.cpp
	modified:   ../apps/largeNetwork/CMakeLists.txt
	modified:   ../cmake-modules/FindRoot.cmake
	modified:   ../doc/Doxyfile.cmake
	modified:   ../libs/GeomLib/GeomAlgorithmCode.hpp
	modified:   ../libs/GeomLib/MuSigmaScalarProduct.hpp
	modified:   ../libs/MPILib/CMakeLists.txt
	modified:   ../libs/MPILib/include/MPINetworkCode.hpp
	modified:   ../libs/MPILib/include/MPINode.hpp
	modified:   ../libs/MPILib/include/MPINodeCode.hpp
	modified:   ../libs/MPILib/include/algorithm/AlgorithmInterface.hpp
	modified:   ../libs/MPILib/include/populist/StampedProbability.hpp
	modified:   ../libs/MPILib/include/report/handler/AbstractReportHandler.hpp
	modified:   ../libs/MPILib/include/report/handler/RootCanvasNoMPI.hpp
	modified:   ../libs/MPILib/include/report/handler/RootHighThroughputHandler.hpp
	modified:   ../libs/MPILib/include/report/handler/RootReportHandler.hpp
	modified:   ../libs/MPILib/include/report/handler/ValueHandlerHandler.hpp
	modified:   ../libs/MPILib/src/report/handler/RootCanvasNoMPI.cpp
	modified:   ../libs/MPILib/src/report/handler/RootHighThroughputHandler.cpp
	modified:   ../libs/MPILib/src/report/handler/RootReportHandler.cpp
	modified:   ../libs/MPILib/src/report/handler/ValueHandlerHandler.cpp
  • Loading branch information...
Marc de Kamps
Marc de Kamps committed Oct 7, 2016
1 parent ab85026 commit 76900a88e9ab61666a36623f52161df00c8fdd2f
View
@@ -32,6 +32,7 @@ set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
##############################################################################
OPTION(ENABLE_TESTING "Compile tests" ON)
OPTION(ENABLE_ROOT "Root Desired" OFF)
OPTION(ENABLE_MEMORY_TEST "Generate memory test" OFF)
OPTION(ENABLE_MPI "Enable mpi" FALSE)
OPTION(ENABLE_COVERAGE "Enable GCov coverage analysis (defines a 'coverage' target and enforces static build of miind)" OFF)
@@ -96,12 +97,17 @@ if( Boost_FOUND )
else ( Boost_FOUND )
message(FATAL_ERROR "Boost is mandatory to build the libraries")
endif( Boost_FOUND )
##############################################################################
#
##############################################################################
IF(ENABLE_ROOT)
find_package( Root )
if( ROOT_FOUND )
message(STATUS "Building Root dependent parts")
message(STATUS "Root include directories:" ${ROOT_INCLUDE_DIRS})
message(STATUS "Root library directories:" ${ROOT_LIBRARY_DIRS})
set (ROOT_LIBRARIES Core Hist Tree Table Matrix MathCore MathMore Gpad Graf Postscript RIO)
add_definitions(-DWANTROOT)
else( ROOT_FOUND )
message(FATAL_ERROR "Root is required for MPILib")
endif( ROOT_FOUND )
@@ -112,6 +118,7 @@ SET (LIB_PREFIX lib)
else (WIN32)
SET (CBLAS_PREFIX gsl)
endif (WIN32)
ENDIF (ENABLE_ROOT)
#############################################################################
# code coverage analysis
#############################################################################
@@ -37,10 +37,10 @@ set ( LIBLIST
#############################################################################
# executables
#############################################################################
if (ENABLE_ROOT)
add_executable(wilsoncowanDemo wilsoncowan.cpp)
target_link_libraries(wilsoncowanDemo ${LIBLIST})
add_executable(populationDemo population-example.cpp)
target_link_libraries(populationDemo ${LIBLIST})
endif (ENABLE_ROOT)
@@ -85,7 +85,7 @@ int main(){
MPILib::DelayedConnection con(1,0.03,0.0);
network.makeFirstInputOfSecond(id_rate,id_alg,con);
const MPILib::report::handler::RootReportHandler handler("singlepoptest", true);
const MPILib::report::handler::RootReportHandler handler("singlepoptest", true, false);
const SimulationRunParameter
par_run
@@ -31,7 +31,6 @@ typedef MPILib::MPINetwork<MPILib::DelayedConnection, MPILib::utilities::Circula
typedef GeomLib::GeomAlgorithm<MPILib::DelayedConnection> GeomDelayAlg;
using MPILib::algorithm::RateFunctor;
using MPILib::report::handler::RootReportHandler;
using MPILib::algorithm::DelayAssemblyParameter;
using MPILib::algorithm::DelayAssemblyAlgorithm;
using MPILib::Time;
@@ -42,8 +41,7 @@ using MPILib::Time;
BOOST_AUTO_TEST_CASE(DelayAssemblyConstructionTest ) {
MPILib::algorithm::DelayAssemblyParameter par_ass;
MPILib::algorithm::DelayAssemblyAlgorithm<double> alg_ass(par_ass);
MPILib::algorithm::DelayAssemblyAlgorithm<MPILib::DelayedConnection> alg_ass(par_ass);
}
Rate SwitchOnAndOff(Time t){
@@ -79,7 +77,7 @@ BOOST_AUTO_TEST_CASE(DelayAssemblyNetworkTest) {
network.makeFirstInputOfSecond(id_switch,id_ass,MPILib::DelayedConnection(1.0,1.0,0.0));
RootReportHandler handler("delayass.root", false, false);
MPILib::report::handler::RootReportHandler handler("delayass.root", false, false);
SimulationRunParameter par_run(handler,1000000,0.,1.,1e-2,1e-4,"delayass.log");
network.configureSimulation(par_run);
@@ -38,5 +38,7 @@ set ( LIBLIST
#############################################################################
# executables
#############################################################################
if (EANBLE_ROOT)
add_executable(largeNetwork LargeNetwork.cpp Hexagon.cpp GenerateHexagonalNetwork.cpp)
target_link_libraries(largeNetwork ${LIBLIST})
endif (ENABLE_ROOT)
@@ -86,7 +86,7 @@ if( ROOT_INCLUDE_DIRS AND ROOT_LIBRARY_DIRS )
endif( ROOT_INCLUDE_DIRS AND ROOT_LIBRARY_DIRS )
if( ROOT_FOUND )
add_definitions( -DHAVE_LIBCORE )
add_definitions( -DHAVEROOT )
if( NOT ROOT_FIND_QUIETLY )
message( STATUS "Found the ROOT library: ${ROOT_LIBRARY_DIRS}" )
endif( NOT ROOT_FIND_QUIETLY )
View
@@ -216,7 +216,7 @@ SEPARATE_MEMBER_PAGES = NO
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 2
TAB_SIZE = 4
# This tag can be used to specify a number of aliases that act as commands in
# the documentation. An alias has the form:
@@ -143,17 +143,6 @@ namespace GeomLib {
return _t_cur;
}
template <class WeightValue>
bool GeomAlgorithm<WeightValue>::IsReportDue() const
{
if (_n_report*_t_report < _t_cur){
++_n_report;
return true;
}
else
return false;
}
template <class WeightValue>
AlgorithmGrid GeomAlgorithm<WeightValue>::getGrid() const
@@ -86,6 +86,12 @@ class MuSigmaScalarProduct {
) const;
};
} /* namespace GeomLib */
View
@@ -57,6 +57,7 @@ set(MPI_SRCS
src/report/handler/CanvasParameter.cpp
src/report/handler/GraphKey.cpp
src/report/handler/InactiveReportHandler.cpp
src/report/handler/MinimalReportHandler.cpp
src/report/handler/RootHighThroughputHandler.cpp
src/report/handler/RootCanvasNoMPI.cpp
src/report/handler/RootReportHandler.cpp
@@ -88,19 +89,7 @@ set ( LIBLIST
${MPI_LIBRARIES}
${MIIND_LIBRARY_PREFIX}numtools
${gsl_LINK_FLAGS}
gsl
${LIB_PREFIX}Core
${LIB_PREFIX}RIO
${LIB_PREFIX}Hist
${LIB_PREFIX}Tree
${LIB_PREFIX}Table
${LIB_PREFIX}Matrix
${LIB_PREFIX}MathCore
${LIB_PREFIX}MathMore
${LIB_PREFIX}Gpad
${LIB_PREFIX}Graf
${LIB_PREFIX}Postscript
gsl
)
add_library( ${MIIND_LIBRARY_PREFIX}mpi ${LIB_TYPE} ${MPI_SRCS} ${MPI_HEADER})
@@ -128,6 +128,7 @@ void MPINetwork<WeightValue, NodeDistribution>::makeFirstInputOfSecond(
template<class WeightValue, class NodeDistribution>
void MPINetwork<WeightValue, NodeDistribution>::configureSimulation(
const SimulationRunParameter& simParam) {
_currentReportTime = simParam.getTReport();
_currentSimulationTime = simParam.getTBegin();
_parameterSimulationRun = simParam;
@@ -152,13 +153,14 @@ void MPINetwork<WeightValue, NodeDistribution>::evolve() {
if (_stateNetwork.isConfigured()) {
_stateNetwork.toggleConfigured();
LOG(utilities::logINFO) << "Starting simulation";
try {
utilities::ProgressBar pb(
getEndTime() / _parameterSimulationRun.getTReport()
+ getEndTime()
/ _parameterSimulationRun.getTState());
do {
do {
@@ -236,7 +238,6 @@ void MPINetwork<WeightValue, NodeDistribution>::collectReport(
for (auto& it : _localNodes) {
it.second.reportAll(type);
}
}
template<class WeightValue, class NodeDistribution>
@@ -59,11 +59,14 @@ class MPINode {
* @param nodeDistribution The Node Distribution.
* @param localNode The local nodes of this processor
*/
explicit MPINode(const algorithm::AlgorithmInterface<Weight>& algorithm,
NodeType nodeType, NodeId nodeId,
explicit MPINode(
const algorithm::AlgorithmInterface<Weight>& algorithm,
NodeType nodeType,
NodeId nodeId,
const NodeDistribution& nodeDistribution,
const std::map<NodeId, MPINode<Weight, NodeDistribution>>& localNode);
const std::map<NodeId, MPINode<Weight, NodeDistribution>>& localNode,
const std::string& name = ""
);
/**
* Destructor
@@ -194,6 +197,10 @@ class MPINode {
*/
const NodeDistribution& _rNodeDistribution;
/**
* A node can have a name
*/
const std::string _name;
/**
* Activity of this node
*/
@@ -30,14 +30,17 @@ namespace MPILib {
template<class Weight, class NodeDistribution>
MPINode<Weight, NodeDistribution>::MPINode(
const algorithm::AlgorithmInterface<Weight>& algorithm,
NodeType nodeType, NodeId nodeId,
NodeType nodeType,
NodeId nodeId,
const NodeDistribution& nodeDistribution,
const std::map<NodeId, MPINode<Weight, NodeDistribution>>& localNode) :
const std::map<NodeId, MPINode<Weight, NodeDistribution>>& localNode,
const std::string& name) :
_pAlgorithm(algorithm.clone()), //
_nodeType(nodeType), //
_nodeId(nodeId), //
_rLocalNodes(localNode), //
_rNodeDistribution(nodeDistribution) {
_rNodeDistribution(nodeDistribution),
_name(name){
}
template<class Weight, class NodeDistribution>
@@ -52,7 +55,6 @@ Time MPINode<Weight, NodeDistribution>::evolve(Time time) {
_pAlgorithm->evolveNodeState(_precursorActivity, _weights, time,
_precursorTypes);
}
// update state
@@ -74,6 +76,7 @@ void MPINode<Weight, NodeDistribution>::prepareEvolve() {
template<class Weight, class NodeDistribution>
void MPINode<Weight, NodeDistribution>::configureSimulationRun(
const SimulationRunParameter& simParam) {
_maximum_iterations = simParam.getMaximumNumberIterations();
_pAlgorithm->configure(simParam);
@@ -84,7 +87,6 @@ void MPINode<Weight, NodeDistribution>::configureSimulationRun(
simParam.getHandler().clone());
_pHandler->initializeHandler(_nodeId);
}
template<class Weight, class NodeDistribution>
@@ -150,10 +152,10 @@ void MPINode<Weight, NodeDistribution>::sendOwnActivity() {
template<class Weight, class NodeDistribution>
void MPINode<Weight, NodeDistribution>::reportAll(
report::ReportType type) const {
std::vector<report::ReportValue> vec_values;
if (type == report::RATE || type == report::STATE) {
report::Report report(_pAlgorithm->getCurrentTime(),
Rate(this->getActivity()), this->_nodeId,
_pAlgorithm->getGrid(), type, vec_values, _rLocalNodes.size());
@@ -164,8 +166,8 @@ void MPINode<Weight, NodeDistribution>::reportAll(
template<class Weight, class NodeDistribution>
void MPINode<Weight, NodeDistribution>::clearSimulation() {
_pHandler->detachHandler(_nodeId);
_pHandler->detachHandler(_nodeId);
}
template<class Weight, class NodeDistribution>
@@ -112,7 +112,7 @@ class AlgorithmInterface {
/**
* Stores the algorithm state in a Algorithm Grid
* @return The state of the algorithm
* @return The state of the algorithm. The Grid must at least contain one element; an empty grid will cause a crash.
*/
virtual AlgorithmGrid getGrid() const = 0;
@@ -51,7 +51,8 @@ struct StampedProbability {
* The time
*/
Time _time = 0.0;
};} /* namespace populist */
}
;} /* namespace populist */
} /* namespace MPILib */
#endif // include guard
@@ -64,7 +64,7 @@ class AbstractReportHandler {
virtual AbstractReportHandler* clone() const = 0;
/**
* During Configuration a MPINode will associate itself with the handler.
* During Configuration an MPINode will associate itself with the handler.
* @param nodeId The NodeId of the Node
*/
virtual void initializeHandler(const NodeId& nodeId) = 0;
@@ -16,7 +16,7 @@
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifdef WANTROOT
#ifndef ENABLE_MPI
#ifndef MPILIB_REPORT_HANDLER_ROOTCANVASNOMPI_HP
@@ -98,3 +98,4 @@ class RootCanvas {
#endif //ENABLE_MPI
#endif /* MPILIB_REPORT_HANDLER_INACTIVEREPORTHANDLER_HP */
#endif // don't bother if you don't want ROOT
@@ -16,6 +16,7 @@
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifdef WANTROOT
#ifndef MPILIB_REPORT_HANDLER_ROOTHIGHTHROUGHPUTHANDLER_HPP_
#define MPILIB_REPORT_HANDLER_ROOTHIGHTHROUGHPUTHANDLER_HPP_
@@ -137,3 +138,4 @@ class RootHighThroughputHandler: public AbstractReportHandler {
} // end namespace of report
} // end namespace of MPILib
#endif // include guard MPILIB_REPORT_HANDLER_ROOTHIGHTHROUGHPUTHANDLER_HPP_
#endif // don't bother if you don't want ROOT
@@ -16,7 +16,7 @@
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifdef WANTROOT
#ifndef MPILIB_REPORT_HANDLER_ROOTHANDLER_HPP_
#define MPILIB_REPORT_HANDLER_ROOTHANDLER_HPP_
@@ -187,3 +187,8 @@ class RootReportHandler: public AbstractReportHandler {
}// end namespace of MPILib
#endif // MPILIB_REPORT_HANDLER_ROOTHANDLER_HPP_ include guard
#else // ROOT has not been installed and by default a RootReportHandler reverts to a MininimalReportHandler
#define RootReportHandler MinimalReportHandler
#include "MinimalReportHandler.hpp"
#endif // ROOT has not been installed
@@ -16,6 +16,8 @@
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifdef WANTROOT
#ifndef MPILIB_REPORT_HANDLER_VALUEVALUEHANDLER_HPP_
#define MPILIB_REPORT_HANDLER_VALUEVALUEHANDLER_HPP_
@@ -49,7 +51,7 @@ class ValueHandlerHandler {
void write();
/**
* every thing is stored as an event
* everything is stored as an event
*/
struct Event {
std::string _str;
@@ -87,3 +89,4 @@ class ValueHandlerHandler {
} // end namespace of MPILib
#endif // include guard
#endif // don't bother if you don't want ROOT
Oops, something went wrong.

0 comments on commit 76900a8

Please sign in to comment.