Libnina is a library used to reduce the energy consumption of OpenMP parallel applications. It has two operation modes: the HW counter collection mode, used to characterize the application behavior; and the CPU frequency control mode, where the reduction of energy consumption becomes possible if memory-bound regions are set to execute with a lower CPU frequency.
Libnina requires the acpi-cpufreq
driver (instead of the intel_pstate
)
because it dynamically changes the CPU frequency during runtime. The
governor must be the userspace
that let’s application-level calls
(with the appropriate permissions) to set the CPU frequency. If you
are using Grub, you can disable intel_pstate
by adding the following
line in the /etc/default/grub
file.
GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable"
And then update grub.cfg
by issuing the following command:
grub-mkconfig -o /boot/grub/grub.cfg
- Check here for further details about disabling =intel_pstate=. You can use the follow command line:
sudo cpupower frequency-info --governors
analyzing CPU 0: conservative ondemand userspace powersave performance
- In this case, it is possible to use this library, because the userspace governor exists.
- It’s necessary the libpapi, libconfig, and libcpufreq installation. The follow command line may be used:
sudo apt install libpapi-dev -y
sudo apt install libconfig-dev -y
sudo apt install libcpufreq-dev -y
cd src
make clean
make
rm -f libnina.so db.o libnina.o pomp2_lib.o pomp2_user_region_info.o pomp2_region_info.o opari2_ctc_parser.o modeling_papi.o db.d libnina.d pomp2_lib.d pomp2_user_region_info.d pomp2_region_info.d opari2_ctc_parser.d modeling_papi.d gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -MM modeling_papi.c >modeling_papi.d gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -MM opari2_ctc_parser.c >opari2_ctc_parser.d gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -MM pomp2_region_info.c >pomp2_region_info.d gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -MM pomp2_user_region_info.c >pomp2_user_region_info.d gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -MM pomp2_lib.c >pomp2_lib.d gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -MM libnina.c >libnina.d gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -MM db.c >db.d gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -c -o db.o db.c gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -c -o libnina.o libnina.c gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -c -o pomp2_lib.o pomp2_lib.c gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -c -o pomp2_user_region_info.o pomp2_user_region_info.c gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -c -o pomp2_region_info.o pomp2_region_info.c gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -c -o opari2_ctc_parser.o opari2_ctc_parser.c gcc -Wno-unused-parameter -Wno-unused-variable -fPIC -Wall -Wextra -O3 -g -fopenmp -DLIBNINA_THREAD -c -o modeling_papi.o modeling_papi.c gcc -o libnina.so db.o libnina.o pomp2_lib.o pomp2_user_region_info.o pomp2_region_info.o opari2_ctc_parser.o modeling_papi.o -shared -lcpufreq -lpapi -lconfig
For more details see our Wiki.