-
Notifications
You must be signed in to change notification settings - Fork 246
Alignment pragma #63
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
Alignment pragma #63
Conversation
|
Probably Thoughs @mlange05 ? |
|
I think this belongs in Propagator. Also, I think the method could be made more generic. I would hold on to accepting this PR until the test comparing the |
|
but all the pragmas are set up and inside compiler.py and this is a pragma as well. |
|
It needs to be aware of the concepts of factors, loop counters and time steppers. All implementation choices in Propagator which might be changed very soon. Why introduce this unnecessary coupling between the two? Why does someone working on the compiler interface need to know what time steppers are? If I change how my factors are put into the stencil, why should the compiler interface need to be changed? If I change my loop variables, why should my compiler interface need to know about it? |
|
Ok, so the compiler is supposed to provide the "wording" of pragmas (due to toolchain-dependent variants of |
d008114 to
a28ae50
Compare
devito/propagator.py
Outdated
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.
is this equivalent to
for item in flatten(stencil.free_symbols for stencil in stencils):
if str(item) not in factorized and item not in loop_counters + time_steppers:
array_names.add(item)
6c53647 to
2b08fb3
Compare
2b08fb3 to
fac5075
Compare
|
I pushed a small change to make everything more pythonic (also fixes the docstring) |
devito/propagator.py
Outdated
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.
Was the pragma string not supposed to come from the Compiler?
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.
Should the alignment size (:64) really be hard-coded, or should this come from the respective Compiler ?
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.
Good catch. I think we talked about this before. Such constants should be determined programmatically using sysctlbyname: http://www.manpagez.com/man/3/sysctlbyname/
In the case of cache line size you are looking for hw.cachelinesize
However, and I believe @FabioLuporini raised this previously as well, we might instead want to align to page size in which case we should use hw.pagesize so we can reduce TBL misses. The amount of wasted memory is still small.
bad76a3 to
576e117
Compare
08d7c3c to
c849e50
Compare
devito/compiler.py
Outdated
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.
The use of %s without replacement value looks wrong. Can we move the (%s:%s) part of the string to the caller?
c849e50 to
02adc8d
Compare
d8ab447 to
65cdefa
Compare
…function in tools
65cdefa to
f1a963c
Compare
|
Looks good now. Merging... |
Added alignment pragma, which replaces ivdep pragma if running with OpenMP