ZigRazor / CXXGraph

Header-Only C++ Library for Graph Representation and Algorithms
https://zigrazor.github.io/CXXGraph/
Mozilla Public License 2.0
420 stars 106 forks source link

Building Failure on benchmark #444

Open ZigRazor opened 1 month ago

ZigRazor commented 1 month ago

We have the following problem with benchmark compilation, and the CI/CD fails:

[ 55%] Building CXX object benchmark/CMakeFiles/benchmark_exe.dir/Partition_BM.cpp.o
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp: In function ‘void PartitionHDRF_X(benchmark::State&)’:
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp:16:21: error: ‘class CXXGraph::Graph<int>’ has no member named ‘partitionGraph’
   16 |     auto result = g.partitionGraph(
      |                     ^~~~~~~~~~~~~~
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp: In function ‘void PartitionHDRF_FromReadedCitHep(benchmark::State&)’:
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp:27:34: error: ‘class CXXGraph::Graph<int>’ has no member named ‘partitionGraph’
   27 |     auto result = cit_graph_ptr->partitionGraph(
      |                                  ^~~~~~~~~~~~~~
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp: In function ‘void PartitionEBVC_X(benchmark::State&)’:
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp:44:21: error: ‘class CXXGraph::Graph<int>’ has no member named ‘partitionGraph’
   44 |     auto result = g.partitionGraph(
      |                     ^~~~~~~~~~~~~~
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp: In function ‘void PartitionEBVC_FromReadedCitHep(benchmark::State&)’:
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp:55:34: error: ‘class CXXGraph::Graph<int>’ has no member named ‘partitionGraph’
   55 |     auto result = cit_graph_ptr->partitionGraph(
      |                                  ^~~~~~~~~~~~~~
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp: In function ‘void PartitionGVC_X(benchmark::State&)’:
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp:72:21: error: ‘class CXXGraph::Graph<int>’ has no member named ‘partitionGraph’
   72 |     auto result = g.partitionGraph(
      |                     ^~~~~~~~~~~~~~
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp: In function ‘void PartitionGVC_FromReadedCitHep(benchmark::State&)’:
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp:83:34: error: ‘class CXXGraph::Graph<int>’ has no member named ‘partitionGraph’
   83 |     auto result = cit_graph_ptr->partitionGraph(
      |                                  ^~~~~~~~~~~~~~
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp: In function ‘void PartitionEBV_X(benchmark::State&)’:
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp:100:21: error: ‘class CXXGraph::Graph<int>’ has no member named ‘partitionGraph’
  100 |     auto result = g.partitionGraph(
      |                     ^~~~~~~~~~~~~~
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp: In function ‘void PartitionEBV_FromReadedCitHep(benchmark::State&)’:
/home/runner/work/CXXGraph/CXXGraph/benchmark/Partition_BM.cpp:111:34: error: ‘class CXXGraph::Graph<int>’ has no member named ‘partitionGraph’
  111 |     auto result = cit_graph_ptr->partitionGraph(
      |                                  ^~~~~~~~~~~~~~
gmake[2]: *** [benchmark/CMakeFiles/benchmark_exe.dir/build.make:300: benchmark/CMakeFiles/benchmark_exe.dir/Partition_BM.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:743: benchmark/CMakeFiles/benchmark_exe.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
Error: Process completed with exit code 2. 
Ajay-26 commented 1 month ago

Hi, I would like to take this issue on. Looking at the API, I can see that there is a partitionGraph member function under the Partitioner class here

Perhaps the object from where this member function is called needs to be a Partitioner and not a Graph - should I change the Partition_BM.cpp file to incorporate this, or should I have the Graph class have a partitionGraph member function too ? Or am I missing something here ?

Fwiw, The partition test calls the function from the Partitioner class. I am inclined towards doing it that way here too, let me know if I am missing something here though

ZigRazor commented 1 month ago

I Think your analysis is good, you can go on!

Ajay-26 commented 1 month ago

Thank you! The build is working on my end, but I am running into a segmentation fault with the BFS benchmark when I run the benchmark_exe executable.

2024-05-30T11:23:52-05:00
Running ./benchmark_exe
Run on (12 X 2688 MHz CPU s)
CPU Caches:
  L1 Data 48 KiB (x6)
  L1 Instruction 32 KiB (x6)
  L2 Unified 1280 KiB (x6)
  L3 Unified 12288 KiB (x1)
Load Average: 0.16, 0.18, 0.13
***WARNING*** Library was built as DEBUG. Timings may be affected.
----------------------------------------------------------------------------------
Benchmark                                        Time             CPU   Iterations
----------------------------------------------------------------------------------
BFS_X/1                                       1538 ns         1538 ns       443783
BFS_X/18                                      6943 ns         6943 ns        98367
BFS_X/324                                   102805 ns       102806 ns         6685
BFS_X/5832                                 2254945 ns      2254951 ns          312
BFS_X/104976                              88080320 ns     88080662 ns            8
BFS_X/262144                              86550929 ns     86549850 ns            8
Segmentation fault

Haven't begun debugging as to why the Segmentation fault is happening, will take a look in some time. Is this to be raised as a new issue ?

ZigRazor commented 1 month ago

look at Memory consumption, it's possibile that you ram is full

Ajay-26 commented 1 month ago

Thank you for the suggestion. I think I found why it was happening - I was running the benchmark executable from the wrong directory, so the cit_graph_ptr was nullptr. When I run it from the build directory, it works fine. I can make a PR for the original issue in some time :)

ZigRazor commented 1 month ago

good!

Ajay-26 commented 4 weeks ago

Hi, I made a PR here. Please let me know if any changes are necessary and I can make them. Thank you for all your help!