masabahmad / CRONO

A Shared Memory Multithreaded Graph Benchmark Suite for Multicores

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inefficient implimentation in sorted_neighbors_tri_lock.cc

jyhuang91 opened this issue · comments

It seems to me in this file CRONO/apps/triangle_counting/sorted_neighbors_tri_lock.cc, line 103-110

              int counter = 0;
              //printf("\n %d %d %d", neighbor, edges[neighbor], it);
              while(counter < edges[neighbor])
              {
                counter++;
              }
              if(edges[neighbor] == counter)
                Total_tid[tid]++;

is just doing Toal_tid[tid]++;

What's the point to write a while loop to increment the counter? Or am I missing something?

Hi jyhuang91,

Yes thank you for pointing out the bug. I have fixed and updated the code. Let me know if there are any other issues.

I checked it with roadNet-CA.txt from https://snap.stanford.edu/data/roadNet-CA.html. It is giving the correct triangle count (120676).

Regards
Masab

Hi, I will close this thread if there are no further issues.

Thanks
Masab