Skip to content

Fix fieldversion2#1059

Open
cosunae wants to merge 5 commits intomasterfrom
fix_fieldversion2
Open

Fix fieldversion2#1059
cosunae wants to merge 5 commits intomasterfrom
fix_fieldversion2

Conversation

@cosunae
Copy link
Copy Markdown
Contributor

@cosunae cosunae commented Nov 10, 2020

Technical Description

Fixes the field version for #1056
The problem is caused by the fact that the algorithm is trying to also fix the cases where the graph does not contains outdegree=0 nodes.

if(stencilSCCs->empty() && !SCCs->empty() && !graph.isDAG()) {

However this can be a normal case, like the example of #1056
Here we fix it by accepting that the graph (that is not a DAG) does not have to contain nodes with outdegree=0 or indegree=0.
Instead we fixed the algorithms that require this condition (see ReadBeforeWriteConflict.cpp)

Resolves / Enhances

#1056

Example

(again) example is in #1056

@cosunae
Copy link
Copy Markdown
Contributor Author

cosunae commented Nov 10, 2020

launch jenkins

@cosunae
Copy link
Copy Markdown
Contributor Author

cosunae commented Nov 10, 2020

launch jenkins

Copy link
Copy Markdown
Contributor

@Stagno Stagno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes requested, overall it's ok.

Do we understand now how we could get into this unresolvable race condition, though?

// If the LHSAccessID is not part of the SCC, we cannot resolve the race-condition
for(std::set<int>& scc : *stencilSCCs) {
if(!scc.count(LHSAccessID)) {
if(dump)
graph.toDot("rc_" + instantiation->getName() + ".dot");
reportRaceCondition(statement, *instantiation);
// The function call above throws, so do not need a return here any longer. Will refactor
// further later. return RCKind::Unresolvable;
}
}

I'm still doubtful about that, because dawn will bail out, but a correctly placed kernel-split can always solve a race condition. If it's not possible anymore to reach that condition, then it's dead code.

/// @brief Insert a new node
Vertex& insertNode(int ID) {
auto [iter, inserted] = vertices_.emplace(ID, Vertex{adjacencyList_.size(), ID});
Vertex& insertNode(int Value) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Vertex& insertNode(int Value) {
Vertex& insertNode(int value) {

we Capitalize only public members of classes

};

protected:
// map of Value (i.e. normally accessID to Vertex object
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// map of Value (i.e. normally accessID to Vertex object
// map from accessID to Vertex object

Isn't this always the case?
Also the description of Vertex::Value below could be improved ... doesn't it always correspond to an accessID?

Comment on lines 43 to +46
for(int k = 0+0; k <= ( m_k_size == 0 ? 0 : (m_k_size - 1)) + 0+0; ++k) {
for(auto const& loc : getEdges(LibTag{}, m_mesh)) {
m_c_0(deref(LibTag{}, loc), (k + 0)) = m_c(deref(LibTag{}, loc), (k + 0));
} }}{
for(int k = 0+0; k <= ( m_k_size == 0 ? 0 : (m_k_size - 1)) + 0+0; ++k) {
for(auto const& loc : getEdges(LibTag{}, m_mesh)) {
m_a(deref(LibTag{}, loc), (k + 0)) = ((m_b(deref(LibTag{}, loc), (k + 0)) / m_c_0(deref(LibTag{}, loc), (k + 0))) + (::dawn::float_type) 5);
m_a(deref(LibTag{}, loc), (k + 0)) = ((m_b(deref(LibTag{}, loc), (k + 0)) / m_c(deref(LibTag{}, loc), (k + 0))) + (::dawn::float_type) 5);
} for(auto const& loc : getEdges(LibTag{}, m_mesh)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test can be removed then. It was testing that a versioned field was generated, but it's not generated anymore.

@Stagno
Copy link
Copy Markdown
Contributor

Stagno commented Dec 1, 2020

launch jenkins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants