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

Omit the number 4 from the make -sj4 recommendation #5473

Closed
AlbertVeli opened this issue May 9, 2024 · 5 comments
Closed

Omit the number 4 from the make -sj4 recommendation #5473

AlbertVeli opened this issue May 9, 2024 · 5 comments

Comments

@AlbertVeli
Copy link
Contributor

When configuring john it finishes with:

Configure finished. Now "make -s clean && make -sj4" to compile.

But make -sj should, according to the documentation, automatically try to use as many jobs as possible, based on the number of available CPU cores. I tried it on macOS Ventura with 4 cores and on a Ubuntu 22.04 machine with 12 cores while running htop and it does indeed utilise all CPU cores on both machines when the number after j is omitted.

@solardiz
Copy link
Member

solardiz commented May 9, 2024

Hi. It is news to me if/that -j detects the actual number of CPUs. That wasn't the case - it would run as many jobs as the Makefile's parallelism allows, so would overwhelm smaller systems. Even if it's better now, I guess that's not universal across platforms and older versions of make are still in use. So we either make no changes or add our own detection of CPU count to include that number in the suggested command.

@solardiz
Copy link
Member

But make -sj should, according to the documentation, automatically try to use as many jobs as possible, based on the number of available CPU cores.

I don't see the "based on the number of available CPU cores" part in the documentation. Where is that?

add our own detection of CPU count to include that number in the suggested command.

Do you want to implement this, @AlbertVeli?

@AlbertVeli
Copy link
Contributor Author

But make -sj should, according to the documentation, automatically try to use as many jobs as possible, based on the number of available CPU cores.

I don't see the "based on the number of available CPU cores" part in the documentation. Where is that?

It was actually an assumption based on how it seemed to work. I should have checked before.

add our own detection of CPU count to include that number in the suggested command.

Do you want to implement this, @AlbertVeli?

I can give it a try and see if it succeeds.

@AlbertVeli
Copy link
Contributor Author

AlbertVeli commented May 14, 2024

One easy way would be to call ncores, from coreutils. It is not guaranteed to be installed everywhere though. But ncores if installed, else a default value of 4. What do you think of that?

Edit. The tool from coreutils is called nproc, not ncores.

@solardiz solardiz removed the WONTFIX label May 16, 2024
@solardiz
Copy link
Member

We ended up going with "add our own detection of CPU count to include that number in the suggested command". So we can close this issue as completed, in that sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants