Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

cmake: use nproc if _num_cores is zero #259

Merged

Conversation

tserong
Copy link
Member

@tserong tserong commented Nov 24, 2023

The previous workaround set _num_cores to 1 if cmake thought NUMBER_OF_LOGICAL_CORES was zero. That worked fine, but it'd be much better to take advantage of all possible cores. This version runs nproc which seems to work just fine under qemu-aarch64 and gives us the actual number of CPUs.

Fixes: b666926

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

Copy link
Member

@jecluis jecluis left a comment

Choose a reason for hiding this comment

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

I'm assuming it works as it looks like it should, so lgtm

@jecluis jecluis added this to the v0.24.0 milestone Nov 24, 2023
@jecluis jecluis added kind/enhancement Change that positively impacts existing code area/rgw-sfs RGW & SFS related labels Nov 24, 2023
@tserong
Copy link
Member Author

tserong commented Nov 24, 2023

I'm assuming it works as it looks like it should, so lgtm

Yeah, it's presently running on my 8 core desktop and seems to be actually using up to 6 of those cores at a time, rather than the previous 1.

The previous workaround set _num_cores to 1 if cmake thought
NUMBER_OF_LOGICAL_CORES was zero.  That worked fine, but it'd
be much better to take advantage of all possible cores.  This
version runs `nproc` which seems to work just fine under
qemu-aarch64 and gives us the actual number of CPUs.

Fixes: b666926
Signed-off-by: Tim Serong <[email protected]>
@tserong tserong force-pushed the wip-better-workaround-qemu-zero-cpu-cores branch from b204f06 to d20b0f7 Compare November 24, 2023 11:27
@tserong
Copy link
Member Author

tserong commented Nov 24, 2023

(oops, commit wasn't signed)

@tserong tserong merged commit e4170a9 into aquarist-labs:s3gw Nov 26, 2023
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/rgw-sfs RGW & SFS related kind/enhancement Change that positively impacts existing code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants