Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEST-3.0] crashes when built with GLIBCXX_ASSERTIONS defined #2101

Closed
sanjayankur31 opened this issue Jul 4, 2021 · 27 comments
Closed

[NEST-3.0] crashes when built with GLIBCXX_ASSERTIONS defined #2101

sanjayankur31 opened this issue Jul 4, 2021 · 27 comments
Assignees
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: High Should be handled next T: Bug Wrong statements in the code or documentation
Milestone

Comments

@sanjayankur31
Copy link
Contributor

sanjayankur31 commented Jul 4, 2021

(Edited for clarity)

Describe the bug
When NEST 3.0 is built with GLIBCXX_ASSERTIONS, it crashes on running. For example, when running the simple examples from the documentation, one gets:

$ python3 recording_demo.py

              -- N E S T --
  Copyright (C) 2004 The NEST Initiative

 Version: nest-3.0
 Built: Jul  3 2021 00:00:00

 This program is provided AS IS and comes with
 NO WARRANTY. See the file LICENSE for details.

 Problems or suggestions?
   Visit https://www.nest-simulator.org

 Type 'nest.help()' to find out more about NEST.

/usr/include/c++/11/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::front() [with _Tp = long int; _Alloc = std::allocator<long int>; std::vector<_Tp, _Alloc>::reference = long int&]: Assertion '!this->empty()' failed.
Aborted (core dumped)
$ python balancedneuron.py

              -- N E S T --
  Copyright (C) 2004 The NEST Initiative

 Version: nest-3.0
 Built: Jul  3 2021 00:00:00

 This program is provided AS IS and comes with
 NO WARRANTY. See the file LICENSE for details.

 Problems or suggestions?
   Visit https://www.nest-simulator.org

 Type 'nest.help()' to find out more about NEST.

Inhibitory rate estimate: 15.00 Hz
/usr/include/c++/11/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::front() [with _Tp = long int; _Alloc = std::allocator<long int>; std::vector<_Tp, _Alloc>::reference = long int&]: Assertion '!this->empty()' failed.
Aborted (core dumped)

To Reproduce
Steps to reproduce the behavior:
0. Build Nest 3.0 with -D_GLIBCXX_ASSERTIONS included in the compilation flags (enabled by default in Fedora)

  1. (Minimal) reproducing example: https://nest-simulator.readthedocs.io/en/stable/_downloads/3861b671d578f9f10bb865919eeb2af4/recording_demo.py
  2. Used parameters: NA
  3. Command to run: python recording_demo.py
  4. How to see error: crash is shown on the terminal as output

Expected behavior
Should not crash

Screenshots
NA

Desktop/Environment (please complete the following information):

  • OS: [e.g. iOS, Ubuntu-18.04]: Fedora 34
  • Browser: [if applicable, e.g. chrome, safari]: NA
  • Shell: [e.g. bash, zsh]: bash
  • Python-Version: [e.g. Python 3.6]: Python 3.9.5
  • NEST-Version: [e.g. nest-2.18, or git hash]: nest-3.0
  • Installation: [e.g. conda packet, apt, with/out MPI, ...]: currently the first build I've done for Fedora (not pushed to users yet).
    (in case you compiled the source code manually, provide the
    "Installation Summary" that you see at the end of the
    cmake step)

Additional context
The stacktrace from a build where the crash can be seen is here:
The complete backtrace is here: https://ankursinha.fedorapeople.org/nest-3/nest-3.0-backtrace.log

@sanjayankur31
Copy link
Contributor Author

Disabling our build flags prevents the crash, so it's a downstream build issue. I'll isolate the flag causing the break and report back.

@sanjayankur31 sanjayankur31 changed the title [NEST-3.0] crash while testing examples (python 3.9, gcc 11) [NEST-3.0] crashes when built with GLIBCXX_ASSERTIONS defined Jul 4, 2021
@sanjayankur31
Copy link
Contributor Author

More information on the flag here: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html

For the time being, I've removed this flag from the Fedora build.

If possible, it'll be good to include this flag in the list of default flags that NEST is built with (at least in CI, if not in the released binaries).

@stinebuu stinebuu added I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Bug Wrong statements in the code or documentation labels Jul 7, 2021
@hakonsbm
Copy link
Contributor

hakonsbm commented Jul 9, 2021

With the examples recording_demo.py and balancedneuron.py, the assertion fails with NEST 3.0 here:

memcpy(array_data, &vector_ptr.front(), vector_ptr.size() * sizeof(vector_value_t))

It fails because the vector is empty, so getting a pointer to the first element is impossible. I assume that because the size of the vector is zero, memcpy immediately returns and therefore avoids a segfault when not compiled with the extra assertions.

However, building with GLIBCXX_ASSERTIONS makes several tests in installcheck fail as well (both Python and SLI), also with 2.20, so the problem goes deeper than the PyNEST level, and it's older than NEST 3.0.

I'll try to look into the problem and see if we can add GLIBCXX_ASSERTIONS to the CI flags.

@heplesser
Copy link
Contributor

@hakonsbm Any news on this?

@sanjayankur31 Is it really -DGLIBCXX_ASSERTIONS or -D_GLIBCXX_ASSERTIONS with leading underscore?

@hakonsbm
Copy link
Contributor

hakonsbm commented Sep 7, 2021

@heplesser I'm still planning to look into it.

@sanjayankur31
Copy link
Contributor Author

sanjayankur31 commented Sep 7, 2021

@sanjayankur31 Is it really -DGLIBCXX_ASSERTIONS or -D_GLIBCXX_ASSERTIONS with leading underscore?

There's a leading underscore: -D_GLIBCXX_ASSERTIONS. I'll correct the bug text now.

These are the default compiler flags that all Fedora Linux packages are built with (for an x86_64 system):

-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection

@niltonlk
Copy link
Contributor

niltonlk commented Sep 7, 2021

Since I also use Fedora, tried with -D_GLIBCXX_ASSERTIONS flag on latest master (master@099a962f3):

cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS -DCMAKE_CXX_FLAGS="-D_GLIBCXX_ASSERTIONS" -Dwith-mpi=ON ../src/ 2>&1 | tee cmake_out.txt
--------------------------------------------------------------------------------
NEST Configuration Summary
--------------------------------------------------------------------------------

Build type          : 
Target System       : Linux
Cross Compiling     : FALSE
C compiler          : GNU 11.2.1 (/usr/bin/cc)
C compiler flags    :  -O2 -Wall -fopenmp   -pthread -fdiagnostics-color=auto
C++ compiler        : GNU 11.2.1 (/usr/bin/c++)
C++ compiler flags  : -D_GLIBCXX_ASSERTIONS -std=c++11 -O2 -Wall -fopenmp -pthread -fdiagnostics-color=auto
Build dynamic       : ON

Built-in modules    : models
User modules        : None
Python bindings     : Yes (Python 3.9.6: /usr/bin/python3.9)
       Includes     : /usr/include/python3.9
       Libraries    : /usr/lib64/libpython3.9.so

Cython bindings     : Yes (Cython 0.29.21: /usr/bin/cython)
MPI4PY header       : Yes (/usr/lib64/python3.9/site-packages/openmpi/mpi4py/include)
Use threading       : Yes (OpenMP: -fopenmp)
Use GSL             : Yes (GSL 2.6)
    Includes        : /usr/include
    Libraries       : /usr/lib64/libgsl.so;/usr/lib64/libgslcblas.so

Use Readline        : Yes (GNU Readline 8.1)
    Includes        : /usr/include
    Libraries       : /lib64/libreadline.so;/lib64/libncurses.so

Use libltdl         : Yes (LTDL )
    Includes        : /usr/include
    Libraries       : /lib64/libltdl.so

Use doxygen         : Yes (/usr/bin/doxygen)
                    : target `doc` available
    `dot` available : Yes (/usr/bin/dot)
                    : target `fulldoc` available
Use MPI             : Yes (MPI: /usr/lib64/openmpi/bin/mpicxx)
    FLAGS           : -pthread
    Includes        : /usr/include/openmpi-x86_64
    Link Flags      : -Wl,-rpath -Wl,/usr/lib64/openmpi/lib -Wl,--enable-new-dtags -pthread
    Libraries       : /usr/lib64/openmpi/lib/libmpi_cxx.so;/usr/lib64/openmpi/lib/libmpi.so

Detailed timers     : No

Use MUSIC           : No
Use libneurosim     : No
Use Boost           : Yes (Boost 1.75.0)
    Includes        : /usr/include
    Libraries       : 

Use recording backend Arbor   : No
Use SIONlib         : No

--------------------------------------------------------------------------------

Resulted in some installcheck errors:

----------------------------------------------------------------------
NEST Testsuite Results
----------------------------------------------------------------------
Phase                    Tests   Skipped  Failures    Errors      Time
----------------------------------------------------------------------
01 basetests                 6         0         0         0       6.0
02 selftests                 8         4         0         0       8.0
03 unittests               179         1         2         0     371.0
04 regressiontests          94         6         0         0     117.0
05 mpitests                 81         0         6         0     309.0
08 cpptests                 30         0         0         3       0.0
----------------------------------------------------------------------
Total                      398        11         8         3     811.0
----------------------------------------------------------------------

THE NEST TESTSUITE DISCOVERED PROBLEMS
    The following tests failed
    | unittests.test_dcgen_versus_I_e.sli
    | unittests.test_pulsepacket_generator.sli
    | mpitests.test_get_nodes.sli
    | mpitests.test_pulsepacket_generator.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_source.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_target.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_source_driven.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_target_driven.sli
    | test_blockvector.test_operator_mm
    | test_blockvector.test_operator_eq
    | test_blockvector.test_operator_neq

    Please report test failures by creating an issue at
        https://github.com/nest/nest_simulator/issues

----------------------------------------------------------------------

Find attached the installcheck log file:
installcheck.log

@heplesser heplesser added S: High Should be handled next and removed S: Normal Handle this with default priority labels Sep 8, 2021
@heplesser heplesser added this to the NEST 3.2 milestone Sep 8, 2021
@heplesser
Copy link
Contributor

The failing tests (unittests, mpitests) point to real problems which we need to investigate (see installcheck.log file uploaded by Nilton).

Strangely, the pytests did not run, why test_blockvector is shown in the report above I do not quite understand. The output at the very end of the installcheck is very strange. Nilton, could you post the "test setup summary" that is printed at the beginning of the "make installcheck" run, before the actual tests start?

@terhorstd @jougs @hakonsbm I added this to MS 3.2 to not delay 3.1, but it would still be good if we got it fixed asap.

@sanjayankur31
Copy link
Contributor Author

Just a note: there are container images for Fedora available if someone needs a Fedora like installation to debug this. (One can install necessary packages etc. using dnf in the container)

https://hub.docker.com/_/fedora

https://docs.fedoraproject.org/en-US/neurofedora/containers/#_using_the_fedora_release_containers_interactively

@hakonsbm
Copy link
Contributor

hakonsbm commented Sep 8, 2021

@heplesser Pytests didn't run because the pytest-timeout package isn't installed. It crashes with the error message error: unrecognized arguments: --timeout. The testsuite should check if pytest-timeout is installed and give a more informative message if it's not. test_blockvector is in the C++ tests.

@heplesser
Copy link
Contributor

@hakonsbm Thanks, I just created a PR that will handle this properly.

@niltonlk You need to install pytest-timeout to run the Python tests. It avoids that tests get stuck forever.

@niltonlk
Copy link
Contributor

niltonlk commented Sep 8, 2021

I have now intalled pytest-timeout. I have also checked on the unittests failures, and fixed part of them. I will open a PR shortly. Here is the intallcheck summary:

----------------------------------------------------------------------
NEST Testsuite Results
----------------------------------------------------------------------
Phase                    Tests   Skipped  Failures    Errors      Time
----------------------------------------------------------------------
01 basetests                 6         0         0         0       6.0
02 selftests                 8         4         0         0       8.0
03 unittests               179         1         1         0     377.0
04 regressiontests          94         6         0         0     117.0
05 mpitests                 81         0         7         0     330.0
07 pynesttests             498         5         0        38     128.6
07 pynesttests mpi 4         1         0         0         0       1.4
07 pynesttests nc            1         1         0         0       1.1
08 cpptests                 30         0         0         3       0.0
----------------------------------------------------------------------
Total                      898        17         8        41     969.2
----------------------------------------------------------------------

THE NEST TESTSUITE DISCOVERED PROBLEMS
    The following tests failed
    | unittests.test_pulsepacket_generator.sli
    | mpitests.test_get_nodes.sli
    | mpitests.test_localonly.sli
    | mpitests.ticket-516.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_source.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_target.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_source_driven.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_target_driven.sli
    | test_aeif_lsodar.AEIFTestCase.test_iaf_dc_input
    | test_aeif_lsodar.AEIFTestCase.test_closeness_nest_lsodar
    | test_clopath_synapse.ClopathSynapseTestCase.test_SynapseFunctionWithAeifModel
    | test_clopath_synapse.ClopathSynapseTestCase.test_SynapseDepressionFacilitation
    | test_changing_tic_base.TestChangingTicBase.test_models
    | test_NodeCollection.TestNodeCollection.test_senders_and_targets
    | test_aeif_lsodar.AEIFTestCase.test_iaf_spike_input
    | test_recording_backend_memory.TestRecordingBackendMemory.testEventCounter
    | test_urbanczik_synapse.UrbanczikSynapseTestCase.test_SynapseDepressionFacilitation
    | test_erfc_neuron.ErfcNeuronTheoryTestCase.test_activation_function
    | test_current_recording_generators.CurrentRecordingGeneratorTestCase.test_GetRecordables
    | test_mc_neuron.TestMCNeuron.testNeuron
    | test_nodeParametrization.TestNodeParametrization.test_create_with_spike_generator
    | test_json.StatusTestCase.test_GetDefaults_JSON
    | test_parrot_neuron.ParrotNeuronTestCase.test_ParrotNeuronIgnoreSpike
    | test_nodeParametrization.TestNodeParametrization.test_SetStatus_on_spike_generator
    | test_parrot_neuron.ParrotNeuronSTDPTestCase.test_ParrotNeuronSTDPProtocolPotentiation
    | test_status.StatusTestCase.test_GetStatus
    | test_status.StatusTestCase.test_SetStatusParam
    | test_refractory.TestRefractoryCase.test_refractory_time
    | test_recording_backend_memory.TestRecordingBackendMemory.testEventsDict
    | test_siegert_neuron.SiegertNeuronTestCase.test_RatePredictionSuprathresholdNoisefree
    | test_stdp_triplet_synapse.STDPTripletInhTestCase.test_preVarsDecayAfterPostSpike
    | test_stdp_triplet_synapse.STDPTripletSynapseTestCase.test_preVarsDecayAfterPostSpike
    | test_weight_recorder.WeightRecorderTestCase.testDefinedTargets
    | test_vogels_sprekeler_synapse.VogelsSprekelerConnectionTestCase.test_preVarsDecayAfterPostSpike
    | test_weight_recorder.WeightRecorderTestCase.testRPorts
    | test_current_recording_generators.CurrentRecordingGeneratorTestCase.test_RecordedCurrentVectors
    | test_get_set.TestNodeCollectionGetSet.test_get_different_size
    | test_nodeParametrization.TestNodeParametrization.test_set_on_spike_generator
    | test_stdp_multiplicity.StdpSpikeMultiplicity.test_ParrotNeuronSTDPProtocolPotentiation
    | test_nodeParametrization.TestNodeParametrization.test_set_with_dict_with_list_with_bools
    | test_json.StatusTestCase.test_GetStatus_JSON
    | test_parrot_neuron.ParrotNeuronTestCase.test_ParrotNeuronOutgoingMultiplicity
    | test_nodeParametrization.TestNodeParametrization.test_SetStatus_with_dict_with_bool
    | test_parrot_neuron_ps.ParrotNeuronPSTestCase.test_ParrotNeuronIgnoreSpike
    | test_visualization.VisualizationTestCase.test_raster_plot
    | test_glif_cond.GLIFCONDTestCase.test_lif
    | test_blockvector.test_operator_mm
    | test_blockvector.test_operator_eq
    | test_blockvector.test_operator_neq

    Please report test failures by creating an issue at
        https://github.com/nest/nest_simulator/issues

----------------------------------------------------------------------

And attached is the intallcheck log.
installcheck.log

@heplesser
Copy link
Contributor

@niltonlk Thanks for your efforts, I am looking forward to your PR! Interestingly, you have only 498 pynest tests (vs 663 otherwise) and none of the 166 "pynesttest mpi 2".

@niltonlk
Copy link
Contributor

niltonlk commented Sep 8, 2021

Just noticed that I forgot to allow oversubscribe... will redo the intallcheck and report back.

@niltonlk
Copy link
Contributor

niltonlk commented Sep 8, 2021

The number of pynest tests seems to be related to the -D_GLIBCXX_ASSERTIONS flags:

Without -D_GLIBCXX_ASSERTIONS flag:

cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/lib/gcc/nest/fedora -Dwith-mpi=ON ../src/

--------------------------------------------------------------------------------
NEST Configuration Summary
--------------------------------------------------------------------------------

Build type          : 
Target System       : Linux
Cross Compiling     : FALSE
C compiler          : GNU 11.2.1 (/usr/bin/cc)
C compiler flags    :  -O2 -Wall -fopenmp   -pthread -fdiagnostics-color=auto
C++ compiler        : GNU 11.2.1 (/usr/bin/c++)
C++ compiler flags  :  -std=c++11 -O2 -Wall -fopenmp -pthread -fdiagnostics-color=auto
Build dynamic       : ON

Built-in modules    : models
User modules        : None
Python bindings     : Yes (Python 3.9.6: /usr/bin/python3.9)
       Includes     : /usr/include/python3.9
       Libraries    : /usr/lib64/libpython3.9.so

Cython bindings     : Yes (Cython 0.29.21: /usr/bin/cython)
MPI4PY header       : Yes (/usr/lib64/python3.9/site-packages/openmpi/mpi4py/include)
Use threading       : Yes (OpenMP: -fopenmp)
Use GSL             : Yes (GSL 2.6)
    Includes        : /usr/include
    Libraries       : /usr/lib64/libgsl.so;/usr/lib64/libgslcblas.so

Use Readline        : Yes (GNU Readline 8.1)
    Includes        : /usr/include
    Libraries       : /lib64/libreadline.so;/lib64/libncurses.so

Use libltdl         : Yes (LTDL )
    Includes        : /usr/include
    Libraries       : /lib64/libltdl.so

Use doxygen         : Yes (/usr/bin/doxygen)
                    : target `doc` available
    `dot` available : Yes (/usr/bin/dot)
                    : target `fulldoc` available
Use MPI             : Yes (MPI: /usr/lib64/openmpi/bin/mpicxx)
    FLAGS           : -pthread
    Includes        : /usr/include/openmpi-x86_64
    Link Flags      : -Wl,-rpath -Wl,/usr/lib64/openmpi/lib -Wl,--enable-new-dtags -pthread
    Libraries       : /usr/lib64/openmpi/lib/libmpi_cxx.so;/usr/lib64/openmpi/lib/libmpi.so

Detailed timers     : No

Use MUSIC           : No
Use libneurosim     : No
Use Boost           : Yes (Boost 1.75.0)
    Includes        : /usr/include
    Libraries       : 

Use recording backend Arbor   : No
Use SIONlib         : No

--------------------------------------------------------------------------------

make installcheck

Executing NEST's testsuite...
================================================================================

  NEST testsuite
  Date: Wed Sep  8 05:48:41 PM UTC 2021
  Sysinfo: Linux 5.13.13-200.fc34.x86_64 x86_64

  NEST executable .... nest_serial (version fix_2101_partial@b4d1ae061)
  PREFIX ............. /opt/lib/gcc/nest/fedora
  Python executable .. /usr/bin/python3.9 (version 3.9.6)
  PYTHONPATH ......... /opt/lib/gcc/nest/fedora/lib64/python3.9/site-packages
  Pytest version ..... 6.2.2
         timeout ..... 120 s
  Running MPI tests .. yes
  MPI launcher ....... /usr/lib64/openmpi/bin/mpirun
  TEST_BASEDIR ....... /opt/lib/gcc/nest/fedora/share/nest/testsuite
  REPORTDIR .......... /home/nilton/Workspace/git/nest-simulator/fedora/reports
  PATH ............... /opt/lib/gcc/nest/fedora/bin
                       /usr/lib64/openmpi/bin
                       /home/nilton/.local/bin
                       /home/nilton/bin
                       /usr/lib64/qt-3.3/bin
                       /usr/condabin
                       /usr/local/bin
                       /usr/bin
                       /bin
                       /usr/local/sbin
                       /usr/sbin

================================================================================

----------------------------------------------------------------------
NEST Testsuite Results
----------------------------------------------------------------------
Phase                    Tests   Skipped  Failures    Errors      Time
----------------------------------------------------------------------
01 basetests                 6         0         0         0       6.0
02 selftests                 8         4         0         0       8.0
03 unittests               179         1         1         0     376.0
04 regressiontests          94         6         0         0     118.0
05 mpitests                 81         0         0         0     322.0
07 pynesttests             663         6         5         0     165.7
07 pynesttests mpi 2       166         0         0         0      40.7
07 pynesttests mpi 4         1         0         0         0       1.4
07 pynesttests nc            1         1         0         0       1.1
08 cpptests                 30         0         0         0       0.0
----------------------------------------------------------------------
Total                     1229        18         6         0    1038.9
----------------------------------------------------------------------

THE NEST TESTSUITE DISCOVERED PROBLEMS
    The following tests failed
    | unittests.test_pulsepacket_generator.sli
    | test_erfc_neuron.ErfcNeuronTheoryTestCase.test_activation_function
    | test_threads.ThreadTestCase.test_ThreadsGetEvents
    | test_sp.test_growth_curves.TestGrowthCurve.test_sigmoid_growth_curve
    | test_sp.test_growth_curves.TestGrowthCurve.test_gaussian_growth_curve
    | test_regression_issue-1409.MultiplePoissonGeneratorsTestCase.test_multiple_poisson_generators

    Please report test failures by creating an issue at
        https://github.com/nest/nest_simulator/issues

----------------------------------------------------------------------

With -D_GLIBCXX_ASSERTIONS flag:

cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS -DCMAKE_CXX_FLAGS="-D_GLIBCXX_ASSERTIONS" -Dwith-mpi=ON ../src/

--------------------------------------------------------------------------------
NEST Configuration Summary
--------------------------------------------------------------------------------

Build type          : 
Target System       : Linux
Cross Compiling     : FALSE
C compiler          : GNU 11.2.1 (/usr/bin/cc)
C compiler flags    :  -O2 -Wall -fopenmp   -pthread -fdiagnostics-color=auto
C++ compiler        : GNU 11.2.1 (/usr/bin/c++)
C++ compiler flags  : -D_GLIBCXX_ASSERTIONS -std=c++11 -O2 -Wall -fopenmp -pthread -fdiagnostics-color=auto
Build dynamic       : ON

Built-in modules    : models
User modules        : None
Python bindings     : Yes (Python 3.9.6: /usr/bin/python3.9)
       Includes     : /usr/include/python3.9
       Libraries    : /usr/lib64/libpython3.9.so

Cython bindings     : Yes (Cython 0.29.21: /usr/bin/cython)
MPI4PY header       : Yes (/usr/lib64/python3.9/site-packages/openmpi/mpi4py/include)
Use threading       : Yes (OpenMP: -fopenmp)
Use GSL             : Yes (GSL 2.6)
    Includes        : /usr/include
    Libraries       : /usr/lib64/libgsl.so;/usr/lib64/libgslcblas.so

Use Readline        : Yes (GNU Readline 8.1)
    Includes        : /usr/include
    Libraries       : /lib64/libreadline.so;/lib64/libncurses.so

Use libltdl         : Yes (LTDL )
    Includes        : /usr/include
    Libraries       : /lib64/libltdl.so

Use doxygen         : Yes (/usr/bin/doxygen)
                    : target `doc` available
    `dot` available : Yes (/usr/bin/dot)
                    : target `fulldoc` available
Use MPI             : Yes (MPI: /usr/lib64/openmpi/bin/mpicxx)
    FLAGS           : -pthread
    Includes        : /usr/include/openmpi-x86_64
    Link Flags      : -Wl,-rpath -Wl,/usr/lib64/openmpi/lib -Wl,--enable-new-dtags -pthread
    Libraries       : /usr/lib64/openmpi/lib/libmpi_cxx.so;/usr/lib64/openmpi/lib/libmpi.so

Detailed timers     : No

Use MUSIC           : No
Use libneurosim     : No
Use Boost           : Yes (Boost 1.75.0)
    Includes        : /usr/include
    Libraries       : 

Use recording backend Arbor   : No
Use SIONlib         : No

--------------------------------------------------------------------------------

make installcheck

Executing NEST's testsuite...
================================================================================

  NEST testsuite
  Date: Wed Sep  8 03:33:25 PM UTC 2021
  Sysinfo: Linux 5.13.13-200.fc34.x86_64 x86_64

  NEST executable .... nest_serial (version fix_2101_partial@b4d1ae061)
  PREFIX ............. /opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS
  Python executable .. /usr/bin/python3.9 (version 3.9.6)
  PYTHONPATH ......... /opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/lib64/python3.9/site-packages
                       /opt/lib/gcc/nrn/8.0.0/lib64/python
                       /opt/lib/gcc/nestml/4.0.0/lib/python3.9/site-packages/antlr4_python3_runtime-4.9.2-py3.9.egg
                       /opt/lib/gcc/nestml/4.0.0/lib/python3.9/site-packages/mpmath-1.2.1-py3.9.egg
                       /opt/lib/gcc/nestml/4.0.0/lib/python3.9/site-packages/sympy-1.8-py3.9.egg
                       /opt/lib/gcc/nestml/4.0.0/lib/python3.9/site-packages/odetoolbox-2.2.post0.dev0-py3.9.egg
                       /opt/lib/gcc/nestml/4.0.0/lib/python3.9/site-packages/NESTML-3.1.post0.dev0-py3.9.egg
                       /opt/lib/gcc/nestml/4.0.0/lib/python3.9/site-packages
  Pytest version ..... 6.2.2
         timeout ..... 120 s
  Running MPI tests .. yes
  MPI launcher ....... /usr/lib64/openmpi/bin/mpirun
  TEST_BASEDIR ....... /opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/nest/testsuite
  REPORTDIR .......... /home/nilton/Workspace/git/nest-simulator/fedora_D_GLIBCXX_ASSERTIONS/reports
  PATH ............... /opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/bin
                       /opt/lib/gcc/nrn/8.0.0/bin
                       /opt/lib/gcc/nestml/4.0.0/bin
                       /usr/lib64/openmpi/bin
                       /home/nilton/.local/bin
                       /home/nilton/bin
                       /usr/lib64/qt-3.3/bin
                       /usr/condabin
                       /usr/local/bin
                       /usr/bin
                       /bin
                       /usr/local/sbin
                       /usr/sbin

================================================================================

----------------------------------------------------------------------
NEST Testsuite Results
----------------------------------------------------------------------
Phase                    Tests   Skipped  Failures    Errors      Time
----------------------------------------------------------------------
01 basetests                 6         0         0         0       6.0
02 selftests                 8         4         0         0       8.0
03 unittests               179         1         1         0     379.0
04 regressiontests          94         6         0         0     117.0
05 mpitests                 81         0         5         0     333.0
07 pynesttests             489         6         0        37     135.9
07 pynesttests mpi 4         1         0         0         0       1.5
07 pynesttests nc            1         1         0         0       1.9
08 cpptests                 30         0         0         3       0.0
----------------------------------------------------------------------
Total                      889        18         6        40     982.2
----------------------------------------------------------------------

THE NEST TESTSUITE DISCOVERED PROBLEMS
    The following tests failed
    | unittests.test_pulsepacket_generator.sli
    | mpitests.test_get_nodes.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_source.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_target.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_source_driven.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_target_driven.sli
    | test_aeif_lsodar.AEIFTestCase.test_iaf_dc_input
    | test_aeif_lsodar.AEIFTestCase.test_closeness_nest_lsodar
    | test_clopath_synapse.ClopathSynapseTestCase.test_SynapseFunctionWithAeifModel
    | test_clopath_synapse.ClopathSynapseTestCase.test_SynapseDepressionFacilitation
    | test_aeif_lsodar.AEIFTestCase.test_iaf_spike_input
    | test_changing_tic_base.TestChangingTicBase.test_models
    | test_NodeCollection.TestNodeCollection.test_senders_and_targets
    | test_status.StatusTestCase.test_GetDefaults
    | test_stdp_triplet_synapse.STDPTripletInhTestCase.test_maxWeightStaturatesWeight
    | test_recording_backend_memory.TestRecordingBackendMemory.testEventCounter
    | test_visualization.VisualizationTestCase.test_raster_plot
    | test_glif_psc.GLIFPSCTestCase.test_lif_r
    | test_glif_cond.GLIFCONDTestCase.test_lif
    | test_current_recording_generators.CurrentRecordingGeneratorTestCase.test_GetRecordables
    | test_get_set.TestNodeCollectionGetSet.test_get_JSON
    | test_stdp_triplet_synapse.STDPTripletInhTestCase.test_weightChangeWhenPrePostPreSpikes
    | test_nodeParametrization.TestNodeParametrization.test_create_with_spike_generator
    | test_nodeParametrization.TestNodeParametrization.test_SetStatus_with_dict_with_bool
    | test_nodeParametrization.TestNodeParametrization.test_set_on_spike_generator
    | test_nodeParametrization.TestNodeParametrization.test_set_with_dict_with_list_with_bools
    | test_urbanczik_synapse.UrbanczikSynapseTestCase.test_SynapseDepressionFacilitation
    | test_stdp_multiplicity.StdpSpikeMultiplicity.test_ParrotNeuronSTDPProtocolPotentiation
    | test_vogels_sprekeler_synapse.VogelsSprekelerConnectionTestCase.test_maxWeightStaturatesWeight
    | test_stdp_triplet_synapse.STDPTripletSynapseTestCase.test_preVarsDecayAfterPreSpike
    | test_vogels_sprekeler_synapse.VogelsSprekelerConnectionTestCase.test_preVarsIncreaseWithPreSpike
    | test_weight_recorder.WeightRecorderTestCase.testDefinedTargetsAndSenders
    | test_recording_backend_memory.TestRecordingBackendMemory.testEventsDict
    | test_recording_backends.TestRecordingBackends.testSetDefaultRecordingBackend
    | test_regression_issue-1034.PostTraceTestCase.test_post_trace
    | test_siegert_neuron.SiegertNeuronTestCase.test_RatePredictionAtThreshold
    | test_glif_cond.GLIFCONDTestCase.test_lif_asc
    | test_current_recording_generators.CurrentRecordingGeneratorTestCase.test_RecordedCurrentVectors
    | test_glif_psc.GLIFPSCTestCase.test_lif_r_asc
    | test_nodeParametrization.TestNodeParametrization.test_SetStatus_with_dict_with_list_with_bools
    | test_glif_cond.GLIFCONDTestCase.test_lif_r_asc
    | test_step_rate_generator.StepRateGeneratorTestCase.test_step_rate_generator
    | test_json.StatusTestCase.test_GetDefaults_JSON
    | test_blockvector.test_operator_mm
    | test_blockvector.test_operator_eq
    | test_blockvector.test_operator_neq

    Please report test failures by creating an issue at
        https://github.com/nest/nest_simulator/issues

----------------------------------------------------------------------

Oversubscribe is enabled by setting the following environment variable export OMPI_MCA_rmaps_base_oversubscribe=1

Attached is the installcheck log file for the case with -D_GLIBCXX_ASSERTIONS flag:
installcheck_with_D_GLIBCXX_ASSERTIONS.log

@heplesser
Copy link
Contributor

The raw Python test output in the installcheck log is quite garbled, since we run tests in parallel. To get a more readable log, change --numprocesses=auto to --numprocesses=1 for debugging here:

"${PYTHON}" -m pytest --verbose --timeout $TIME_LIMIT --junit-xml="${XUNIT_FILE}" --numprocesses=auto \

The two-process MPI Python tests seem to not report because the last of them seems to crash. You could try to add --numprocesses=1 to the PYTEST_ARGS here

PYTEST_ARGS="--verbose --timeout $TIME_LIMIT --junit-xml=${XUNIT_FILE} ${PYNEST_TEST_DIR}/mpi/${numproc}"

but I have not tested if pytest-xdist works properly when run under mpirun with more than one process.

BTW, you can also add the --oversubscribe flag to the mpirun command defined in the .nestrc file in your home directory.

@niltonlk
Copy link
Contributor

niltonlk commented Sep 9, 2021

There was an error in the conditional expression in pulsepacket_generator. Fixing it, corrected not only test_pulsepacket_generator.sli, but recovered the missing pynest tests. There is now 2 failures left.
This was executed without the D_GLIBCXX_ASSERTIONS flag

----------------------------------------------------------------------
NEST Testsuite Results
----------------------------------------------------------------------
Phase                    Tests   Skipped  Failures    Errors      Time
----------------------------------------------------------------------
01 basetests                 6         0         0         0       6.0
02 selftests                 8         4         0         0       8.0
03 unittests               179         1         0         0     367.0
04 regressiontests          94         6         0         0     122.0
05 mpitests                 81         0         0         0     326.0
07 pynesttests             663         6         2         0     178.5
07 pynesttests mpi 2       166         0         0         0      33.8
07 pynesttests mpi 4         1         0         0         0       1.4
07 pynesttests nc            1         1         0         0       0.9
08 cpptests                 30         0         0         0       0.0
----------------------------------------------------------------------
Total                     1229        18         2         0    1043.6
----------------------------------------------------------------------

THE NEST TESTSUITE DISCOVERED PROBLEMS
    The following tests failed
    | test_erfc_neuron.ErfcNeuronTheoryTestCase.test_activation_function
    | test_regression_issue-1409.MultiplePoissonGeneratorsTestCase.test_multiple_poisson_generators

    Please report test failures by creating an issue at
        https://github.com/nest/nest_simulator/issues

----------------------------------------------------------------------

installcheck.log

@heplesser
Copy link
Contributor

@niltonlk That are good news, although I am surprised that also tests that failed before when the assertions were activated and that are entirely unrelated to the pp-generator, now pass. The two tests that still fail do so because of timeouts. I find this a bit curious, since the timeouts are set to 120s and the total runtime for the pynesttest is only 178s. Since the tests run concurrently, this is not entirely implausible. Could you try to run those two tests directly with pytest and see how long they take?

@niltonlk
Copy link
Contributor

niltonlk commented Sep 9, 2021

Looking at the log, both fails seems to be due to Timeout >120.0s. Running the two tests independetly with timeout 120 passes:

  • test_erfc_neuron:
$ python -m pytest --verbose --numprocesses=auto --timeout 120 /opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/nest/testsuite/pytests/test_erfc_neuron.py 
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.9.6, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/nest/testsuite/pytests
plugins: forked-1.3.0, xdist-2.2.0, timeout-1.4.2
timeout: 120.0s
timeout method: signal
timeout func_only: False
[gw0] linux Python 3.9.6 cwd: /home/nilton/Workspace/git/nest-simulator/fedora_D_GLIBCXX_ASSERTIONS
[gw1] linux Python 3.9.6 cwd: /home/nilton/Workspace/git/nest-simulator/fedora_D_GLIBCXX_ASSERTIONS
[gw2] linux Python 3.9.6 cwd: /home/nilton/Workspace/git/nest-simulator/fedora_D_GLIBCXX_ASSERTIONS
[gw3] linux Python 3.9.6 cwd: /home/nilton/Workspace/git/nest-simulator/fedora_D_GLIBCXX_ASSERTIONS
[gw0] Python 3.9.6 (default, Jul 16 2021, 00:00:00)  -- [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]
[gw2] Python 3.9.6 (default, Jul 16 2021, 00:00:00)  -- [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]
[gw1] Python 3.9.6 (default, Jul 16 2021, 00:00:00)  -- [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]
[gw3] Python 3.9.6 (default, Jul 16 2021, 00:00:00)  -- [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]
gw0 [1] / gw1 [1] / gw2 [1] / gw3 [1]
scheduling tests via LoadScheduling

../../../../../../opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/nest/testsuite/pytests/test_erfc_neuron.py::ErfcNeuronTheoryTestCase::test_activation_function 
[gw0] [100%] PASSED ../../../../../../opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/nest/testsuite/pytests/test_erfc_neuron.py::ErfcNeuronTheoryTestCase::test_activation_function 

===================================================================================== 1 passed in 32.19s =====================================================================================
  • test_regression_issue-1409
$ python -m pytest --verbose --numprocesses=auto --timeout 120 /opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/nest/testsuite/pytests/test_regression_issue-1409.py 
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.9.6, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/nest/testsuite/pytests
plugins: forked-1.3.0, xdist-2.2.0, timeout-1.4.2
timeout: 120.0s
timeout method: signal
timeout func_only: False
[gw0] linux Python 3.9.6 cwd: /home/nilton/Workspace/git/nest-simulator/fedora_D_GLIBCXX_ASSERTIONS
[gw1] linux Python 3.9.6 cwd: /home/nilton/Workspace/git/nest-simulator/fedora_D_GLIBCXX_ASSERTIONS
[gw2] linux Python 3.9.6 cwd: /home/nilton/Workspace/git/nest-simulator/fedora_D_GLIBCXX_ASSERTIONS
[gw3] linux Python 3.9.6 cwd: /home/nilton/Workspace/git/nest-simulator/fedora_D_GLIBCXX_ASSERTIONS
[gw0] Python 3.9.6 (default, Jul 16 2021, 00:00:00)  -- [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]
[gw1] Python 3.9.6 (default, Jul 16 2021, 00:00:00)  -- [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]
[gw3] Python 3.9.6 (default, Jul 16 2021, 00:00:00)  -- [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]
[gw2] Python 3.9.6 (default, Jul 16 2021, 00:00:00)  -- [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]
gw0 [1] / gw1 [1] / gw2 [1] / gw3 [1]
scheduling tests via LoadScheduling

../../../../../../opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/nest/testsuite/pytests/test_regression_issue-1409.py::MultiplePoissonGeneratorsTestCase::test_multiple_poisson_generators 
[gw0] [100%] PASSED ../../../../../../opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/nest/testsuite/pytests/test_regression_issue-1409.py::MultiplePoissonGeneratorsTestCase::test_multiple_poisson_generators 

===================================================================================== 1 passed in 3.82s ======================================================================================

In addition, the above mentioned examples now works!

  • recodring_demo.py
$ python /opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/doc/nest/examples/pynest/recording_demo.py 

              -- N E S T --
  Copyright (C) 2004 The NEST Initiative

 Version: fix_2101_partial@7d8bd63cb
 Built: Sep  9 2021 04:27:57

 This program is provided AS IS and comes with
 NO WARRANTY. See the file LICENSE for details.

 Problems or suggestions?
   Visit https://www.nest-simulator.org

 Type 'nest.help()' to find out more about NEST.


Sep 09 06:11:50 NodeManager::prepare_nodes [Info]: 
    Preparing 3 nodes for simulation.

Sep 09 06:11:50 SimulationManager::start_updating_ [Info]: 
    Number of local nodes: 3
    Simulation time (ms): 30
    Number of OpenMP threads: 1
    Number of MPI processes: 1

Sep 09 06:11:50 SimulationManager::run [Info]: 
    Simulation finished.
simulation resolution in ms: 0.1
data recorded by recording backend ascii (time_in_steps=True)
[['sender' 'time_step' 'time_offset']
 ['1' '21' '0.000']
 ['1' '44' '0.000']
 ['1' '67' '0.000']
 ['1' '89' '0.000']
 ['1' '111' '0.000']
 ['1' '133' '0.000']
 ['1' '155' '0.000']
 ['1' '177' '0.000']
 ['1' '199' '0.000']
 ['1' '221' '0.000']
 ['1' '243' '0.000']
 ['1' '265' '0.000']
 ['1' '287' '0.000']]

Sep 09 06:11:50 NodeManager::prepare_nodes [Info]: 
    Preparing 3 nodes for simulation.

Sep 09 06:11:50 SimulationManager::start_updating_ [Info]: 
    Number of local nodes: 3
    Simulation time (ms): 30
    Number of OpenMP threads: 1
    Number of MPI processes: 1

Sep 09 06:11:50 SimulationManager::run [Info]: 
    Simulation finished.
simulation resolution in ms: 0.1
data recorded by recording backend memory (time_in_steps=True)
{'offsets': array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), 'senders': array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]), 'times': array([ 21,  44,  67,  89, 111, 133, 155, 177, 199, 221, 243, 265, 287])}

Sep 09 06:11:50 NodeManager::prepare_nodes [Info]: 
    Preparing 3 nodes for simulation.

Sep 09 06:11:50 SimulationManager::start_updating_ [Info]: 
    Number of local nodes: 3
    Simulation time (ms): 30
    Number of OpenMP threads: 1
    Number of MPI processes: 1

Sep 09 06:11:50 SimulationManager::run [Info]: 
    Simulation finished.
simulation resolution in ms: 0.1
data recorded by recording backend ascii (time_in_steps=False)
[['sender' 'time_ms']
 ['1' '2.100']
 ['1' '4.400']
 ['1' '6.700']
 ['1' '8.900']
 ['1' '11.100']
 ['1' '13.300']
 ['1' '15.500']
 ['1' '17.700']
 ['1' '19.900']
 ['1' '22.100']
 ['1' '24.300']
 ['1' '26.500']
 ['1' '28.700']]

Sep 09 06:11:50 NodeManager::prepare_nodes [Info]: 
    Preparing 3 nodes for simulation.

Sep 09 06:11:50 SimulationManager::start_updating_ [Info]: 
    Number of local nodes: 3
    Simulation time (ms): 30
    Number of OpenMP threads: 1
    Number of MPI processes: 1

Sep 09 06:11:50 SimulationManager::run [Info]: 
    Simulation finished.
simulation resolution in ms: 0.1
data recorded by recording backend memory (time_in_steps=False)
{'senders': array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]), 'times': array([ 2.1,  4.4,  6.7,  8.9, 11.1, 13.3, 15.5, 17.7, 19.9, 22.1, 24.3,
       26.5, 28.7])}
  • balancedneuron.py
$ python /opt/lib/gcc/nest/fedora_D_GLIBCXX_ASSERTIONS/share/doc/nest/examples/pynest/balancedneuron.py 

              -- N E S T --
  Copyright (C) 2004 The NEST Initiative

 Version: fix_2101_partial@7d8bd63cb
 Built: Sep  9 2021 04:27:57

 This program is provided AS IS and comes with
 NO WARRANTY. See the file LICENSE for details.

 Problems or suggestions?
   Visit https://www.nest-simulator.org

 Type 'nest.help()' to find out more about NEST.

Inhibitory rate estimate: 15.00 Hz
  -> Neuron rate: 347.56 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 25.00 Hz
  -> Neuron rate:   0.04 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 20.00 Hz
  -> Neuron rate:  34.88 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 22.50 Hz
  -> Neuron rate:   0.00 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 21.25 Hz
  -> Neuron rate:   0.84 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 20.62 Hz
  -> Neuron rate:   7.40 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 20.94 Hz
  -> Neuron rate:   3.08 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 20.78 Hz
  -> Neuron rate:   4.40 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 20.70 Hz
  -> Neuron rate:   6.32 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 20.74 Hz
  -> Neuron rate:   4.88 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 20.72 Hz
  -> Neuron rate:   5.96 Hz (goal: 5.00 Hz)
Inhibitory rate estimate: 20.73 Hz
  -> Neuron rate:   5.52 Hz (goal: 5.00 Hz)
Optimal rate for the inhibitory population: 20.73 Hz

Figure_1

@niltonlk
Copy link
Contributor

niltonlk commented Sep 9, 2021

With numprocesses=1 all tests pass:

----------------------------------------------------------------------
NEST Testsuite Results
----------------------------------------------------------------------
Phase                    Tests   Skipped  Failures    Errors      Time
----------------------------------------------------------------------
01 basetests                 6         0         0         0       6.0
02 selftests                 8         4         0         0       8.0
03 unittests               179         1         0         0     369.0
04 regressiontests          94         6         0         0     120.0
05 mpitests                 81         0         0         0     325.0
07 pynesttests             663         6         0         0     137.5
07 pynesttests mpi 2       166         0         0         0      33.7
07 pynesttests mpi 4         1         0         0         0       1.4
07 pynesttests nc            1         1         0         0       0.9
08 cpptests                 30         0         0         0       0.0
----------------------------------------------------------------------
Total                     1229        18         0         0    1001.5
----------------------------------------------------------------------

The NEST Testsuite passed successfully.

----------------------------------------------------------------------

@heplesser
Copy link
Contributor

Nice! It might be that the pytest time-out mechanism and the concurrent testing mechanism do not interact entirely well. What I find most surprising maybe is that some of the cpptests for blockvector failed originally and do not longer fail now. Those tests should be completely independent from the fixes you made in #2159.

@niltonlk
Copy link
Contributor

niltonlk commented Sep 9, 2021

My mistake. The last results were without the -D_GLIBCXX_ASSERTIONS flag. I picked the wrong cmake command from history. Sorry for the mess.
I am redoing with the correct flag and will report as soon as they are done.

@niltonlk
Copy link
Contributor

niltonlk commented Sep 9, 2021

Now I have -D_GLIBCXX_ASSERTIONS flag enabled as (extracted from cmake summary):
C++ compiler flags : -D_GLIBCXX_ASSERTIONS -std=c++11 -O2 -Wall -fopenmp -pthread -fdiagnostics-color=auto

Surprisingly, the number of reported tests differs if pytest uses 1 process (numprocesses=1) or all available processes (numprocesses=auto):

  • --numprocesses=auto
----------------------------------------------------------------------
NEST Testsuite Results
----------------------------------------------------------------------
Phase                    Tests   Skipped  Failures    Errors      Time
----------------------------------------------------------------------
01 basetests                 6         0         0         0       6.0
02 selftests                 8         4         0         0       8.0
03 unittests               179         1         0         0     363.0
04 regressiontests          94         6         0         0     121.0
05 mpitests                 81         0         5         0     306.0
07 pynesttests             383         3         0        18      69.9
07 pynesttests mpi 4         1         0         0         0       1.3
07 pynesttests nc            1         1         0         0       0.9
08 cpptests                 30         0         0         3       0.0
----------------------------------------------------------------------
Total                      783        15         5        21     876.2
----------------------------------------------------------------------

THE NEST TESTSUITE DISCOVERED PROBLEMS
    The following tests failed
    | mpitests.test_get_nodes.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_source.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_target.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_source_driven.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_target_driven.sli
    | test_aeif_lsodar.AEIFTestCase.test_closeness_nest_lsodar
    | test_changing_tic_base.TestChangingTicBase.test_models
    | test_NodeCollection.TestNodeCollection.test_senders_and_targets
    | test_aeif_lsodar.AEIFTestCase.test_iaf_spike_input
    | test_nodeParametrization.TestNodeParametrization.test_create_with_spike_generator
    | test_clopath_synapse.ClopathSynapseTestCase.test_SynapseFunctionWithAeifModel
    | test_aeif_lsodar.AEIFTestCase.test_iaf_dc_input
    | test_nodeParametrization.TestNodeParametrization.test_set_on_spike_generator
    | test_rate_copy_model.RateCopyModelTestCase.test_rate_copy_model
    | test_glif_psc.GLIFPSCTestCase.test_lif_r
    | test_stdp_multiplicity.StdpSpikeMultiplicity.test_ParrotNeuronSTDPProtocolPotentiation
    | test_get_set.TestNodeCollectionGetSet.test_get_different_size
    | test_current_recording_generators.CurrentRecordingGeneratorTestCase.test_GetRecordables
    | test_nodeParametrization.TestNodeParametrization.test_SetStatus_on_spike_generator
    | test_parrot_neuron.ParrotNeuronTestCase.test_ParrotNeuronIgnoreSpike
    | test_pp_psc_delta_stdp.PpPscDeltaSTDPTestCase.test_pp_psc_delta_stdp
    | test_stdp_triplet_synapse.STDPTripletInhTestCase.test_maxWeightStaturatesWeight
    | test_siegert_neuron.SiegertNeuronTestCase.test_RatePredictionAtThreshold
    | test_blockvector.test_operator_mm
    | test_blockvector.test_operator_eq
    | test_blockvector.test_operator_neq

    Please report test failures by creating an issue at
        https://github.com/nest/nest_simulator/issues

----------------------------------------------------------------------

installcheck_auto.log

  • --numprocesses=1
----------------------------------------------------------------------
NEST Testsuite Results
----------------------------------------------------------------------
Phase                    Tests   Skipped  Failures    Errors      Time
----------------------------------------------------------------------
01 basetests                 6         0         0         0       6.0
02 selftests                 8         4         0         0       8.0
03 unittests               179         1         0         0     373.0
04 regressiontests          94         6         0         0     122.0
05 mpitests                 81         0         5         0     360.0
07 pynesttests             142         0         0         5      47.5
07 pynesttests mpi 4         1         0         0         0       1.6
07 pynesttests nc            1         1         0         0       0.9
08 cpptests                 30         0         0         3       0.0
----------------------------------------------------------------------
Total                      542        12         5         8     919.1
----------------------------------------------------------------------

THE NEST TESTSUITE DISCOVERED PROBLEMS
    The following tests failed
    | mpitests.test_get_nodes.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_source.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_target.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_source_driven.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_target_driven.sli
    | test_NodeCollection.TestNodeCollection.test_senders_and_targets
    | test_current_recording_generators.CurrentRecordingGeneratorTestCase.test_GetRecordables
    | test_urbanczik_synapse.UrbanczikSynapseTestCase.test_SynapseDepressionFacilitation
    | test_current_recording_generators.CurrentRecordingGeneratorTestCase.test_RecordedCurrentVectors
    | test_stdp_triplet_synapse.STDPTripletInhTestCase.test_weightChangeWhenPrePostSpikes
    | test_blockvector.test_operator_mm
    | test_blockvector.test_operator_eq
    | test_blockvector.test_operator_neq

    Please report test failures by creating an issue at
        https://github.com/nest/nest_simulator/issues

----------------------------------------------------------------------

installcheck_1.log

Another thing is that the pynest examples above (recording_demo.py and balancedneuron.py) fails.
The minimum code for the same error as in recording_demo.py is as follow:

import nest

sr = nest.Create('spike_recorder', 1, {'record_to': 'ascii'})

if you call Create('spike_recorder', 1) or just Create('spike_recorder') without the parameters dict, it pass.
From the error message:
/usr/include/c++/11/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::front() [with _Tp = long int; _Alloc = std::allocator<long int>; std::vector<_Tp, _Alloc>::reference = long int&]: Assertion '!this->empty()' failed.
it seems to be trying to access the first element of an empty vector. I just could not find where in the code yet.

@heplesser
Copy link
Contributor

@niltonlk Thank you for your detective work! And in a way good to know that the errors did not disappear by magic ;).

The varying number of tests may be due pytest-xdist giving up after a certain number of processes have crashed, with different limits depending on number of processes. Could you try the following variants:

  • Add --boxed as a flag for pytest. That should, if I understand the documentation right, insulate various tests even better.
  • Add --max-worker-restart=1000 (some value larger than the total number of Python tests we have).

Would you be able to join us for the Open NEST Developer Video Conference this Monday, 13 Sep, 11.30 CEST to discuss how to proceed on this issue?

@niltonlk
Copy link
Contributor

niltonlk commented Sep 9, 2021

--boxed seems to be a backward compatibility alias for pytest-forked --forked

I have tried with --boxed --max-worker-restart=1000 as you suggested, in both non-MPI and MPI pytest.
However, it resulted in even fewer executed tests (--numprocesses=auto case):
I used the --numprocesses=auto case as I believe it is intended for when multiple processes are used.

----------------------------------------------------------------------
NEST Testsuite Results
----------------------------------------------------------------------
Phase                    Tests   Skipped  Failures    Errors      Time
----------------------------------------------------------------------
01 basetests                 6         0         0         0       6.0
02 selftests                 8         4         0         0       8.0
03 unittests               179         1         0         0     365.0
04 regressiontests          94         6         0         0     121.0
05 mpitests                 81         0         5         0     309.0
07 pynesttests               0         0         0         0       0.5
07 pynesttests nc            1         1         0         0       0.9
08 cpptests                 30         0         0         3       0.0
----------------------------------------------------------------------
Total                      399        12         5         3     810.5
----------------------------------------------------------------------

THE NEST TESTSUITE DISCOVERED PROBLEMS
    The following tests failed
    | mpitests.test_get_nodes.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_source.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_target.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_source_driven.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_target_driven.sli
    | test_blockvector.test_operator_mm
    | test_blockvector.test_operator_eq
    | test_blockvector.test_operator_neq

    Please report test failures by creating an issue at
        https://github.com/nest/nest_simulator/issues

----------------------------------------------------------------------

installcheck.log

About the Open NEST Developer Video Conference I will participate!

@niltonlk
Copy link
Contributor

niltonlk commented Sep 12, 2021

I found where it was trying to access an empty vector. It was in:

diff --git a/pynest/pynestkernel.pyx b/pynest/pynestkernel.pyx
index 6ebe8f811..4a3b13ab5 100644
--- a/pynest/pynestkernel.pyx
+++ b/pynest/pynestkernel.pyx
@@ -620,7 +620,8 @@ cdef inline object sli_vector_to_object(sli_vector_ptr_t dat, vector_value_t _ =
     else:
         raise NESTErrors.PyNESTError("unsupported specialization")
 
-    memcpy(array_data, &vector_ptr.front(), vector_ptr.size() * sizeof(vector_value_t))
+    if vector_ptr.size() > 0:
+        memcpy(array_data, &vector_ptr.front(), vector_ptr.size() * sizeof(vector_value_t))
 
     if HAVE_NUMPY:
         if vector_ptr.size() > 0:

Which I just changed to execute the memcpy if vector_ptr points to a non-empy vector (i.e. size() > 0).

This time I made sure that the correct flag (-D_GLIBCXX_ASSERTIONS) was used. Installcheck output is as follow:

----------------------------------------------------------------------
NEST Testsuite Results
----------------------------------------------------------------------
Phase                    Tests   Skipped  Failures    Errors      Time
----------------------------------------------------------------------
01 basetests                 6         0         0         0       6.0
02 selftests                 8         4         0         0       8.0
03 unittests               179         1         0         0     365.0
04 regressiontests          94         6         0         0     120.0
05 mpitests                 81         0         5         0     315.0
07 pynesttests             663         6         2         0     172.6
07 pynesttests mpi 4         1         0         0         0       1.4
07 pynesttests nc            1         1         0         0       0.9
08 cpptests                 30         0         0         3       0.0
----------------------------------------------------------------------
Total                     1063        18         7         3     988.9
----------------------------------------------------------------------

THE NEST TESTSUITE DISCOVERED PROBLEMS
    The following tests failed
    | mpitests.test_get_nodes.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_source.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_target.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_source_driven.sli
    | mpitests.topo_mpi_test_free_pg_to_layer_target_driven.sli
    | test_erfc_neuron.ErfcNeuronTheoryTestCase.test_activation_function
    | test_regression_issue-1409.MultiplePoissonGeneratorsTestCase.test_multiple_poisson_generators
    | test_blockvector.test_operator_mm
    | test_blockvector.test_operator_eq
    | test_blockvector.test_operator_neq

    Please report test failures by creating an issue at
        https://github.com/nest/nest_simulator/issues

----------------------------------------------------------------------

installcheck.log

It seems that all non-mpi pynesttests were recovered with 2 of them (test_erfc_neuron.py and test_regression_issue-1409.py) failing due to timeout. Executing them independetly passes.

$ python -m pytest --verbose --numprocesses=auto --timeout=120 /opt/lib/gcc/nest/fix_2101/share/nest/testsuite/pytests/test_erfc_neuron.py 
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.9.7, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /opt/lib/gcc/nest/fix_2101/share/nest/testsuite/pytests
plugins: forked-1.3.0, xdist-2.2.0, timeout-1.4.2
timeout: 120.0s
timeout method: signal
timeout func_only: False
[gw0] linux Python 3.9.7 cwd: /home/nilton/Workspace/nest/recording_demo
[gw1] linux Python 3.9.7 cwd: /home/nilton/Workspace/nest/recording_demo
[gw2] linux Python 3.9.7 cwd: /home/nilton/Workspace/nest/recording_demo
[gw3] linux Python 3.9.7 cwd: /home/nilton/Workspace/nest/recording_demo
[gw0] Python 3.9.7 (default, Aug 30 2021, 00:00:00)  -- [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[gw1] Python 3.9.7 (default, Aug 30 2021, 00:00:00)  -- [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[gw2] Python 3.9.7 (default, Aug 30 2021, 00:00:00)  -- [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[gw3] Python 3.9.7 (default, Aug 30 2021, 00:00:00)  -- [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
gw0 [1] / gw1 [1] / gw2 [1] / gw3 [1]
scheduling tests via LoadScheduling

../../../../../opt/lib/gcc/nest/fix_2101/share/nest/testsuite/pytests/test_erfc_neuron.py::ErfcNeuronTheoryTestCase::test_activation_function 
[gw0] [100%] PASSED ../../../../../opt/lib/gcc/nest/fix_2101/share/nest/testsuite/pytests/test_erfc_neuron.py::ErfcNeuronTheoryTestCase::test_activation_function 

===================================================================================== 1 passed in 32.52s =====================================================================================
$ python -m pytest --verbose --numprocesses=auto --timeout=120 /opt/lib/gcc/nest/fix_2101/share/nest/testsuite/pytests/test_regression_issue-1409.py 
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.9.7, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /opt/lib/gcc/nest/fix_2101/share/nest/testsuite/pytests
plugins: forked-1.3.0, xdist-2.2.0, timeout-1.4.2
timeout: 120.0s
timeout method: signal
timeout func_only: False
[gw0] linux Python 3.9.7 cwd: /home/nilton/Workspace/nest/recording_demo
[gw1] linux Python 3.9.7 cwd: /home/nilton/Workspace/nest/recording_demo
[gw2] linux Python 3.9.7 cwd: /home/nilton/Workspace/nest/recording_demo
[gw3] linux Python 3.9.7 cwd: /home/nilton/Workspace/nest/recording_demo
[gw0] Python 3.9.7 (default, Aug 30 2021, 00:00:00)  -- [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[gw1] Python 3.9.7 (default, Aug 30 2021, 00:00:00)  -- [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[gw2] Python 3.9.7 (default, Aug 30 2021, 00:00:00)  -- [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[gw3] Python 3.9.7 (default, Aug 30 2021, 00:00:00)  -- [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
gw0 [1] / gw1 [1] / gw2 [1] / gw3 [1]
scheduling tests via LoadScheduling

../../../../../opt/lib/gcc/nest/fix_2101/share/nest/testsuite/pytests/test_regression_issue-1409.py::MultiplePoissonGeneratorsTestCase::test_multiple_poisson_generators 
[gw0] [100%] PASSED ../../../../../opt/lib/gcc/nest/fix_2101/share/nest/testsuite/pytests/test_regression_issue-1409.py::MultiplePoissonGeneratorsTestCase::test_multiple_poisson_generators 

===================================================================================== 1 passed in 4.33s ======================================================================================

However, none of the mpi 2 pynesttests were recovered.

In addition, the two examples (recording_demo.py and balancedneuron.py) that were reported to fail, now passes with this last modification. I hope to discuss about this on tomorrows Open NEST Developer meeting before commiting the chages.

@hakonsbm
Copy link
Contributor

Fixed by #2159, #2162, and #2169.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: High Should be handled next T: Bug Wrong statements in the code or documentation
Projects
Status: Done
Status: Done
Development

No branches or pull requests

5 participants