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

Example heat-equation #978

Merged
merged 5 commits into from
May 11, 2020
Merged

Conversation

jkrude
Copy link
Contributor

@jkrude jkrude commented Apr 15, 2020

Alpaka implementation of solving the heat-equation based on a CPU version from @sbastrakov.

@BenjaminW3
Copy link
Member

clang as a CUDA compier complains about:

heatEquation.cpp:203:28: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
        auto const error = abs( pNextHost[ i ] - exactSolution( i * dx, tMax ) );

Copy link
Member

@psychocoderHPC psychocoderHPC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for this new example

example/heatEquation/src/heatEquation.cpp Outdated Show resolved Hide resolved
example/heatEquation/src/heatEquation.cpp Outdated Show resolved Hide resolved
example/heatEquation/src/heatEquation.cpp Outdated Show resolved Hide resolved
}
std::cout << "Max error to the exact solution at t = tMax: " << maxError << "\n";

return EXIT_SUCCESS;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we return EXIT_FAILURE if the error is to large. Not sure to large for this example is but we should set it based on a test run on different hardware.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, we should add a check and report whether the test passed or failed. I will find the appropriate tolerance for this check (this is not immediately obvious). Output of error itself was useful during the development, but not good for testing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbastrakov You can keep the output, I saw it also in many CUDA examples.
Never the less could you please provide the PR with a approximately error range checking.

@psychocoderHPC
Copy link
Member

Please also rebase against #979

@psychocoderHPC
Copy link
Member

@jkrude The curent issue is a heap buffer overflow.
https://travis-ci.com/github/alpaka-group/alpaka/jobs/321991946#L2496-L2515

Copy link
Member

@psychocoderHPC psychocoderHPC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the bug is here

example/heatEquation/src/heatEquation.cpp Outdated Show resolved Hide resolved
- applied code style guide
@psychocoderHPC
Copy link
Member

I will merge this PR as it is the error margin validation can be pushed as separate PR.

@psychocoderHPC psychocoderHPC merged commit d4e2ed2 into alpaka-group:develop May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants