Code Base Review FY24 #108
Replies: 13 comments 22 replies
-
Lines 13 to 15 in 45aab4d Probably worth getting started with spack on this project since the rest of the exawind suite is based around using spack. |
Beta Was this translation helpful? Give feedback.
-
openturbine/tests/unit_tests/gen_alpha_poc/test_quaternions.cpp Lines 219 to 234 in 45aab4d Pretty wide range of tolerances here. I am curious as to why, and if there are separate tolerances expected for single/double precision mode. I would suggest making all similar tolerances a variable, and using something like I suspect that really understanding and monitoring the tolerances for these basic math operations will be important for everything else going forward. |
Beta Was this translation helpful? Give feedback.
-
Low-level comment, initialization of views is sometimes a significant performance issue. openturbine/src/gen_alpha_poc/generalized_alpha_time_integrator.cpp Lines 143 to 147 in 45aab4d I think that Kokkos Views are zero-initialized by default, possibly meaning that the deep_copy with zero is un-necessary. In fact a common performance optimization (sometimes significant) is to make sure Kokkos::View doesn't initialize if you know that you will be writing into it (not += ) and don't care what the initial value is, such as here:openturbine/src/gen_alpha_poc/generalized_alpha_time_integrator.cpp Lines 201 to 202 in 45aab4d In this case you would declare the Kokkos::View with the Kokkos::WithoutInitializing argument to avoid the internal kernel that is launched to perform the initialization.
|
Beta Was this translation helpful? Give feedback.
-
Regarding passing 'raw' Kokkos::View types everywhere: openturbine/src/gen_alpha_poc/linearization_parameters.h Lines 14 to 18 in 45aab4d It's nice to see what the actual type is, but if performance optimizations or development leads to adding extra template parameters such as textured-memory (Kokkos::MemoryRandomAccess), or Atomic traits, then we may wish for central typedefs so that changes can be minimized. (These kinds of changes would manifest as extra template parameters in the Kokkos::View type.) |
Beta Was this translation helpful? Give feedback.
-
minor comment: should arguments be named in header declarations? openturbine/src/gen_alpha_poc/time_integrator.h Lines 21 to 22 in 45aab4d I don't know what the second argument is (size_t) unless I go find an override of this method in a derived class. It turns out (e.g. in generalized_alpha_time_integrator.cpp) that the size_t argument is n_constraints .
In general: the compiler doesn't require argument names for declarations, only types. I like argument names, although I recognize there is a "don't repeat yourself" viewpoint which says to only name the arguments in the cpp file where it is needed. I would suggest to just be consistent with the chosen style. There are 3 possible styles:
I've seen all 3 of these styles in the Open Turbine code base. |
Beta Was this translation helpful? Give feedback.
-
The large number of unit tests is great, this is a nice artifact of doing test driven development. As development proceeds towards having an API for the "entry point" where a calling application would use Open Turbine, I would recommend creating more "doc" tests in addition to unit tests. Unit tests often check many aspects of correctness and "corner cases", and may not be perfectly readable for all audiences. |
Beta Was this translation helpful? Give feedback.
-
Minor nitpick: some of these tests would be good candidates for a parameterization refactor. |
Beta Was this translation helpful? Give feedback.
-
GLL quadrature is used a lot in the tests. I would just make a class for it. Seems like that is what you will use in the actual end application once you set it up as well. openturbine/src/gebt_poc/quadrature.h Line 23 in 45aab4d |
Beta Was this translation helpful? Give feedback.
-
openturbine/src/gebt_poc/solver.cpp Lines 172 to 264 in 45aab4d If you can get away with not using In the instance above, I would prefer a return of the residual in this case so it is clear what the output is. Also, in this case you are zero'ing out the residual anyways so it doesn't seem like you need to pass by reference. There is an argument for saving on memory allocations, but looking at the utilization of these and the memory is getting allocated right before calling it: openturbine/src/gebt_poc/clamped_beam.cpp Lines 75 to 78 in 45aab4d Which I would prefer to see as: auto residual_gen_coords = ElementalStaticForcesResidual(
position_vectors_, gen_coords_1D, stiffness_matrix_, quadrature_); |
Beta Was this translation helpful? Give feedback.
-
Group Discussion: @rafmudaf @deslaughter @psakievich @alanw0 Languages/Core Libraries (C++/Kokkos/Julia):
|
Beta Was this translation helpful? Give feedback.
-
Question from Mike: Thoughts on the overall structure/organization of the code. |
Beta Was this translation helpful? Give feedback.
-
Question from Mike: Thoughts on the code's readiness for an API for coupling to other codes. |
Beta Was this translation helpful? Give feedback.
-
I considered OpenTurbine from a high level perspective. After our group discussion (summarized in #108 (comment)), I got more insight into the current state of OpenTurbine. In particular, the architecture of the software as a wind turbine analysis tool has not yet been developed. My primary feedback was similar to #108 (reply in thread) in that there are currently the building blocks for a cohesive software but no clear architecture yet. It sounds like now is the time to begin addressing this, and I recommend to step back and consider the design of this from a top-down, holistic perspective. I also noticed there is a particular coding style (i.e. the trailing Is doxygen configured? I see the doxygen directory, but I don't see an entry point in the documentation site. Similar to #108 (comment), I suggest to add some reporting on the problems you've solved so far. I would treat this as verification documentation, so add a static page to the docs describing the problem, how OpenTurbine was extended to solve the problem, and show the solution compared to any analytical results. Include a mesh dependency and convergence analysis. |
Beta Was this translation helpful? Give feedback.
-
Discussion to organize thoughts and comments while reviewing the code base. I'm logging things as I see them here so I can have a reference. I will clean up my thoughts and comments as I go.
Process:
I want to see how well I understand the ideas from the tests first before looking at the actual implementations given the goal for TDD in the project plan.
@psakievich - Overview:
I see several positive things and potential for improvement. My high level summary is that the code's current form reads like a toolkit with a lot of fundamental math algorithms, and a few demonstration problems via unit-tests showing how you can piece the fundamental infrastructure together to solve a real problem.
It all seems like a good start. It is clear a lot of care and thought has gone into designing the low level data structures and algorithms.
I would like to see the code begin to take a general form through the main function for problem setup and things like BC/IC/Forcing terms to be applied generally. This would help to understand how the problems will be setup and used.
It will also help when considering what a coupling interface would look like for talking with other codes (openfast, nalu-wind, amr-wind etc).
Things I appreciate/like include:
Things I would like to see improved:
Things to anticipate and think about going forward
Beta Was this translation helpful? Give feedback.
All reactions