Skip to content

Commit

Permalink
Merge branch 'master' into add-hpc-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jessica-mitchell committed Jan 31, 2023
2 parents 5d511ad + 4872b8c commit 94083b2
Show file tree
Hide file tree
Showing 681 changed files with 36,072 additions and 96,882 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Checks: '-*,modernize-use-nullptr,modernize-use-override,bugprone,modernize-redundant-void-arg'
25 changes: 25 additions & 0 deletions .github/workflows/jsc-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Mirror to JSC

on:
push:
branches: [ master ]

jobs:
sync_to_jsc:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'nest' }}
steps:
- name: sycnmaster
uses: wei/git-sync@v3
with:
source_repo: "nest/nest-simulator"
source_branch: "master"
destination_repo: "https://ghpusher:${{ secrets.JSC_GITLAB_TOKEN }}@gitlab.jsc.fz-juelich.de/nest/nest-simulator.git"
destination_branch: "master"
- name: synctags
uses: wei/git-sync@v3
with:
source_repo: "nest/nest-simulator"
source_branch: "refs/tags/v*"
destination_repo: "https://ghpusher:${{ secrets.JSC_GITLAB_TOKEN }}@gitlab.jsc.fz-juelich.de/nest/nest-simulator.git"
destination_branch: "refs/tags/v*"
8 changes: 4 additions & 4 deletions .github/workflows/nestbuildmatrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ jobs:
# --force-reinstall required to ensure executable is linked from bin dir in PATH
python -m pip install --force-reinstall clang-format==13.0
python -c "import setuptools; print('package location:', setuptools.__file__)"
python -m pip install --force-reinstall --upgrade scipy 'junitparser>=2' numpy pytest pytest-timeout pytest-xdist mpi4py cython matplotlib terminaltables pandoc
python -m pip install --force-reinstall --upgrade scipy 'junitparser>=2' numpy pytest pytest-timeout pytest-xdist mpi4py cython matplotlib terminaltables pandoc pandas
python -c "import pytest; print('package location:', pytest.__file__)"
pip list
- name: "Find changed files"
run: |
echo "CHANGED_FILES<<EOF" >> $GITHUB_ENV
echo "$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }})" >> $GITHUB_ENV
echo "$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.after }})" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
echo "GITHUB_ENV = $GITHUB_ENV"
cat $GITHUB_ENV
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
python -c "import setuptools; print('package location:', setuptools.__file__)"
python -m pip install --force-reinstall --upgrade scipy 'junitparser>=2' numpy pytest pytest-timeout pytest-xdist mpi4py cython matplotlib terminaltables pandoc
python -m pip install --force-reinstall --upgrade scipy 'junitparser>=2' numpy pytest pytest-timeout pytest-xdist mpi4py cython matplotlib terminaltables pandoc pandas
python -c "import pytest; print('package location:', pytest.__file__)"
pip list
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
python -c "import setuptools; print('package location:', setuptools.__file__)"
python -m pip install --force-reinstall --upgrade scipy "junitparser>=2" numpy pytest pytest-timeout pytest-xdist mpi4py cython matplotlib terminaltables pandoc
python -m pip install --force-reinstall --upgrade scipy "junitparser>=2" numpy pytest pytest-timeout pytest-xdist mpi4py cython matplotlib terminaltables pandoc pandas
python -c "import pytest; print('package location:', pytest.__file__)"
pip list
Expand Down
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ pynest/pynestkernel.cxx
*.o
*.pyc

Makefile

build/
install/
examples/example_logs/

/libnestutil/config.h
Expand All @@ -35,8 +31,6 @@ cmake_install.cmake
CMakeDoxygenDefaults.cmake

# generated files
doc/fulldoc.conf
doc/normaldoc.conf
bin/nest-config
bin/nest_vars.sh
libnestutil/config.h
Expand Down
45 changes: 22 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ set( with-includes OFF CACHE STRING "Add additional include paths [default=OFF].
set( with-defines OFF CACHE STRING "Additional defines, e.g. '-DXYZ=1' [default=OFF]. Separate multiple defines by ';'." )
set( with-version-suffix "" CACHE STRING "Set a user defined version suffix [default='']." )

# documentation build configuration
set( with-userdoc OFF CACHE STRING "Build user documentation [default=OFF]")
set( with-devdoc OFF CACHE STRING "Build developer documentation [default=OFF]")

################################################################################
################## Project Directory variables ##################
################################################################################
Expand All @@ -96,13 +100,6 @@ set( CMAKE_INSTALL_DATADIR "share/${PROJECT_NAME}" CACHE STRING "Relative direct
################## Find utility programs ##################
################################################################################

# needed for pynest test suite
if ( ${with-python} STREQUAL "ON" )
find_program( NOSETESTS NAMES nosetests )
endif ()

# needed for target doc and fulldoc
find_package( Doxygen )
find_program( SED NAMES sed gsed )

################################################################################
Expand Down Expand Up @@ -131,8 +128,6 @@ get_target_triple( NEST_TARGET_TRIPLE NEST_TARGET_ARCH NEST_TARGET_VENDOR NEST_T
nest_process_with_python()
include( GNUInstallDirs )
nest_post_process_with_python()
nest_process_with_optimize()
nest_process_with_debug()
nest_process_with_std()
nest_process_with_intel_compiler_flags()
nest_process_with_warning()
Expand All @@ -156,6 +151,14 @@ nest_process_with_mpi4py()
nest_process_with_boost()
nest_process_target_bits_split()
nest_process_version_suffix()
nest_process_userdoc()
nest_process_devdoc()

# These two function calls must come last, as to prevent unwanted interactions of the newly set flags
# with detection/compilation operations carried out in earlier functions. The optimize/debug flags set
# using these functions should only apply to the compilation of NEST.
nest_process_with_optimize()
nest_process_with_debug()

nest_get_color_flags()
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NEST_C_COLOR_FLAGS}" )
Expand Down Expand Up @@ -276,10 +279,9 @@ foreach ( def ${SIONLIB_DEFINES} )
set( ALL_CXXFLAGS "${ALL_CXXFLAGS} ${def}" )
endforeach ()

# all libraries
set( ALL_LIBS
# libraries required to link extension modules
set( MODULE_LINK_LIBS
"-lnestutil"
"-lnest"
"-lsli"
"-lnestkernel"
"${OpenMP_CXX_FLAGS}"
Expand All @@ -293,9 +295,15 @@ set( ALL_LIBS
"${BOOST_LIBRARIES}" )

if ( with-libraries )
set( ALL_LIBS "${ALL_LIBS};${with-libraries}" )
set( MODULE_LINK_LIBS "${MODULE_LINK_LIBS};${with-libraries}" )
endif ()
string( REPLACE ";" " " ALL_LIBS "${ALL_LIBS}" )
string( REPLACE ";" " " MODULE_LINK_LIBS "${MODULE_LINK_LIBS}" )

# libraries requied to link NEST
set( ALL_LIBS
"-lnest"
${MODULE_LINK_LIBS} )


# all includes
set( ALL_INCLUDES_tmp
Expand Down Expand Up @@ -339,11 +347,6 @@ configure_file(
"${PROJECT_BINARY_DIR}/bin/nest_vars.sh" @ONLY
)

configure_file(
"${PROJECT_SOURCE_DIR}/doc/normaldoc.conf.in"
"${PROJECT_BINARY_DIR}/doc/normaldoc.conf" @ONLY
)

configure_file(
"${PROJECT_SOURCE_DIR}/doc/fulldoc.conf.in"
"${PROJECT_BINARY_DIR}/doc/fulldoc.conf" @ONLY
Expand All @@ -363,8 +366,4 @@ install( FILES LICENSE README.md
DESTINATION ${CMAKE_INSTALL_DOCDIR}
)

add_custom_target( install-nodoc
COMMAND $(MAKE) NEST_INSTALL_NODOC=true install
)

nest_print_config_summary()
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contribute to NEST

The NEST simulator is a scientific tool and as such it is never finished and constantly changing to meet the needs of novel neuroscientific endeavors. Here you find the most important information on how you can contribute to NEST. This document is an excerpt from our [Contributing to NEST documentation](https://nest-simulator.readthedocs.io/en/latest/contribute/index.html), which provides more detailed information.
The NEST Simulator is a scientific tool and as such it is never finished and constantly changing to meet the needs of novel neuroscientific endeavors. Here you find the most important information on how you can contribute to NEST. This document is an excerpt from our [Contributing to NEST documentation](https://nest-simulator.readthedocs.io/en/latest/contribute/index.html), which provides more detailed information.


* Make sure you have a [GitHub account](https://github.com/signup/free)
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Security Policy

The NEST simulator is research oriented software and as such is expected to
The NEST Simulator is research oriented software and as such is expected to
run mainly in well protected environments. In case it is found that this
software can be used to violate security mechanisms, developers will try to
provide patches that mitigate the risk of this misuse.
Expand Down
12 changes: 10 additions & 2 deletions bin/nest-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ Known values for OPTION are:
--prefix NEST install prefix for architecture-independent files
--exec-prefix NEST install prefix for architecture-dependent files
--libs print library linking information
--libs print library linking information for extension modules
--cflags print pre-processor and compiler flags
--includes print includes
--compiler print the compiler used to compile NEST
--compiler-name Print the compiler name used to compile NEST
--compiler-version Print the compiler version used to compile NEST
--python-executable print full path to Python interpreter used
--python-version print Python version string for interpreter
--static-libraries print "ON" if configured for static libraries, "OFF" otherwise
Expand Down Expand Up @@ -66,11 +68,17 @@ while test $# -gt 0; do
echo "@ALL_CXXFLAGS@"
;;
--libs)
echo "-L$prefix/@CMAKE_INSTALL_LIBDIR@/nest @ALL_LIBS@"
echo "-L$prefix/@CMAKE_INSTALL_LIBDIR@/nest @MODULE_LINK_LIBS@"
;;
--compiler)
echo "@CMAKE_CXX_COMPILER@"
;;
--compiler-name)
echo "@CMAKE_CXX_COMPILER_ID@"
;;
--compiler-version)
echo "@CMAKE_CXX_COMPILER_VERSION@"
;;
--python-executable)
echo "@Python_EXECUTABLE@"
;;
Expand Down
4 changes: 2 additions & 2 deletions bin/nest-server
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
DAEMON="${NEST_SERVER_DAEMON:-0}"
HOST="${NEST_SERVER_HOST:-127.0.0.1}"
LOGFILE="${NEST_SERVER_LOGFILE:-/tmp/nest-server.log}"
PORT="${NEST_SERVER_PORT:-5000}"
PORT="${NEST_SERVER_PORT:-52425}"
STDOUT="${NEST_SERVER_STDOUT:-0}"

usage() {
Expand All @@ -22,7 +22,7 @@ usage() {
echo " -d daemonize the server process"
echo " -h <HOST> use hostname/IP address <HOST> for the server [default: 127.0.0.1]"
echo " -o print NEST outputs to the console"
echo " -p <PORT> use port <PORT> for opening the socket [default: 5000]"
echo " -p <PORT> use port <PORT> for opening the socket [default: 52425]"
}

log() {
Expand Down
8 changes: 6 additions & 2 deletions bin/nest-server-mpi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Usage:
Options:
-h --help display usage information and exit
--host HOST use hostname/IP address HOST for server [default: 127.0.0.1]
--port PORT use port PORT for opening the socket [default: 5000]
--port PORT use port PORT for opening the socket [default: 52425]
"""

Expand All @@ -25,6 +25,10 @@ import sys
import nest
import nest.server

import os

HOST = os.getenv("NEST_SERVER_HOST", "127.0.0.1")
PORT = os.getenv("NEST_SERVER_PORT", "52425")

comm = MPI.COMM_WORLD.Clone()
rank = comm.Get_rank()
Expand All @@ -38,7 +42,7 @@ def log(call_name, msg):
if rank == 0:
print("==> Starting NEST Server Master on rank 0", flush=True)
nest.server.set_mpi_comm(comm)
nest.server.run_mpi_app(host=opt['--host'], port=opt['--port'])
nest.server.run_mpi_app(host=opt.get('--host', HOST), port=opt.get('--port', PORT))

else:
print(f"==> Starting NEST Server Worker on rank {rank}", flush=True)
Expand Down
41 changes: 4 additions & 37 deletions build_support/check_code_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ unset FILE_TO_BE_CHECKED
GIT_START_SHA=master # If 'file=' is not specified all changed files in the commit range
GIT_END_SHA=HEAD # '<master>..<HEAD>' are processed.

VERA=vera++ # The names of the static code analysis tools executables.
CPPCHECK=cppcheck # CPPCHECK version 1.69 or later is required!
CLANG_FORMAT=clang-format # CLANG-FORMAT version 13 is required!
PEP8=pycodestyle
PYCODESTYLE_IGNORES="E121,E123,E126,E226,E24,E704,W503,W504"

PERFORM_VERA=true # Perform VERA++ analysis.
PERFORM_CPPCHECK=false # Skip CPPCHECK analysis.
PERFORM_CLANG_FORMAT=true # Perform CLANG-FORMAT analysis.
PERFORM_PEP8=true # Perform PEP8 analysis.
Expand Down Expand Up @@ -103,9 +101,6 @@ Options:
--git-end=Git_SHA_value Hash value (Git SHA) at which Git ends the diff.
Default: --git-start=HEAD
--vera++=exe The name of the VERA++ executable.
Default: --vera++=vera++
--cppcheck=exe The name of the CPPCHECK executable.
Default: --cppcheck=cppcheck
Note: CPPCHECK version 1.69 or later is required.
Expand All @@ -119,9 +114,6 @@ Options:
--pep8=exe The name of the PEP8 executable.
Default: --pep8=pycodestyle
--perform-vera=on/off Turn on/off VERA++ analysis.
Default: --perform-vera=on
--perform-cppcheck=on/off Turn on/off CPPCHECK analysis.
Default: --perform-cppcheck=off
Expand Down Expand Up @@ -164,9 +156,6 @@ while test $# -gt 0 ; do
--git-end=*)
GIT_END_SHA="$( echo "$1" | sed 's/^--git-end=//' )"
;;
--vera++=*)
VERA="$( echo "$1" | sed 's/^--vera++=//' )"
;;
--cppcheck=*)
CPPCHECK="$( echo "$1" | sed 's/^--cppcheck=//' )"
;;
Expand All @@ -176,20 +165,6 @@ while test $# -gt 0 ; do
--pep8=*)
PEP8="$( echo "$1" | sed 's/^--pep8=//' )"
;;
--perform-vera=*)
value="$( echo "$1" | sed 's/^--perform-vera=//' )"
case "$value" in
on)
PERFORM_VERA=true
;;
off)
PERFORM_VERA=false
;;
*)
error_unknown_option "$1"
;;
esac
;;
--perform-cppcheck=*)
value="$( echo "$1" | sed 's/^--perform-cppcheck=//' )"
case "$value" in
Expand Down Expand Up @@ -239,7 +214,7 @@ while test $# -gt 0 ; do
shift
done

if ! $PERFORM_VERA && ! $PERFORM_CPPCHECK && ! $PERFORM_CLANG_FORMAT && ! $PERFORM_PEP8; then
if ! $PERFORM_CPPCHECK && ! $PERFORM_CLANG_FORMAT && ! $PERFORM_PEP8; then
error_no_analysis
fi

Expand All @@ -248,13 +223,6 @@ fi
EXTENDED_REGEX_PARAM=r
/bin/sh -c "echo 'hello' | sed -${EXTENDED_REGEX_PARAM} 's/[aeou]/_/g' " >/dev/null 2>&1 || EXTENDED_REGEX_PARAM=E

# Verify the VERA++ installation.
if $PERFORM_VERA; then
$VERA ./nest/main.cpp >/dev/null 2>&1 || error_exit "Failed to verify the VERA++ installation. Executable: $VERA"
$VERA --profile nest ./nest/main.cpp >/dev/null 2>&1 || error_exit \
"Failed to verify the VERA++ installation. The profile 'nest' could not be found. See https://nest-simulator.readthedocs.io/en/latest/contribute/coding_guidelines_cpp.html#vera-profile-nest"
fi

# Verify the CPPCHECK installation. CPPCHECK version 1.69 or later is required.
# Previous versions of CPPCHECK halted on sli/tokenutils.cc (see https://github.com/nest/nest-simulator/pull/79)
if $PERFORM_CPPCHECK; then
Expand Down Expand Up @@ -303,15 +271,14 @@ fi
RUNS_ON_CI=false

unset NEST_VPATH # These command line arguments are placeholders and not required here.
IGNORE_MSG_VERA=false # They are needed when running the static code analysis script within
IGNORE_MSG_CPPCHECK=false # the CI build environment.
IGNORE_MSG_CLANG_FORMAT=false
IGNORE_MSG_PYCODESTYLE=false

./build_support/static_code_analysis.sh "$RUNS_ON_CI" "$INCREMENTAL" "$file_names" "$NEST_VPATH" \
"$VERA" "$CPPCHECK" "$CLANG_FORMAT" "$PEP8" \
"$PERFORM_VERA" "$PERFORM_CPPCHECK" "$PERFORM_CLANG_FORMAT" "$PERFORM_PEP8" \
"$IGNORE_MSG_VERA" "$IGNORE_MSG_CPPCHECK" "$IGNORE_MSG_CLANG_FORMAT" "$IGNORE_MSG_PYCODESTYLE" \
"$CPPCHECK" "$CLANG_FORMAT" "$PEP8" \
"$PERFORM_CPPCHECK" "$PERFORM_CLANG_FORMAT" "$PERFORM_PEP8" \
"$IGNORE_MSG_CPPCHECK" "$IGNORE_MSG_CLANG_FORMAT" "$IGNORE_MSG_PYCODESTYLE" \
"$PYCODESTYLE_IGNORES"
if [ $? -gt 0 ]; then
exit $?
Expand Down
2 changes: 1 addition & 1 deletion build_support/check_copyright_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
printed to stderr using the helper function eprint(). Messages meant
for the summary at the end of static_code_analysis.sh are printed to
stdout instead so they can be more easily captured and only printed if
errors occured.
errors occurred.
"""

Expand Down

0 comments on commit 94083b2

Please sign in to comment.