Skip to content
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

Too much trail is added when nutrients are projected #57

Open
kolayne opened this issue Mar 2, 2021 · 1 comment
Open

Too much trail is added when nutrients are projected #57

kolayne opened this issue Mar 2, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@kolayne
Copy link
Member

kolayne commented Mar 2, 2021

It is not guaranteed, that all the nodes in the following loops are unique: it is possible that node A has node B as its neighbour by more than one direction (for example, (A->get_top() == &B) && (A->get_right() == &B)). In such situation B->temp_trail will be increased twice instead of once.

We need to fix this piece of code, and also look for similar cases and either fix them if they are affected by the same mistake or write a comment explaining why this is not an issue there, to make it clear that the piece of code was not forgotten but is correct.

MapNode *left = self->get_left();
for(MapNode *node : {left->get_top(), left,
left->get_bottom()}) // for each leading node of rows of 3x3 square
{
for(int i = 0; i < 3; ++i)
{
atomicAdd(&node->trail, trail_value); // add trail
node = node->get_right(); // move to next node in row
}
}

@kolayne
Copy link
Member Author

kolayne commented Mar 2, 2021

I would also like @tanya-kta to make a long comment somewhere in SimulationMap.cu/cuh and explain in more detail, how the mapnode grid is built, what strange things like that are supposed to happen and why

@kolayne kolayne added the bug Something isn't working label Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant