m_energy Function

public function m_energy() result(wt)

returns the energy used since some time in the past. The precise meaning depends on the infrastructure is available. In the cray_pm_energy case, this is the energy used by the node in kJ.

Arguments

None

Return Value real(kind=dp)


Source Code

   FUNCTION m_energy() RESULT(wt)
      !! returns the energy used since some time in the past.
      !! The precise meaning depends on the infrastructure is available.
      !! In the cray_pm_energy case, this is the energy used by the node in kJ.

      REAL(KIND=dp)                            :: wt

#if defined(__CRAY_PM_ENERGY)
      wt = read_energy("/sys/cray/pm_counters/energy")
#elif defined(__CRAY_PM_ACCEL_ENERGY)
      wt = read_energy("/sys/cray/pm_counters/accel_energy")
#else
      wt = 0.0 ! fallback default
#endif

   END FUNCTION m_energy