Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Different results with and without OpenMP threads #154

Open
iomaganaris opened this issue Mar 15, 2019 · 4 comments
Open

Different results with and without OpenMP threads #154

iomaganaris opened this issue Mar 15, 2019 · 4 comments

Comments

@iomaganaris
Copy link
Contributor

Tests from testcorenrn repository that simulate more than 1 cell produce different outputs from Neuron when run with CoreNeuron with SoA configuration and more than 1 OpenMP thread.
CoreNeuron was built using the following CMake options:

cmake \
   -G 'Unix Makefiles' \
   -DCMAKE_INSTALL_PREFIX=./install \
   -DCMAKE_BUILD_TYPE=Debug \
   -DCMAKE_C_FLAGS:STRING="-O0" \
   -DCMAKE_CXX_FLAGS:STRING="-O0" \
   -DENABLE_SOA=ON \
   -DCORENEURON_OPENMP=ON \
   -DTEST_MPI_EXEC_BIN="mpirun" \
   -DTEST_EXEC_PREFIX="mpirun;-n;2" \
   -DAUTO_TEST_WITH_SLURM=OFF \
   -DAUTO_TEST_WITH_MPIEXEC=OFF \
   .. /

To run a test (for example "watch" which produces different output):

git clone [email protected]:pramodk/testcorenrn.git
cd testcorenrn
nrnivmodl mod
nrnivmodl-core mod
mkdir testwatchdat
mpirun -n 6 ./x86_64/special -mpi -c sim_time=100 testwatch.hoc
cat out.dat | sort -k 1n,1n -k 2n,2n > out_nrn_watch.spk
export OMP_NUM_THREADS=1
mpirun -n 6 ./x86_64/special-core -mpi -d test${NAME}dat -e 100
diff -w -q out.dat out_nrn_watch.spk // Same results
export OMP_NUM_THREADS=2
mpirun -n 3 ./x86_64/special-core -mpi -d test${NAME}dat -e 100
diff -w -q out.dat out_nrn_watch.spk // Different results
iomaganaris added a commit that referenced this issue Mar 15, 2019
- Uses Jenkinsfile found in /tests/jenkins
- Builds AoS and SoA configuration of CoreNeuron
- Tests simple ringtest with both of them
- Clones master branch of https://github.com/pramodk/testcorenrn
  to load more tests
- Uses scripts found in /tests/jenkins directory to run all tests

- Added option to run unit and ring tests on GPUs if ENABLE_OPENACC
  is set
- Added pipeline stage for building CoreNeuron for GPU
- Added Jenkins pipeline stage for running built-in unit and ring
  tests in GPU

- Clones ringtest repository and runs ringtest with larger number
  of cells, to utilize more threads
- OpenMP is disabled in AoS build and enabled in SoA build
- SoA tests of testcorenrn use 1 OpenMP thread due to issue #154
@pramodk
Copy link
Collaborator

pramodk commented Jul 24, 2020

We have seen that nrn_setup phase2 has race conditions! look at global hash tables which are not protected by OMP critical section.

@pramodk pramodk added this to the NEURON v8.0 Release milestone Jul 24, 2020
@olupton
Copy link
Contributor

olupton commented Jun 29, 2021

@iomaganaris do you know if this is still an issue? I ran a quick test locally where I ran all testcorenrn tests with multiple threads as well as 1, and nothing failed.

I wonder if this was fixed with #283?

@iomaganaris
Copy link
Contributor Author

I am not sure whether this fixed the issue. I think it would be useful to run the test added in this PR #299 and see whether there is still an issue

@olupton
Copy link
Contributor

olupton commented Jun 30, 2021

OK, this, #292 and #299 all look related. I guess #299 should be updated to run in CTest/GitLab.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants