Skip to content

Switch to atomics for tracking initialization#3696

Merged
rhc54 merged 1 commit intoopenpmix:masterfrom
rhc54:topic/atm
Oct 17, 2025
Merged

Switch to atomics for tracking initialization#3696
rhc54 merged 1 commit intoopenpmix:masterfrom
rhc54:topic/atm

Conversation

@rhc54
Copy link
Contributor

@rhc54 rhc54 commented Oct 11, 2025

Rather than using mutex and condition variables, let's just use atomics for tracking if the library has been initialized, and which init entry point was used. Check for and reject attempts to call multiple mismatched entry points.

First stage in a multi-stage process.

@rhc54
Copy link
Contributor Author

rhc54 commented Oct 12, 2025

@hppritcha I'm getting this in the CI:

Run python test/main.py -v -x test_doc
  python test/main.py -v -x test_doc
  shell: /usr/bin/bash -e {0}
  env:
    MPI4PY_TEST_SPAWN: true
    pythonLocation: /opt/hostedtoolcache/Python/3.13.7/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.13.7/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.7/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.7/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.7/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.7/x64/lib
--------------------------------------------------------------------------
It looks like MPI_INIT failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during MPI_INIT; some of which are due to configuration or environment
problems.  This failure appears to be an internal failure; here's some
additional information (which may only be relevant to an Open MPI
developer):

  mca_pml_base_select() failed
  --> Returned "Attempt to redefine an existing data type" (-31) instead of "Success" (0)

Is this something new on your side?? I cannot imagine what I would have done to cause it.

@rhc54
Copy link
Contributor Author

rhc54 commented Oct 12, 2025

Looks like it is something to do with the changes in singleton init made here - just a really odd error message to result from whatever it is behind it.

Rather than using mutex and condition variables, let's just use
atomics for tracking if the library has been initialized.

Remove all references to pmix_global_lock
Move away from the concept of a global lock in the library.

Convert all "connected" flags to atomic

Avoid calling PMIx APIs from within the initialization procedures
We don't want to enable API use until the library is fully
initialized.

Fix stop-in-init integration

Fix fence_nb to handle singleton

Signed-off-by: Ralph Castain <rhc@pmix.org>
@rhc54 rhc54 merged commit 56b3b87 into openpmix:master Oct 17, 2025
26 checks passed
@rhc54 rhc54 deleted the topic/atm branch October 17, 2025 11:50
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.

1 participant