Skip to content

Commit

Permalink
Merge branch 'release/17.09.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvierjahn committed Sep 5, 2017
2 parents ae8d65d + 3a97022 commit aecc590
Show file tree
Hide file tree
Showing 56 changed files with 2,407 additions and 112 deletions.
22 changes: 18 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
# nest python vis
# nest in situ vis
#
# Copyright (c) 2017 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualisation Group.
Expand All @@ -19,13 +19,18 @@
# limitations under the License.
#-------------------------------------------------------------------------------

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.8.2)

project(nest_python_vis)
project(nest_in_situ_vis)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_STANDARD 17)

find_package(Boost REQUIRED COMPONENTS python)

find_package(PythonInterp)
find_package(PythonLibs)

include(catch)

include(ConfigureFiles)
Expand All @@ -37,6 +42,15 @@ enable_testing()

include(GenerateExportHeader)

include(py.test)

include(WarningLevels)

add_subdirectory(nest_python_vis)
find_package(conduit)
set_target_properties(conduit
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CONDUIT_INCLUDE_DIRS}/..")

add_subdirectory(niv)
add_subdirectory(pyniv)
add_subdirectory(pytest_utilities)
add_subdirectory(demo)
2 changes: 1 addition & 1 deletion CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set noparent
filter=-readability/check
filter=-readability/check,-build/c++
linelength=80
extensions=c,cpp,h,hpp
headers=h,hpp
104 changes: 103 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,107 @@
# nest in situ vis


*nest in situ vis* is Copyright (c) 2017 RWTH Aachen University, Germany,
Virtual Reality & Immersive Visualization Group.


## Overview

*nest in situ vis* (`niv`) is (the yet prototypical implementation of) a library facilitating in situ visualization for the [nest simulator](http://www.nest-simulator.org).

With `niv` data can be collected in nest's recording backends and transported to a visualization process. Currently, only on-node transport to a separate visualization process is provided using shared memory.


## Building


### Requirements

* a customized nest simulator with nestio and a conduit recording backend
* [conduit 0.2.1](https://github.com/LLNL/conduit/tree/v0.2.1)
* Boost python and boost interprocess v1.64.0
* Python 2.7.13
* CMake 3.8.2 (or above)
* gcc 5.3 (or above)


### Compiling the Library

* In a teminal, `cd to `niv`'s root directory

```
mkdir build
cd build
cmake .. \
-DCONDUIT_DIR=<conduit install dir> \
-DBOOST_ROOT=<boost install dir> \
-DPYTHON_INCLUDE_DIR=<python include directory> \
-DPYTHON_LIBRARY=<absolute path to python library>
make
```

### Compiling the Custom Nest Simulator

These are hints for compiling nest (not included in this repository).

* In a terminal, `cd` to nest's root directory

```
mkdir build
cd build
cmake ../.. \
-Dwith-conduit=<conduit install dir> \
-Dniv_DIR=<niv's build directory> \
-DPYTHON_INCLUDE_DIR=<python include directory> \
-DPYTHON_LIBRARY=<absolute path to python library> \
-DCMAKE_INSTALL_PREFIX:PATH=<path to nest's install directory>
make
make install
```


### Generating the Demo Runners

* In a teminal, `cd to `niv`'s root directory

```
cd build
cmake . -DNEST_DIR=<path to nest's install directory>
chmod +x chmod +x demo/nest_python_vis/*.sh
```


## Running the Demo

You'll need two terminals.

* in both, `cd` to `<niv's build directory>/demo/nest_python_vis`

* in the first

```
./run_vis.sh
```

* in the second

```
./run_sim.sh
```

* in the visualization app press "Start"
* in the simulation app press "nest.Simulate(20)"


## Releasing Shared Memory if Something Breaks

If one of the two apps crashes, shared memory might still exist. Consequently, the visualization will throw an exception. In order to manually release the shared memory:

* in a terminal `cd` to `niv`s build directory

```
niv/helper_apps/niv-shared-memory destroy
```

## License

Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -18,3 +115,8 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


## Acknowledgements

`niv` is developed in the Human Brain Project. This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 720270 (HBP SGA1).
9 changes: 4 additions & 5 deletions cmake/ConfigureFiles.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#-------------------------------------------------------------------------------
# Project Phoenix
# nest in situ vis
#
# Copyright (c) 2017 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualisation Group.
#-------------------------------------------------------------------------------
# License
# only for this file
# License
#
# Licensed under the 3-Clause BSD License (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
90 changes: 90 additions & 0 deletions cmake/FindConduit.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
###############################################################################
# Copyright (c) 2014-2017, Lawrence Livermore National Security, LLC.
#
# Produced at the Lawrence Livermore National Laboratory
#
# LLNL-CODE-666778
#
# All rights reserved.
#
# This file is part of Conduit.
#
# For details, see https://lc.llnl.gov/conduit/.
#
# Please also read conduit/LICENSE
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the disclaimer below.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the disclaimer (as noted below) in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the LLNS/LLNL nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
# LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF 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.
#
###############################################################################
#
# Setup Conduit
#
###############################################################################
#
# Expects CONDUIT_DIR to point to a Conduit installations.
#
# This file defines the following CMake variables:
# CONDUIT_FOUND - If Conduit was found
# CONDUIT_INCLUDE_DIRS - The Conduit include directories
#
# If found, the conduit CMake targets will also be imported.
# The main conduit library targets are:
# conduit
# conduit_relay
# conduit_relay_mpi (if conduit was built with mpi support)
# conduit_blueprint
#
###############################################################################

###############################################################################
# Check for CONDUIT_DIR
###############################################################################
if(NOT CONDUIT_DIR)
MESSAGE(FATAL_ERROR "Could not find Conduit. Conduit requires explicit CONDUIT_DIR.")
endif()

if(NOT EXISTS ${CONDUIT_DIR}/lib/cmake/conduit.cmake)
MESSAGE(FATAL_ERROR "Could not find Conduit CMake include file (${CONDUIT_DIR}/lib/cmake/conduit.cmake)")
endif()

###############################################################################
# Import Conduit's CMake targets
###############################################################################
include(${CONDUIT_DIR}/lib/cmake/conduit.cmake)

###############################################################################
# Set remaning CMake variables
###############################################################################
# we found Conduit
set(CONDUIT_FOUND TRUE)
# provide location of the headers in CONDUIT_INCLUDE_DIRS
set(CONDUIT_INCLUDE_DIRS ${CONDUIT_DIR}/include/conduit)




16 changes: 10 additions & 6 deletions cmake/WarningLevels.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#-------------------------------------------------------------------------------
# Project Phoenix
# nest in situ vis
#
# Copyright (c) 2017 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualisation Group.
#-------------------------------------------------------------------------------
# License
# only for this file
# License
#
# Licensed under the 3-Clause BSD License (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -40,7 +39,6 @@ set(WARNING_LEVELS_RWTH_GCC
-Wmissing-braces
-pedantic
-pedantic-errors
-Wno-c++98-compat
)

set(WARNING_LEVELS_RWTH_MSVC
Expand Down Expand Up @@ -104,26 +102,32 @@ macro(SET_WARNING_LEVELS_RWTH TARGET)
if(IS_CLANG)
target_compile_options(${TARGET} PRIVATE ${WARNING_LEVELS_RWTH_CLANG})
if (CMAKE_AUTOMOC)
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/moc_compilation.cpp)
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/moc_compilation.cpp
PROPERTIES COMPILE_FLAGS ${WARNING_LEVELS_RWTH_CLANG_QT_MOC_OVERRIDE})
endif ()
endif()
target_compile_options(${TARGET} PRIVATE "-include${SUPPRESS_WARNING_HEADER_FILE}")
elseif(IS_GCC)
target_compile_options(${TARGET} PRIVATE ${WARNING_LEVELS_RWTH_GCC})
if (CMAKE_AUTOMOC)
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/moc_compilation.cpp)
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/moc_compilation.cpp
PROPERTIES COMPILE_FLAGS ${WARNING_LEVELS_RWTH_GCC_QT_MOC_OVERRIDE})
endif ()
endif()
target_compile_options(${TARGET} PRIVATE "-include${SUPPRESS_WARNING_HEADER_FILE}")
elseif(IS_MSVC)
target_compile_options(${TARGET} PRIVATE ${WARNING_LEVELS_RWTH_MSVC})
if (CMAKE_AUTOMOC)
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/moc_compilation.cpp)
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/${target}_autogen/moc_compilation.cpp
PROPERTIES COMPILE_FLAGS ${WARNING_LEVELS_RWTH_MSVC_QT_MOC_OVERRIDE})
endif ()
endif()
target_compile_options(${TARGET} PRIVATE "/FI ${SUPPRESS_WARNING_HEADER_FILE}")
else()
message(WARNING "SET_WARNING_LEVELS_RWTH not implemented for your compiler. "
Expand Down
19 changes: 5 additions & 14 deletions cmake/catch.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#-------------------------------------------------------------------------------
# Project Phoenix
# nest in situ vis
#
# Copyright (c) 2017 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualisation Group.
#-------------------------------------------------------------------------------
# License
# only for this file
# License
#
# Licensed under the 3-Clause BSD License (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -22,6 +21,7 @@

include(WarningLevels)


set_property(GLOBAL PROPERTY USE_FOLDERS ON)


Expand Down Expand Up @@ -81,15 +81,6 @@ function(ADD_TEST_CATCH)
file(GLOB ADD_TEST_CATCH_CATCH_MAIN_ABSOLUTE ${ADD_TEST_CATCH_CATCH_MAIN})
list(REMOVE_ITEM ADD_TEST_CATCH_SOURCES ${ADD_TEST_CATCH_CATCH_MAIN_ABSOLUTE})

# add aggregate test target
ADD_TEST_CATCH_INTERNAL_("${ADD_TEST_CATCH_NAME}"
"${ADD_TEST_CATCH_SOURCES}"
"${ADD_TEST_CATCH_HEADERS}"
"${ADD_TEST_CATCH_INCLUDE_DIRECTORIES}"
"${ADD_TEST_CATCH_LINK_LIBRARIES};${ADD_TEST_CATCH_NAME}_catch_main"
"${ADD_TEST_CATCH_PATH_TO_ADD}"
)

# add test for each test source file
foreach(TEST_SOURCE_FILE ${ADD_TEST_CATCH_SOURCES})
get_filename_component(TEST_NAME ${TEST_SOURCE_FILE} NAME_WE)
Expand Down
Loading

0 comments on commit aecc590

Please sign in to comment.