-
Notifications
You must be signed in to change notification settings - Fork 116
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
Dg assembly through templating #124
base: main
Are you sure you want to change the base?
Conversation
Clean up for intel. Fixes for GCC 4.6
…ugfixes. A few more c macros.
@@ -0,0 +1,356 @@ | |||
#include "fdebug.h" | |||
#undef ASSERT |
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.
Why are we redefining ASSERT here?
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 standard assert function uses the Fortran continuation operator, //, which the c preprocessor then sees as a c-style comment and strips from the the processed template file. There may be a way to prevent this at the command line but I couldn’t find a version which worked.
On 12 Jul 2016, at 17:18, Stephan Kramer [email protected] wrote:
In assemble/Construct_Momentum_Element_DG.F90:
@@ -0,0 +1,356 @@
+#include "fdebug.h"
+#undef ASSERTWhy are we redefining ASSERT here?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
cf897aa
to
55c5836
Compare
I think I've resolved the last batch of review, and have built successfully on intel and Ubuntu. Is there anything further, and could this have a buildbot queue please? |
Ok, some more review: Momentum_DG.F90 (the diff is too large so I can't make inline comments):
|
end if | ||
#ifdef GENERIC | ||
if(move_mesh) then | ||
!// In the declarations above we've assumed these |
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.
What's with the extra // comment markers that have been added here?
Finally, I'd like some more discussion on the names for the macro-ed functions. They're currently a bit inconsistent, e.g. NLOC_X vs P_FLOC. And names like NLOC are a bit fluidity-old-style to me, and not immediately obvious to people that are only familiar with the femtools interface. Also we should be a bit more consistent with what is assumed, e.g. we have:
which means that all cases we use FLOC we assume it is velocity, but for NLOC we use it on both U and source so that in the generic case we can have source%mesh and U%mesh be different, but not for the specialized cases. Note that we also have NLOC(q_mesh, ele) which I think breaks some cases since q_mesh is the viscosity mesh and we don't check that q_mesh==U%mesh in the momentum_element_selector. May I suggest a naming scheme like: ELE_LOC_U, FACE_LOC_P, etc.? Then we should probably be consistent and always keep the variable name, i.e. have
Alternatively, we get rid of the variable altogether and have:
This seems to be the most robust choice as it makes all assumptions explicit. |
This pull request implements some of @anguscr's modifications to the dg assembly code. These use the preprocessor and code templating to provide versions of the assembly routines matching commonly used option choices which have prior knowledge of the size of small arrays, This allows for more efficient memory allocation and more aggressive compiler optimisations.