diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index d6555228372be1ee44e3d43270ede2982bd3906d..6d0610a593565aa865085b4371466779f8e5bb07 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -703,6 +703,7 @@ enum acct_energy_type { ENERGY_DATA_LAST_POLL, ENERGY_DATA_SENSOR_CNT, ENERGY_DATA_NODE_ENERGY, + ENERGY_DATA_NODE_ENERGY_UP, }; /* diff --git a/src/plugins/acct_gather_energy/ipmi/acct_gather_energy_ipmi.c b/src/plugins/acct_gather_energy/ipmi/acct_gather_energy_ipmi.c index 406e5c22fc9e913ddcc52d3e9db2f9b01c9341fb..d66030cd74177a5adb349b92a7c96c2d80bbc173 100644 --- a/src/plugins/acct_gather_energy/ipmi/acct_gather_energy_ipmi.c +++ b/src/plugins/acct_gather_energy/ipmi/acct_gather_energy_ipmi.c @@ -628,6 +628,7 @@ static int _ipmi_send_profile(void) uint16_t i, j; uint64_t data[descriptions_len]; uint32_t id; + time_t last_time; if (!_running_profile()) return SLURM_SUCCESS; @@ -660,6 +661,8 @@ static int _ipmi_send_profile(void) id = descriptions[i].sensor_idxs[j]; data[i] += sensors[id].energy.current_watts; } + if (descriptions[i].sensor_cnt) + last_time = sensors[id].energy.poll_time; } if (debug_flags & DEBUG_FLAG_PROFILE) { @@ -671,7 +674,7 @@ static int _ipmi_send_profile(void) } } return acct_gather_profile_g_add_sample_data(dataset_id, (void *)data, - last_update_time); + last_time); } @@ -950,6 +953,17 @@ extern int acct_gather_energy_p_get_data(enum acct_energy_type data_type, xassert(_run_in_daemon()); switch (data_type) { + case ENERGY_DATA_NODE_ENERGY_UP: + slurm_mutex_lock(&ipmi_mutex); + if (_is_thread_launcher()) { + if (_thread_init() == SLURM_SUCCESS) + _thread_update_node_energy(); + } else { + _get_joules_task(10); + } + _get_node_energy(energy); + slurm_mutex_unlock(&ipmi_mutex); + break; case ENERGY_DATA_NODE_ENERGY: slurm_mutex_lock(&ipmi_mutex); _get_node_energy(energy); diff --git a/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c b/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c index d86111db2652522ad36db42485748ca34bb0b8a0..dab425782ce36681f5ed5e5685c4b037fb4cbe98 100644 --- a/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c +++ b/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c @@ -488,13 +488,14 @@ extern int acct_gather_energy_p_get_data(enum acct_energy_type data_type, switch (data_type) { case ENERGY_DATA_JOULES_TASK: + case ENERGY_DATA_NODE_ENERGY_UP: if (local_energy->current_watts == NO_VAL) energy->consumed_energy = NO_VAL; else _get_joules_task(energy); break; - case ENERGY_DATA_NODE_ENERGY: case ENERGY_DATA_STRUCT: + case ENERGY_DATA_NODE_ENERGY: memcpy(energy, local_energy, sizeof(acct_gather_energy_t)); break; case ENERGY_DATA_LAST_POLL: diff --git a/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c b/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c index d68be3a5c39f2a71290fbae2f12ac9502b21e4d3..9fb076930c27d55ef606448a15b7238dd1d69b60 100644 --- a/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c +++ b/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c @@ -517,10 +517,11 @@ extern int acct_gather_profile_p_create_dataset( } /* insert fields */ - if (H5Tinsert(dtype_id, "ElapsedTime", sizeof(uint64_t), + if (H5Tinsert(dtype_id, "ElapsedTime", 0, H5T_NATIVE_UINT64) < 0) return SLURM_ERROR; - if (H5Tinsert(dtype_id, "EpochTime", 0, H5T_NATIVE_UINT64) < 0) + if (H5Tinsert(dtype_id, "EpochTime", sizeof(uint64_t), + H5T_NATIVE_UINT64) < 0) return SLURM_ERROR; dataset_loc = dataset; diff --git a/src/plugins/jobacct_gather/common/common_jag.c b/src/plugins/jobacct_gather/common/common_jag.c index 02bc90cdbdeb62488b3b1b2a872a158cbbbceff8..a774bdb22dece3fea3fa8e0bc0e5d12031a2ebab 100644 --- a/src/plugins/jobacct_gather/common/common_jag.c +++ b/src/plugins/jobacct_gather/common/common_jag.c @@ -59,7 +59,7 @@ static long hertz = 0; static int my_pagesize = 0; static DIR *slash_proc = NULL; -static int energy_profile = ENERGY_DATA_JOULES_TASK; +static int energy_profile = ENERGY_DATA_NODE_ENERGY_UP; static uint64_t debug_flags = 0; static int _find_prec(void *x, void *key) @@ -743,6 +743,7 @@ extern void jag_common_init(long in_hertz) acct_gather_profile_g_get(ACCT_GATHER_PROFILE_RUNNING, &profile_opt); + /* If we are profiling energy it will be checked at a different rate, so just grab the last one. */