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

aio: enable -O3 optimization #1249

Merged
merged 2 commits into from
Jul 26, 2021
Merged

aio: enable -O3 optimization #1249

merged 2 commits into from
Jul 26, 2021

Conversation

adammoody
Copy link
Contributor

This updates the aio op to build with -O3 rather than -O0 optimization.

It looks like all ops either build with -O2 or -O3, but aio uses -O0 for some reason. Is that intentional?

@tjruwase
Copy link
Contributor

@adammoody, aio op is IO-bound and thus gets little benefit from compiler optimizations. So we choose -O0 for better debugging experience.

@adammoody
Copy link
Contributor Author

Ok, thanks. I had noticed that some of aio includes some SIMD code like here:

SIMD_STORE(dest + i, src_4[0].data);
SIMD_STORE(dest + i + SIMD_WIDTH, src_4[1].data);
SIMD_STORE(dest + i + (SIMD_WIDTH << 1), src_4[2].data);

On PowerPC, those SIMD-tuned algorithms aren't available, so it falls back to the non-vectorized copy method here:

if (param_size > rounded_size) {
#pragma omp parallel for
for (size_t k = rounded_size; k < param_size; k++) { dest[k] = src[k]; }
}

I thought the compiler might help in that case, and that maybe that would be useful since someone took the time to create the SIMD versions.

I do understand performance being bound by much slower I/O, though.

Mind if I replace this PR with one that adds a comment to note why -O0 is used?

@tjruwase
Copy link
Contributor

Ok, thanks. I had noticed that some of aio includes some SIMD code like here:

Yes, you are correct. That was a failed attempt to create fast copy routines, but was abandoned due to poor progress. The routines are currently not used, and these codes should be ideally be deleted. Sorry for the confusion.

@tjruwase
Copy link
Contributor

Mind if I replace this PR with one that adds a comment to note why -O0 is used?

Thanks, that would be very much appreciated.

@tjruwase tjruwase merged commit 10cc2c9 into microsoft:master Jul 26, 2021
@adammoody adammoody deleted the optaio branch December 18, 2023 04:28
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