Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into static_node_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
C.A.P. Linssen committed Oct 25, 2022
2 parents 7913df6 + ec28759 commit bd3b50e
Show file tree
Hide file tree
Showing 398 changed files with 4,604 additions and 4,816 deletions.
4 changes: 0 additions & 4 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 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: 4 additions & 4 deletions build_support/parse_build_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ def makebuild_summary(log_filename, msg_make_section_start,

nest_warning_re = re.compile(f'.*({build_dir}.*: warning:.*)')
known_warnings = [
f'{build_dir}/sli/scanner.cc:638:13: warning: this statement may fall through [-Wimplicit-fallthrough=]',
f'{build_dir}/sli/scanner.cc:668:19: warning: this statement may fall through [-Wimplicit-fallthrough=]',
f'{build_dir}/sli/scanner.cc:710:13: warning: this statement may fall through [-Wimplicit-fallthrough=]',
f'{build_dir}/sli/scanner.cc:738:24: warning: this statement may fall through [-Wimplicit-fallthrough=]',
f'{build_dir}/sli/scanner.cc:637:13: warning: this statement may fall through [-Wimplicit-fallthrough=]',
f'{build_dir}/sli/scanner.cc:667:19: warning: this statement may fall through [-Wimplicit-fallthrough=]',
f'{build_dir}/sli/scanner.cc:709:13: warning: this statement may fall through [-Wimplicit-fallthrough=]',
f'{build_dir}/sli/scanner.cc:737:24: warning: this statement may fall through [-Wimplicit-fallthrough=]',
(f'{build_dir}/thirdparty/Random123/conventional/Engine.hpp:140:15: warning: implicitly-declared'
' ‘r123::Engine<r123::Threefry4x64_R<20> >& r123::Engine<r123::Threefry4x64_R<20> >::operator='
'(const r123::Engine<r123::Threefry4x64_R<20> >&)’ is deprecated [-Wdeprecated-copy]'),
Expand Down
2 changes: 1 addition & 1 deletion cmake/ProcessOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function( NEST_PROCESS_WITH_PYTHON )
endif ()
elseif ( ${with-python} STREQUAL "OFF" )
else ()
printError( "Invalid option: -Dwith-python=" ${with-python} )
printError( "Invalid value -Dwith-python=${with-python}, please use 'ON' or 'OFF'" )
endif ()
endfunction()

Expand Down
50 changes: 25 additions & 25 deletions doc/htmldoc/connect_nest/nest_server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ command that can either be run directly::
or supplied to the execution command line for running the Docker
container::

docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` -p 5000:5000 nestsim/nest:latest nest-server start
docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` -p 52425:52425 nestsim/nest:latest nest-server start

The generic invocation command line for the ``nest-server`` command
looks as follows::
Expand All @@ -120,7 +120,7 @@ of the other arguments is as follows:
-h <host>
Use hostname/IP address <host> for the server instance [default: 127.0.0.1]
-p <port>
Use port <port> for opening the socket [default: 5000]
Use port <port> for opening the socket [default: 52425]

Run with MPI
~~~~~~~~~~~~
Expand Down Expand Up @@ -299,22 +299,22 @@ NEST Server Client API
REST API overview
-----------------

localhost:5000
localhost:52425
Get the version of NEST used by NEST Server

localhost:5000/api
localhost:52425/api
List all available functions

localhost:5000/api/<call>
localhost:52425/api/<call>
Execute the function `<call>`

localhost:5000/api/<call>?inspect=getdoc
localhost:52425/api/<call>?inspect=getdoc
Get the documentation for the function `<call>`

localhost:5000/api/<call>?inspect=getsource
localhost:52425/api/<call>?inspect=getsource
Get the source code of the function `<call>`

localhost:5000/exec
localhost:52425/exec
Execute a Python script. This requires JSON data in the form

.. code-block:: JSON
Expand All @@ -330,31 +330,31 @@ website <https://curl.se/>`_.

To obtain basic information about the running server, run::

curl localhost:5000
curl localhost:52425

NEST Server responds to this by sending data in JSON format::

{"mpi":false,"nest":"3.2"}

You can retrieve data about the callable functions of NEST by running::

curl localhost:5000/api
curl localhost:52425/api

Retrieve the current kernel status dict from NEST::

curl localhost:5000/api/GetKernelStatus
curl localhost:52425/api/GetKernelStatus

Send API request with function arguments in JSON format::

curl -H "Content-Type: application/json" -d '{"model": "iaf_psc_alpha"}' localhost:5000/api/GetDefaults
curl -H "Content-Type: application/json" -d '{"model": "iaf_psc_alpha"}' localhost:52425/api/GetDefaults

.. note::

You can beautify the output of NEST Server by piping the output of
``curl`` through the JSON processor ``jq``. A sample command line
to display the available functions in this way looks like this::

curl -s localhost:5000/api | jq -r .
curl -s localhost:52425/api | jq -r .

For more information, check the `documentation on jq
<https://stedolan.github.io/jq/>`_.
Expand All @@ -373,23 +373,23 @@ Sending a simple request to the NEST Server using Python works as
follows::

import requests
requests.get('http://localhost:5000').json()
requests.get('http://localhost:52425').json()

To display a list of callable functions, use::

requests.get('http://localhost:5000/api').json()
requests.get('http://localhost:52425/api').json()

Reset the NEST simulation kernel (no response)::

requests.get('http://localhost:5000/api/ResetKernel').json()
requests.get('http://localhost:52425/api/ResetKernel').json()

Sending an API request in JSON format::

requests.post('http://localhost:5000/api/GetDefaults', json={'model': 'iaf_psc_alpha'}).json()
requests.post('http://localhost:52425/api/GetDefaults', json={'model': 'iaf_psc_alpha'}).json()

Create neurons in NEST and return a list of IDs for the new nodes::

neurons = requests.post('http://localhost:5000/api/Create', json={"model": "iaf_psc_alpha", "n": 100}).json()
neurons = requests.post('http://localhost:52425/api/Create', json={"model": "iaf_psc_alpha", "n": 100}).json()
print(neurons)

.. _nest_server_security:
Expand Down Expand Up @@ -463,7 +463,7 @@ Run scripts in NEST Server using `curl`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As shown above, you can send custom simulation code to
``localhost:5000/exec``. On the command line, this approach might be a
``localhost:52425/exec``. On the command line, this approach might be a
bit more challenging in the case your script does not fit on a single
line. For such situations, we recommend using a JSON file as input for
``curl``:
Expand All @@ -481,7 +481,7 @@ command:

.. code-block:: sh
curl -H "Content-Type: application/json" -d @simulation_script.json http://localhost:5000/exec
curl -H "Content-Type: application/json" -d @simulation_script.json http://localhost:52425/exec
Interact with NEST Server using JavaScript
Expand All @@ -508,7 +508,7 @@ box. Here is a small example showing the basic idea:
<body>
<script>
const xhr = new XMLHttpRequest();
xhr.open("GET", "http://localhost:5000");
xhr.open("GET", "http://localhost:52425");
xhr.addEventListener("readystatechange", () => {
if (xhr.readyState === 4) { // request done
console.log(xhr.responseText);
Expand All @@ -531,7 +531,7 @@ box. Here is a small example showing the basic idea:
}
});
// send to api route of NEST Server
xhr.open("GET", "http://localhost:5000/api/" + call);
xhr.open("GET", "http://localhost:52425/api/" + call);
xhr.send(null);
}
Expand All @@ -555,7 +555,7 @@ with a callback for POST requests:
}
});
// send to api route of NEST Server
xhr.open("POST", "http://localhost:5000/api/" + call);
xhr.open("POST", "http://localhost:52425/api/" + call);
xhr.setRequestHeader('Access-Control-Allow-Headers', 'Content-Type');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify(data)); // serialize data
Expand Down Expand Up @@ -584,7 +584,7 @@ callback for POST requests to execute a script:
}
});
// send to exec route of NEST Server
xhr.open("POST", "http://localhost:5000/exec");
xhr.open("POST", "http://localhost:52425/exec");
xhr.setRequestHeader('Access-Control-Allow-Headers', 'Content-Type');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify(data)); // serialize data
Expand Down Expand Up @@ -612,7 +612,7 @@ For POST requests to the NEST API Server, we recommend to use a Bash function:
.. code-block:: sh
#!/bin/bash
NEST_API=localhost:5000/api
NEST_API=localhost:52425/api
nest-server-api() {
if [ $# -eq 2 ]
Expand Down
8 changes: 3 additions & 5 deletions doc/htmldoc/installation/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ or

.. code-block:: bash
docker run -it --rm -e NEST_CONTAINER_MODE=nest-server -p 5000:5000 /
docker run -it --rm -e NEST_CONTAINER_MODE=nest-server -p 52425:52425 /
docker-registry.ebrains.eu/nest/nest-simulator:<version>
Starts the NEST API server container and opens the corresponding port 5000. Test it with `curl localhost:5000/api`.
Starts the NEST API server container and opens the corresponding port 52425. Test it with `curl localhost:52425/api`.
See the :ref:`nest_server` documentation for more details.

- NEST desktop
Expand All @@ -76,7 +76,7 @@ or

.. code-block:: bash
docker run -it --rm -e NEST_CONTAINER_MODE=nest-server -p 5000:5000 /
docker run -it --rm -e NEST_CONTAINER_MODE=nest-server -p 52425:52425 /
docker-registry.ebrains.eu/nest/nest-simulator:<version>
docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` -p 8000:8000 /
-e NEST_CONTAINER_MODE=nest-desktop docker-registry.ebrains.eu/nest/nest-simulator:<version>
Expand Down Expand Up @@ -191,5 +191,3 @@ For more information, you can checkout the `nest-docker repository <https://gith

.. |windows| image:: ../static/img/windows.png
:scale: 15%


73 changes: 47 additions & 26 deletions doc/htmldoc/neurons/model_details/aeif_models_implementation.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit bd3b50e

Please sign in to comment.