Dear Linux users,
I'm a noob at openmp, gcc and c programming. I can run my own openmp code in terminal with no problem, eg. gcc -fopenmp program.c -o program
But now I'm trying to compile and run another person's code, it contains a makefile and multiple .c and .h files. I don't know how to compile/run this?
Link to the files - https://github.com/awreece/memory-bandwidth-demo
My attempt to make and run it:
linux@linux ~ $ make
gcc -O3 -march=native main.c monotonic_timer.c functions.c -o memory_profiler -fopenmp -DWITH_OPENMP
linux@linux ~ $ ./memory_profiler
read_memory_rep_lodsq: 6.96 GiB/s
read_memory_loop: 7.89 GiB/s
read_memory_sse: 7.79 GiB/s
write_memory_loop: 6.58 GiB/s
write_memory_rep_stosq: 7.28 GiB/s
write_memory_sse: 6.61 GiB/s
write_memory_nontemporal_sse: 5.86 GiB/s
write_memory_memset: 6.64 GiB/s
memory_profiler: main.c:51: timeitp: Assertion `(1*(1024*1024*1024LL)) % omp_get_max_threads() == 0' failed.
Program aborts half way. It aborts when trying to run openmp code from main.c . I don't think I'm using openmp properly? How can I fix this?
Thankyou for your time,