elemental impure subroutine set_cpu_energy_performance_preference(this,energy_performance_preference)
class(linux_cpu), intent(inout) :: this
character(len=*), intent(in) :: energy_performance_preference
integer :: nunit, stat
logical :: ex
character(len=:), allocatable :: file_name
this%energy_performance_preference = energy_performance_preference
file_name = this%path_cpu//"/cpufreq/energy_performance_preference"
inquire(file=file_name, exist=ex)
if (ex) then
open(newunit=nunit, file=file_name, iostat=stat)
write(nunit, '(a)') this%energy_performance_preference
close(nunit)
else
! error stop "file not found: "//file_name
endif
end subroutine set_cpu_energy_performance_preference