Skip to content

v5.0.x: gcc 14 and clang 18 compiler warning fixes #12789

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

Merged

Conversation

jsquyres
Copy link
Member

@jsquyres jsquyres commented Sep 2, 2024

This is a partial cherry pick from main PR #12743 (only 4 out of the 9 commits from #12743 apply to the v5.0.x branch).

See individual commit messages for details.

jsquyres and others added 4 commits September 2, 2024 15:45
Add missing "void" in declaration.  I'm amazed that this survived so
long.

Signed-off-by: Jeff Squyres <[email protected]>
(cherry picked from commit d76dfdc)
Without this check, gcc 14's static analyzer emits a warning about
possible out-of-bounds array subscripts.

Signed-off-by: Jeff Squyres <[email protected]>
(cherry picked from commit 35f4a6d)
1. Guarantee that strings are \0 by using opal_string_copy()
2. Ensure that a temporary string buffer is long enough to hold odd
   sprintf values for "%3d" (e.g., error values)

Without these changes, gcc 14's static analyzer emitted warnings.

Signed-off-by: Jeff Squyres <[email protected]>
(cherry picked from commit a601c9a)
Without this fix, gcc 14's static analyzer complains about the
signedness of some comparisons.

Signed-off-by: Matthew G. F. Dosanjh <[email protected]>
Signed-off-by: Jeff Squyres <[email protected]>
(cherry picked from commit 6e81b00)
@github-actions github-actions bot added this to the v5.0.6 milestone Sep 2, 2024
@wenduwan wenduwan self-requested a review September 3, 2024 14:03
@wenduwan
Copy link
Contributor

wenduwan commented Sep 3, 2024

CI failure is runtime related.

Run mpiexec -n 3 python test/main.py -v -f
--------------------------------------------------------------------------
There are not enough slots available in the system to satisfy the 3
slots that were requested by the application:

  python

Either request fewer procs for your application, or make more slots
available for use.

A "slot" is the PRRTE term for an allocatable unit where we can
launch a process.  The number of slots available are defined by the
environment in which PRRTE processes are run:

  1. Hostfile, via "slots=N" clauses (N defaults to number of
     processor cores if not provided)
  2. The --host command line parameter, via a ":N" suffix on the
     hostname (N defaults to 1 if not provided)
  3. Resource manager (e.g., SLURM, PBS/Torque, LSF, etc.)
  4. If none of a hostfile, the --host command line parameter, or an
     RM is present, PRRTE defaults to the number of processor cores

In all the above cases, if you want PRRTE to default to the number
of hardware threads instead of the number of processor cores, use the
--use-hwthread-cpus option.

Alternatively, you can use the --map-by :OVERSUBSCRIBE option to ignore the
number of available slots when deciding the number of processes to
launch.
--------------------------------------------------------------------------

@wenduwan wenduwan merged commit 3bec944 into open-mpi:v5.0.x Sep 5, 2024
14 of 15 checks passed
@jsquyres jsquyres deleted the pr/v5.0.x/gcc-14-complier-warning-fixes branch September 6, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants