Skip to content

Conversation

@wkliao
Copy link
Collaborator

@wkliao wkliao commented Oct 3, 2025

This PR should fix the second part of #1077 (Segmentation fault at the run time).

The same compilation problem happens to 3.4.7 release when Darshan is configured
with options --enable-apmpi-mod and --enable-apmpi-coll-sync.

  1. Add CI tests to test configure options of --enable-apmpi-mod and --enable-apmpi-coll-sync

  2. Patch darshan-apmpi.c to fix variable redefinition compilation errors.

    • Make __darshan_disabled a local variable.

    • Without this fix, the compile error messages shown below will appear.

      In file included from darshan-apmpi.c:18:
      darshan-apmpi.c: In function ‘__wrap_MPI_Barrier’:
      /home/runner/work/darshan/darshan/darshan-runtime/lib/darshan.h:227:9:
      error: redefinition of ‘__darshan_disabled’
      227 | int __darshan_disabled =
      darshan_core_disabled_instrumentation()
      | ^~~~~~~~~~~~~~~~~~
      darshan-apmpi.c:32:11: note: in expansion of macro ‘MAP_OR_FAIL’
      32 | MAP_OR_FAIL(PMPI_Barrier);
      | ^~~~~~~~~~~
      darshan-apmpi.c:1389:5: note: in expansion of macro ‘TIME_SYNC’
      1389 | TIME_SYNC(__real_PMPI_Barrier(comm));
      | ^~~~~~~~~

wkliao added 2 commits October 3, 2025 12:06
* Make __darshan_disabled a local variable.
* Without this fix, the compile error messages shown below will appear.

  In file included from darshan-apmpi.c:18:
  darshan-apmpi.c: In function ‘__wrap_MPI_Barrier’:
  /home/runner/work/darshan/darshan/darshan-runtime/lib/darshan.h:227:9:
  error: redefinition of ‘__darshan_disabled’
    227 |     int __darshan_disabled =
  darshan_core_disabled_instrumentation()
        |         ^~~~~~~~~~~~~~~~~~
  darshan-apmpi.c:32:11: note: in expansion of macro ‘MAP_OR_FAIL’
     32 |           MAP_OR_FAIL(PMPI_Barrier);\
        |           ^~~~~~~~~~~
  darshan-apmpi.c:1389:5: note: in expansion of macro ‘TIME_SYNC’
   1389 |     TIME_SYNC(__real_PMPI_Barrier(comm));
        |     ^~~~~~~~~
@github-actions github-actions bot added the CI continuous integration label Oct 3, 2025
@wkliao wkliao requested review from carns and roblatham00 October 3, 2025 20:59
@wkliao wkliao added the bug Something isn't working label Oct 4, 2025
carns
carns previously approved these changes Oct 6, 2025
Copy link

@carns carns left a comment

Choose a reason for hiding this comment

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

Looks good. At first I was worried about how to tell if the patch needs to be applied or not (i.e., if the problem is fixed upstream in autoperf), but that's not a problem since the git submodule refers to a specific revision. We can remove the patch if the submodule is updated.

@wkliao
Copy link
Collaborator Author

wkliao commented Oct 6, 2025

Yes, once autoperf becomes a part of Darshan's repo, the patch of this PR can be removed.

@wkliao wkliao merged commit 68043bb into darshan-hpc:main Oct 8, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI continuous integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants