-
Notifications
You must be signed in to change notification settings - Fork 48
Fixes and Improvements for multi-node test runs #374
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
Changes from all commits
a3ad322
90ef8bb
795adb7
f3ea521
e82cdce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -283,7 +283,7 @@ dart_team_memalloc_aligned( | |
| MPI_Comm_rank(sharedmem_comm, &sharedmem_unitid); | ||
| // re-use previously allocated memory | ||
| if (segment->baseptr == NULL) { | ||
| segment->baseptr = malloc(sizeof(char *) * team_data->sharedmem_nodesize); | ||
| segment->baseptr = calloc(team_data->sharedmem_nodesize, sizeof(char *)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| baseptr_set = segment->baseptr; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ namespace dash { | |
| * \tparam ElementType Type of the elements in the sequence | ||
| * invoke, deduced from parameter \c gen | ||
| * \tparam UnaryFunction Unary function with signature | ||
| * \c void(ElementType &) | ||
| * \c ElementType(void) | ||
| * | ||
| * \complexity O(d) + O(nl), with \c d dimensions in the global iterators' | ||
| * pattern and \c nl local elements within the global range | ||
|
|
@@ -48,6 +48,55 @@ void generate ( | |
| std::generate(lfirst, llast, gen); | ||
| } | ||
|
|
||
| /** | ||
| * Assigns each element in range [first, last) a value generated by the | ||
| * given function object g. The index passed to the function is | ||
| * a global index. | ||
| * | ||
| * Being a collaborative operation, each unit will invoke the given | ||
| * function on its local elements only. | ||
| * | ||
| * \tparam ElementType Type of the elements in the sequence | ||
| * invoke, deduced from parameter \c gen | ||
| * \tparam UnaryFunction Unary function with signature | ||
| * \c ElementType(index_t) | ||
| * | ||
| * \complexity O(d) + O(nl), with \c d dimensions in the global iterators' | ||
| * pattern and \c nl local elements within the global range | ||
| * | ||
| * \ingroup DashAlgorithms | ||
| */ | ||
| template < | ||
| typename ElementType, | ||
| class PatternType, | ||
| class UnaryFunction > | ||
| void generate_with_index( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, I missed this function quite often. |
||
| /// Iterator to the initial position in the sequence | ||
| GlobIter<ElementType, PatternType> first, | ||
| /// Iterator to the final position in the sequence | ||
| GlobIter<ElementType, PatternType> last, | ||
| /// Generator function | ||
| UnaryFunction gen) { | ||
| /// Global iterators to local index range: | ||
| auto index_range = dash::local_index_range(first, last); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better use the new range based views, as this does not work with multiple local ranges AFAIK. Maybe @fuchsto can assist.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have any pointer on how to use them? I'm not sure range based views and I have crossed paths so far...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey, I even introduced you personally last time in Munich!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be honest, I don't even know where to start looking. I guess I could crawl through a host of undocumented code, still not knowing where to start or how to put the pieces together... |
||
| auto lbegin_index = index_range.begin; | ||
| auto lend_index = index_range.end; | ||
|
|
||
| if (lbegin_index != lend_index) { | ||
| // Pattern from global begin iterator: | ||
| auto & pattern = first.pattern(); | ||
| auto first_offset = first.pos(); | ||
| // Iterate local index range: | ||
| for (auto lindex = lbegin_index; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same problem here. |
||
| lindex != lend_index; | ||
| ++lindex) { | ||
| auto gindex = pattern.global(lindex); | ||
| auto element_it = first + (gindex - first_offset); | ||
| *element_it = gen(gindex); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| } // namespace dash | ||
|
|
||
| #endif // DASH__ALGORITHM__GENERATE_H__ | ||
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.
I am surprised that this even worked in the past...