Fixing a bug#1
Open
myeu wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the original code, a node could have its cost set at two levels, with the higher cost level setting the final cost. I saw this happening in my test data. Below is an excerpt from my debugging.
The visited array is supposed to make sure the cost is set only once. It doesn't control whether it's own edges are processed. Therefore, the visited boolean should be set at the same time as cost. Level will be true and on the next iteration that node will be processed to get its edges.
The change in the bfs.cu code is necessary because the starting node doesn't need to get its cost set in the kernel. So visited should be set to true at the same time as the cost, outside the kernel.
In my test data, Node 15152 is connected to the starting node, it should have cost = 2
Iteration Num: node id, visited, cost
1: 15152, 0, -1
2: 15152, 0, 2
3: 15152, 1, 4
Cost is set at Iteration 2, but visited is still false until the next iteration. Since it was false for a time, another node got to it and set its cost again, to 4.
I found your code to be extremely helpful. I wanted to be helpful in return by letting you know about the bug I found.
Hi,
Could you please send me the data file you use?
Thanks