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

NRNMPI_DYNAMIC_INCLUDE_FILEs are located in PROJECT_BINARY_DIR... #3347

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

nrnhines
Copy link
Member

The intention is to fix an apparent race during a parallel build. ie.

Generating src/nrnmpi/nrnmpi_dynam.h, src/nrnmpi/nrnmpi_dynam_cinc, src/nrnmpi/nrnmpi_dynam_wrappers.inc
In file included from src/nrnmpi/nrnmpi.cpp:11:
build/temp.macosx-10.9-x86_64-cpython-311/src/nrnmpi/nrnmpi_dynam.h:6:2: error: unterminated conditional directive
#if NRNMPI_DYNAMICLOAD
 ^
build/temp.macosx-10.9-x86_64-cpython-311/src/nrnmpi/nrnmpi_dynam.h:2:2: error: unterminated conditional directive
#ifndef nrnmpi_dynam_h
 ^

Under the assumption that the issue is related to mkdynam.sh OUTPUT files being created but taking some time being completed, I tested by adding this fragment near the beginning of mkdynam.sh

+touch "${NRNMPI_OUTPUT_PATH}/nrnmpi_dynam_wrappers.inc"
+touch "${NRNMPI_OUTPUT_PATH}/nrnmpi_dynam.h"
+touch "${NRNMPI_OUTPUT_PATH}/nrnmpi_dynam_cinc"
+sleep 20

and then the rest of mkdynam.sh appending to those files. A clean build with make -j 8 did exhibit the problem, though my one attempt with ninja was a success.

$ cmake .. -DCMAKE_INSTALL_PREFIX=install -DNRN_ENABLE_MPI_DYNAMIC=ON -DNRN_ENABLE_PYTHON_DYNAMIC=ON
$ make -j 8
[ 97%] Generating /home/hines/neuron/temp2/src/nrnmpi/nrnmpi_dynam.h, /home/hines/neuron/temp2/src/nrnmpi/nrnmpi_dynam_cinc, /home/hines/neuron/temp2/src/nrnmpi/nrnmpi_dynam_wrappers.inc
[ 98%] Building CXX object src/nrniv/CMakeFiles/nrniv_lib.dir/__/nrnmpi/nrnmpi_dynam.cpp.o
In file included from /home/hines/neuron/temp2/src/nrnmpi/nrnmpi_dynam.cpp:39:
/home/hines/neuron/temp2/build/src/nrnmpi/nrnmpi_dynam_cinc:173:21: error: redefinition of ‘bbsmpibuf* (* p_nrnmpi_newbuf)(int)’
  173 | static bbsmpibuf* (*p_nrnmpi_newbuf)(int size);
      |                     ^~~~~~~~~~~~~~~

With this PR fix, both ninja and make -j 8 succeed with the test version of mkdynam.sh

@nrnhines nrnhines requested a review from JCGoran March 13, 2025 17:35
Copy link
Collaborator

@JCGoran JCGoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! The CI failure looks unrelated to this change (I think we're hitting pypa/pip#11153 again), just re-run it once the other Azure jobs finish and it should be good.

Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.31%. Comparing base (e0cbb32) to head (b26adc8).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3347   +/-   ##
=======================================
  Coverage   68.31%   68.31%           
=======================================
  Files         682      682           
  Lines      116435   116435           
=======================================
  Hits        79541    79541           
  Misses      36894    36894           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

✔️ b26adc8 -> Azure artifacts URL

@nrnhines nrnhines merged commit afd88c2 into master Mar 13, 2025
38 checks passed
@nrnhines nrnhines deleted the hines/nrnmpi-dynam-bld-race branch March 13, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants