-
Notifications
You must be signed in to change notification settings - Fork 52
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
Feature new for hybrid #768
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: holke [email protected]
…efines irregularly
Merging with main solved the second issue |
After Debugging-session with @lukasdreyer |
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.
very good contribution - obviously with such a big PR i have some comments, but i see no major problems.
You should add addtional test cases to catch the boundary cases.
For example testing when the first tree is not on the first process.
src/t8_cmesh/t8_cmesh_cxx.cxx
Outdated
{ | ||
return t8_A_times_B_over_C_intA (process, global_num_elements, mpisize); | ||
} | ||
|
||
void | ||
t8_cmesh_uniform_bounds (t8_cmesh_t cmesh, int level, t8_scheme_cxx_t *ts, t8_gloidx_t *first_local_tree, |
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.
we can now rename this function to
t8_cmesh_uniform_bounds_element_counts_are_equal
(or similar name)
and call it each time that for all eclasses the "number of elements at level l" is the same.
It must not even be 2^n or k^n, just the same on the given level.
src/t8_cmesh/t8_cmesh_cxx.cxx
Outdated
} | ||
|
||
/* TODO: Shared trees, binary search in offset-array to avoid recv_any, | ||
* use partition_given to partition the cmesh*/ |
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 TODO still to do?
src/t8_cmesh/t8_cmesh_cxx.cxx
Outdated
#endif | ||
|
||
/* TODO: Clean up size_t and gloidx_t data types, ensure that each variables has the | ||
* matching type. */ |
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 TODO still to do?
src/t8_cmesh.h
Outdated
* \param [in] comm The communicator | ||
*/ | ||
void | ||
t8_cmesh_uniform_bounds_hybrid (const t8_cmesh_t cmesh, const int level, const t8_scheme_cxx_t *scheme, |
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.
we agreed to change the name, since the old version can also be used for hybrid schemes.
src/t8_cmesh/t8_cmesh_cxx.cxx
Outdated
= query_data->num_procs - 1 | ||
- t8_A_times_B_over_C_intA (query_data->num_procs, mirror_element_index, query_data->global_num_elements); | ||
|
||
// (int)(((long double)mirror_element_index/query_data->global_num_elements)*query_data->num_procs); |
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.
can we delete this comment?
src/t8_cmesh/t8_cmesh_cxx.cxx
Outdated
const t8_gloidx_t mirror_element_index = query_data->global_num_elements - element_index - 1; | ||
int first_proc_rank; | ||
|
||
t8_debugf ("[H] tree %li el %li mirror %li\n", pure_local_tree, element_index, mirror_element_index); |
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 print still needed?
src/t8_cmesh/t8_cmesh_cxx.cxx
Outdated
* add the first process. */ | ||
first_proc_adjusted = first_proc_rank - query_data->process_offset; | ||
} | ||
t8_debugf ("[H] ptree %zd, first element %li, on proc %zd\n", pure_local_tree, element_index, first_proc_adjusted); |
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 print still needed?
src/t8_cmesh/t8_cmesh_cxx.cxx
Outdated
t8_cmesh_uniform_bounds_hybrid (const t8_cmesh_t cmesh, const int level, const t8_scheme_cxx_t *scheme, | ||
t8_gloidx_t *first_local_tree, t8_gloidx_t *child_in_tree_begin, | ||
t8_gloidx_t *last_local_tree, t8_gloidx_t *child_in_tree_end, int8_t *first_tree_shared, | ||
sc_MPI_Comm comm) |
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.
This function is 600 lines long - uff.
Consider outsourcing some code into subroutines.
For example
- partitioned and non-partitioned computation
- sending of start message
- sending of end message
- receiving of start message
- receiving of end message
Co-authored-by: Johannes Holke <[email protected]>
PR to enable the hybrid new.
Current TODOs:
All these boxes must be checked by the reviewers before merging the pull request:
As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.
General
The reviewer executed the new code features at least once and checked the results manually
The code follows the t8code coding guidelines
New source/header files are properly added to the Makefiles
The code is well documented
All function declarations, structs/classes and their members have a proper doxygen documentation
All new algorithms and data structures are sufficiently optimal in terms of memory and runtime (If this should be merged, but there is still potential for optimization, create a new issue)
Tests
Github action
The code compiles without warning in debugging and release mode, with and without MPI (this should be executed automatically in a github action)
All tests pass (in various configurations, this should be executed automatically in a github action)
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
script/find_all_source_files.scp
to check the indentation of these files.Licence
doc/
(or already has one)