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

Races in Maximal Independent Set Lonestar application #376

Open
AKKamath opened this issue Apr 28, 2021 · 2 comments
Open

Races in Maximal Independent Set Lonestar application #376

AKKamath opened this issue Apr 28, 2021 · 2 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@AKKamath
Copy link

AKKamath commented Apr 28, 2021

While going through the MIS application, I noticed a few data races which I note below.

Lines 89 and 101

->    if (dst != node && graph.node_data[dst] != NON_INDEPENDENT && prio[dst] >= max_prio)
      {
        if ((prio[dst] > max_prio) || dst > max_prio_node)
        {
          max_prio = prio[dst];
          max_prio_node = dst;
        }
      }
    }
    if (max_prio_node == node)
    {
      assert(graph.node_data[node] == UNMARKED);
->    graph.node_data[node] = MARKED;
    }

Line 101 uses a simple assignment, which can race with the node_data being read in line 89.

Lines 133 and 147

->  if (graph.node_data[dst] == MARKED)
    {
      drop = true;
    }
      ...
   if (graph.node_data[node] == UNMARKED)
   {
->     graph.node_data[node] = NON_INDEPENDENT;
   }

Same as the above case.

@AKKamath
Copy link
Author

This definitely seems like a race.
Could it cause problems because of caching?
For example, the node_data is set by one thread in L1, but other threads outside the threadblock do not see this update.

@nicelhc13
Copy link
Contributor

Hi, when we just check your comment, your point looks right. But note that this is compiler generated codes (https://dl.acm.org/doi/abs/10.1145/2983990.2984015)

I should look into this issue further but more optimizations were applied here.

Have you seen any correctness issue from this code?
Could you help me to reproduce the bug?

@nicelhc13 nicelhc13 added bug Something isn't working question Further information is requested labels Sep 14, 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 question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants