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

Infinite loop if core pinning fails #103

Open
IagoAbal opened this issue Jul 1, 2021 · 1 comment · May be fixed by #104
Open

Infinite loop if core pinning fails #103

IagoAbal opened this issue Jul 1, 2021 · 1 comment · May be fixed by #104

Comments

@IagoAbal
Copy link

IagoAbal commented Jul 1, 2021

Core pinning does not always work on Apple M1 and as a result Parmap enters an infinite loop. See semgrep/semgrep#2432 and facebook/infer#1410. We at @returntocorp have only observed this behavior with HomeBrew builds, presumably because in HomeBrew's build environment HAVE_MACH_THREAD_POLICY_H is set? Even then, this only occurs under certain values of ncores and chunksize. So running on 8 files using 8 cores and chunk size of 1 works, but if there are 9 files it hangs. Running on 9 files with 4 cores and a chunk size of 2 it does not hang.

Our current work around is to simply disable core pinning.

Independently of why core pinning is failing in this case, could it make sense to change while (finished==0) { ... } to do { ... } while (finished==0 && w>0) or bound the number of iterations of that loop in some other way ? I am happy to open a PR if we agree on this.

@UnixJunkie
Copy link
Collaborator

This file could also benefit from a complete rewrite.
A 100% Linux part, another 100% Mac OS X part.
Then just including the right one.

You can already send your PR I think.

IagoAbal added a commit to IagoAbal/parmap that referenced this issue Jul 5, 2021
This is known to happen, under some circumstances, on Apple M1.

Plus code cleanup.

Closes rdicosmo#103
@IagoAbal IagoAbal linked a pull request Jul 5, 2021 that will close this issue
IagoAbal added a commit to IagoAbal/parmap that referenced this issue Jul 5, 2021
This is known to happen, under some circumstances, on Apple M1.

Plus code cleanup.

Closes rdicosmo#103
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 a pull request may close this issue.

2 participants