ibogosavljevic/johnysswlab

something wrong with compile.sh

Closed this issue · 4 comments

Hi. I see this article
https://johnnysswlab.com/faster-hash-maps-binary-trees-etc-through-data-layout-modification/

and is eager to try the example. But I find that something wrong with
https://github.com/ibogosavljevic/johnysswlab/blob/master/2023-09-datastucturelayout/compile.sh

clang++ -Werror -DLIKWID_PERFMON -O3 -std=c++17 -Werror -g array_of_pointers.cpp -I ../common/ -fopenmp works.

I wonder whether common/likwid.h can be used Or should I download likwid library by myself ?

either sudo apt-get install liblikwid or use the replacement I provided if you don't have likwid or likwid doens't work for you.

@ibogosavljevic Hi, I have another question. For many folders there is a compile.sh for us to build. Often build command is like this:
g++/clang++ -g -O3 -DLIKWID_PERFMON -llikwid xxx.cpp

From this I infer that you build them using likwid installed within standard path(including headers and library) on your host instead of using common/likwid.h the repo provided, right ? I wonder how you run program in this situation, use likwid-perfctr or directly run ?

I've done likwid 5.3.0 building on my virtualized fedora environment, so I can build and run like this :

# clang++ -std=c++17 -g -mavx2 -fopenmp-simd -DLIKWID_PERFMON -llikwid sequential_test.cpp
root@2022-07-memproperties (master)# ./a.out
Running without Marker API. Activate Marker API with -m on commandline.

However nothing performance data is output, comparing to the scenario where I just use likwid.h the repo provided.

I don't know what's wrong. Any guidence ? I may want to see the similar performance data given by your customized likwid.h using standard likwid library, seems that the latter is more powerful.

Many thanks. It works for me, although it doesn't run the case of 32M, 64M or larger array size. Strange.