Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • It looks like your code has a data race on sub_map. Fix the code before you try to interpret performance. Commented Jun 19 at 22:27
  • I am actually surprised that you can get a 30x speed-up on this code. Can you show the compilation options you are using? Commented Jun 20 at 7:16
  • @PierU other than warning options I used -fstrict-aliasing -fno-omit-frame-pointer -O3 -march=native --fast-math. The results from the image are from the whole code but this smaller example shows the same tendency. Anyway, @ViktorEijkhout's suggestion was correct and removed the big drop in performance. Commented Jun 20 at 8:05
  • Running the code with ThreadSanitizer highlights that there is a data race between the is_alive accesses in count_alive_neighbours_multi and the write performed with the result of UPDATE_CELL. Commented Jun 20 at 9:18