Skip to content

Make our Threads:: pthreads backend respect grainsize, make grainsize runtime-configurable#4476

Open
roystgnr wants to merge 6 commits into
libMesh:develfrom
roystgnr:pthreads_grainsize
Open

Make our Threads:: pthreads backend respect grainsize, make grainsize runtime-configurable#4476
roystgnr wants to merge 6 commits into
libMesh:develfrom
roystgnr:pthreads_grainsize

Conversation

@roystgnr
Copy link
Copy Markdown
Member

@roystgnr roystgnr commented Jun 3, 2026

This doesn't yet fix the MOOSE performance issues I was expecting it to, but I think it's either a step towards that or a worthwhile change on its own.

roystgnr added 6 commits June 3, 2026 17:22
Having the magic number 1000 everywhere was poor form.
I'm probably not going to make this controllable (which would require an
additional member variable that I'm only 99% sure would be optimized
out) until/unless people start reporting real performance gains from
per-loop grain size tweaking.
@roystgnr
Copy link
Copy Markdown
Member Author

roystgnr commented Jun 4, 2026

Oh, now I'm starting to understand. The reason MOOSE doesn't speed up is that it's got a hardcoded GRAIN_SIZE = 1 in its main ranges ... and also MOOSE has a whole ThreadedGeneralUserObject system that had the same "assume there's no grainsize" bug our recent unit tests did. I was going to talk some smack about the Abaqus plugin there for making bad assumptions, but it turned out to be a framework bug that only the Abaqus interface triggered, with proper test coverage and a semi-helpful error message to boot.

@roystgnr
Copy link
Copy Markdown
Member Author

roystgnr commented Jun 4, 2026

Even with the GRAIN_SIZE thing fixed I'm not seeing nearly as much speedup as I should, though. Still looking into that.

@moosebuild
Copy link
Copy Markdown

Job Coverage, step Generate coverage on 4beb677 wanted to post the following:

Coverage

a68cc6 #4476 4beb67
Total Total +/- New
Rate 65.61% 65.59% -0.02% 100.00%
Hits 78621 78598 -23 6
Misses 41209 41238 +29 0

Diff coverage report

Full coverage report

This comment will be updated on new commits.

@roystgnr
Copy link
Copy Markdown
Member Author

roystgnr commented Jun 4, 2026

Still looking into that.

I found another MOOSE bug that explains most or all of it, and that suggests other downstream issues which could explain the rest.

The changes here should be good, though I'll want to wait to re-run CI on a post- idaholab/moose#33049 MOOSE before we merge.

@moosebuild
Copy link
Copy Markdown

Job Test MOOSE ARM mac on 4beb677 : invalidated by @loganharbour

re-run after idaholab/moose#33049

@moosebuild
Copy link
Copy Markdown

Job Test MOOSE modules debug on 4beb677 : invalidated by @loganharbour

re-run after idaholab/moose#33049

@moosebuild
Copy link
Copy Markdown

Job Test MOOSE GCC min on 4beb677 : invalidated by @loganharbour

re-run after idaholab/moose#33049

@moosebuild
Copy link
Copy Markdown

Job Test MOOSE clang on 4beb677 : invalidated by @loganharbour

re-run after idaholab/moose#33049

@moosebuild
Copy link
Copy Markdown

Job Test MOOSE conda on 4beb677 : invalidated by @loganharbour

re-run after idaholab/moose#33049

@moosebuild
Copy link
Copy Markdown

Job Test MOOSE modules on 4beb677 : invalidated by @loganharbour

re-run after idaholab/moose#33049

@moosebuild
Copy link
Copy Markdown

Job Test MOOSE debug on 4beb677 : invalidated by @loganharbour

re-run after idaholab/moose#33049

@moosebuild
Copy link
Copy Markdown

Job Test MOOSE recover and restep on 4beb677 : invalidated by @loganharbour

re-run after idaholab/moose#33049

@moosebuild
Copy link
Copy Markdown

Job Test MOOSE on 4beb677 : invalidated by @loganharbour

re-run after idaholab/moose#33049

@moosebuild
Copy link
Copy Markdown

Job Test MOOSE LibTorch on 4beb677 : invalidated by @loganharbour

re-run after idaholab/moose#33049

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.

2 participants