Browse Source
Merge remote-tracking branch 'origin/jani_support' into jani_explicit_jit
Merge remote-tracking branch 'origin/jani_support' into jani_explicit_jit
Former-commit-id:mainc1326199f8
[formerly5037cdd8b7
] Former-commit-id:c52ecdd86c
32 changed files with 940 additions and 356 deletions
-
6resources/3rdparty/CMakeLists.txt
-
206resources/cmake/find_modules/FindHwloc.cmake
-
81src/builder/DdJaniModelBuilder.cpp
-
20src/builder/DdJaniModelBuilder.h
-
48src/builder/JaniProgramGraphBuilder.cpp
-
59src/builder/JaniProgramGraphBuilder.h
-
24src/cli/cli.cpp
-
14src/generator/CompressedState.cpp
-
89src/generator/JaniNextStateGenerator.cpp
-
2src/generator/JaniNextStateGenerator.h
-
12src/generator/NextStateGenerator.cpp
-
2src/generator/NextStateGenerator.h
-
35src/generator/PrismNextStateGenerator.cpp
-
41src/generator/VariableInformation.cpp
-
7src/generator/VariableInformation.h
-
84src/parser/JaniParser.cpp
-
2src/settings/modules/PGCLSettings.cpp
-
2src/storage/BitVector.h
-
28src/storage/IntegerInterval.cpp
-
1src/storage/IntegerInterval.h
-
343src/storage/jani/JSONExporter.cpp
-
34src/storage/jani/JSONExporter.h
-
33src/storage/jani/Model.cpp
-
6src/storage/jani/Model.h
-
9src/storage/jani/Property.cpp
-
39src/storage/jani/Property.h
-
20src/storage/jani/VariableSet.cpp
-
10src/storage/jani/VariableSet.h
-
28src/storage/ppg/ProgramGraph.h
-
2src/storage/ppg/defines.h
-
4src/storage/prism/Module.cpp
-
5src/storm-pgcl.cpp
@ -1,179 +1,55 @@ |
|||
# FindHwloc |
|||
# ---------- |
|||
# Try to find hwloc libraries and headers. |
|||
# |
|||
# Try to find Portable Hardware Locality (hwloc) libraries. |
|||
# http://www.open-mpi.org/software/hwloc |
|||
# Usage of this module: |
|||
# |
|||
# You may declare HWLOC_ROOT environment variable to tell where |
|||
# your hwloc library is installed. |
|||
# find_package(hwloc) |
|||
# |
|||
# Once done this will define:: |
|||
# Variables defined by this module: |
|||
# |
|||
# Hwloc_FOUND - True if hwloc was found |
|||
# Hwloc_INCLUDE_DIRS - include directories for hwloc |
|||
# Hwloc_LIBRARIES - link against these libraries to use hwloc |
|||
# Hwloc_VERSION - version |
|||
# Hwloc_CFLAGS - include directories as compiler flags |
|||
# Hwloc_LDLFAGS - link paths and libs as compiler flags |
|||
# |
|||
|
|||
#============================================================================= |
|||
# Copyright 2014 Mikael Lepistö |
|||
# |
|||
# Distributed under the OSI-approved BSD License (the "License"); |
|||
# |
|||
# This software is distributed WITHOUT ANY WARRANTY; without even the |
|||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|||
# See the License for more information. |
|||
#============================================================================= |
|||
|
|||
if(WIN32) |
|||
find_path(Hwloc_INCLUDE_DIR |
|||
NAMES |
|||
hwloc.h |
|||
PATHS |
|||
ENV "PROGRAMFILES(X86)" |
|||
ENV HWLOC_ROOT |
|||
PATH_SUFFIXES |
|||
include |
|||
) |
|||
|
|||
find_library(Hwloc_LIBRARY |
|||
NAMES |
|||
libhwloc.lib |
|||
PATHS |
|||
ENV "PROGRAMFILES(X86)" |
|||
ENV HWLOC_ROOT |
|||
PATH_SUFFIXES |
|||
lib |
|||
) |
|||
|
|||
# |
|||
# Check if the found library can be used to linking |
|||
# |
|||
SET (_TEST_SOURCE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/linktest.c") |
|||
FILE (WRITE "${_TEST_SOURCE}" |
|||
" |
|||
#include <hwloc.h> |
|||
int main() |
|||
{ |
|||
hwloc_topology_t topology; |
|||
int nbcores; |
|||
hwloc_topology_init(&topology); |
|||
hwloc_topology_load(topology); |
|||
nbcores = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_CORE); |
|||
hwloc_topology_destroy(topology); |
|||
return 0; |
|||
} |
|||
" |
|||
) |
|||
|
|||
TRY_COMPILE(_LINK_SUCCESS ${CMAKE_BINARY_DIR} "${_TEST_SOURCE}" |
|||
CMAKE_FLAGS |
|||
"-DINCLUDE_DIRECTORIES:STRING=${Hwloc_INCLUDE_DIR}" |
|||
CMAKE_FLAGS |
|||
"-DLINK_LIBRARIES:STRING=${Hwloc_LIBRARY}" |
|||
) |
|||
|
|||
IF(NOT _LINK_SUCCESS) |
|||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) |
|||
message(STATUS "You are building 64bit target.") |
|||
ELSE() |
|||
message(STATUS "You are building 32bit code. If you like to build x64 use e.g. -G 'Visual Studio 12 Win64' generator." ) |
|||
ENDIF() |
|||
message(FATAL_ERROR "Library found, but linking test program failed.") |
|||
ENDIF() |
|||
|
|||
# |
|||
# Resolve version if some compiled binary found... |
|||
# |
|||
find_program(HWLOC_INFO_EXECUTABLE |
|||
NAMES |
|||
hwloc-info |
|||
PATHS |
|||
ENV HWLOC_ROOT |
|||
PATH_SUFFIXES |
|||
bin |
|||
) |
|||
|
|||
if(HWLOC_INFO_EXECUTABLE) |
|||
execute_process( |
|||
COMMAND ${HWLOC_INFO_EXECUTABLE} "--version" |
|||
OUTPUT_VARIABLE HWLOC_VERSION_LINE |
|||
OUTPUT_STRIP_TRAILING_WHITESPACE |
|||
) |
|||
string(REGEX MATCH "([0-9]+.[0-9]+)$" |
|||
Hwloc_VERSION "${HWLOC_VERSION_LINE}") |
|||
unset(HWLOC_VERSION_LINE) |
|||
endif() |
|||
|
|||
# |
|||
# All good |
|||
# |
|||
|
|||
set(Hwloc_LIBRARIES ${Hwloc_LIBRARY}) |
|||
set(Hwloc_INCLUDE_DIRS ${Hwloc_INCLUDE_DIR}) |
|||
|
|||
include(FindPackageHandleStandardArgs) |
|||
find_package_handle_standard_args( |
|||
Hwloc |
|||
FOUND_VAR Hwloc_FOUND |
|||
REQUIRED_VARS Hwloc_LIBRARY Hwloc_INCLUDE_DIR |
|||
VERSION_VAR Hwloc_VERSION) |
|||
|
|||
mark_as_advanced( |
|||
Hwloc_INCLUDE_DIR |
|||
Hwloc_LIBRARY) |
|||
|
|||
foreach(arg ${Hwloc_INCLUDE_DIRS}) |
|||
set(Hwloc_CFLAGS "${Hwloc_CFLAGS} /I${arg}") |
|||
endforeach() |
|||
# HWLOC_FOUND System has hwloc libraries and headers |
|||
# HWLOC_LIBRARIES The hwloc library |
|||
# HWLOC_INCLUDE_DIRS The location of HWLOC headers |
|||
|
|||
set(Hwloc_LDFLAGS "${Hwloc_LIBRARY}") |
|||
find_path( |
|||
HWLOC_PREFIX |
|||
NAMES include/hwloc.h |
|||
) |
|||
|
|||
else() |
|||
if (NOT HWLOC_PREFIX AND NOT $ENV{HWLOC_BASE} STREQUAL "") |
|||
set(HWLOC_PREFIX $ENV{HWLOC_BASE}) |
|||
endif() |
|||
|
|||
# Find with pkgconfig |
|||
find_package(PkgConfig) |
|||
message(STATUS "Searching for hwloc library in path " ${HWLOC_PREFIX}) |
|||
|
|||
if(HWLOC_ROOT) |
|||
set(ENV{PKG_CONFIG_PATH} "${HWLOC_ROOT}/lib/pkgconfig") |
|||
else() |
|||
foreach(PREFIX ${CMAKE_PREFIX_PATH}) |
|||
set(PKG_CONFIG_PATH "${PKG_CONFIG_PATH}:${PREFIX}/lib/pkgconfig") |
|||
endforeach() |
|||
set(ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") |
|||
endif() |
|||
find_library( |
|||
HWLOC_LIBRARIES |
|||
NAMES hwloc |
|||
HINTS ${HWLOC_PREFIX}/lib |
|||
) |
|||
|
|||
if(hwloc_FIND_REQUIRED) |
|||
set(_hwloc_OPTS "REQUIRED") |
|||
elseif(hwloc_FIND_QUIETLY) |
|||
set(_hwloc_OPTS "QUIET") |
|||
else() |
|||
set(_hwloc_output 1) |
|||
endif() |
|||
find_path( |
|||
HWLOC_INCLUDE_DIRS |
|||
NAMES hwloc.h |
|||
HINTS ${HWLOC_PREFIX}/include |
|||
) |
|||
|
|||
if(hwloc_FIND_VERSION) |
|||
if(hwloc_FIND_VERSION_EXACT) |
|||
pkg_check_modules(Hwloc ${_hwloc_OPTS} hwloc=${hwloc_FIND_VERSION}) |
|||
else() |
|||
pkg_check_modules(Hwloc ${_hwloc_OPTS} hwloc>=${hwloc_FIND_VERSION}) |
|||
endif() |
|||
else() |
|||
pkg_check_modules(Hwloc ${_hwloc_OPTS} hwloc) |
|||
endif() |
|||
include(FindPackageHandleStandardArgs) |
|||
|
|||
if(Hwloc_FOUND) |
|||
include(FindPackageHandleStandardArgs) |
|||
find_package_handle_standard_args(Hwloc DEFAULT_MSG Hwloc_LIBRARIES) |
|||
find_package_handle_standard_args( |
|||
HWLOC DEFAULT_MSG |
|||
HWLOC_LIBRARIES |
|||
HWLOC_INCLUDE_DIRS |
|||
) |
|||
|
|||
if(NOT ${Hwloc_VERSION} VERSION_LESS 1.7.0) |
|||
set(Hwloc_GL_FOUND 1) |
|||
endif() |
|||
mark_as_advanced( |
|||
HWLOC_LIBRARIES |
|||
HWLOC_INCLUDE_DIRS |
|||
) |
|||
|
|||
if(_hwloc_output) |
|||
message(STATUS |
|||
"Found hwloc ${Hwloc_VERSION} in ${Hwloc_INCLUDE_DIRS}:${Hwloc_LIBRARIES}") |
|||
endif() |
|||
if (HWLOC_FOUND) |
|||
if (NOT $ENV{HWLOC_LIB} STREQUAL "") |
|||
# set(HWLOC_LIBRARIES "$ENV{HWLOC_LIB}") |
|||
endif() |
|||
endif() |
|||
message(STATUS "hwloc includes: " ${HWLOC_INCLUDE_DIRS}) |
|||
message(STATUS "hwloc libraries: " ${HWLOC_LIBRARIES}) |
|||
endif() |
@ -1,2 +1,30 @@ |
|||
#include "IntegerInterval.h"
|
|||
|
|||
#include <iostream>
|
|||
#include <string>
|
|||
|
|||
#include "src/utility/macros.h"
|
|||
#include "src/exceptions/InvalidArgumentException.h"
|
|||
|
|||
bool starts_with(const std::string& s1, const std::string& s2) { |
|||
return s2.size() <= s1.size() && s1.compare(0, s2.size(), s2) == 0; |
|||
} |
|||
|
|||
namespace storm { |
|||
namespace storage { |
|||
IntegerInterval parseIntegerInterval(std::string const& stringRepr) { |
|||
|
|||
|
|||
if(starts_with(stringRepr, "[") && stringRepr.at(stringRepr.size()-1) == ']') { |
|||
auto split = stringRepr.find(","); |
|||
std::string first = stringRepr.substr(1,split-1); |
|||
|
|||
std::string second = stringRepr.substr(split+1, stringRepr.size() - split - 2); |
|||
return IntegerInterval(stoi(first), stoi(second)); |
|||
|
|||
} else { |
|||
STORM_LOG_THROW(false, storm::exceptions::InvalidArgumentException, "Cannot parse " << stringRepr << " as integer interval"); |
|||
} |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue