-
Notifications
You must be signed in to change notification settings - Fork 7
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
Better Multithreading #1
base: multithreaded
Are you sure you want to change the base?
Better Multithreading #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo the formatting changes
stylefix 1
stylefix 2
stylefix 3
stylefix 4
styling should be corrected now. |
compile error fixes
Removed unnecessary heap allocation
Unfortunately this may or may not be faster due to icache, testing is required to verify.
Minimal performance hit.
main.cu
Outdated
static auto threadFunc = [&](size_t start, size_t end) { | ||
for (int j = start; j < end; ++j) { | ||
if (generator::ChunkGenerator::populate(tempStorage[j], X_TRANSLATE + 16)) { | ||
std::lock_guard<std::mutex> lock(fileMutex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it's going to have a heck of a lot of mutex contention. Could the threads batch up their file writes?
Optimizations
Also, use the PRIu64 macro to fix the printf format debacle once and for all
[Major] Use wall clock time for progress reports
…t-pr Revert "Multithreading + file write optimizations"
stylefix 1
stylefix 2
stylefix 3
stylefix 4
compile error fixes
about 7% performance boost on my maschine.
The code styling got a bit fucked because of my settings.