diff --git a/libiotrace/src/event.c b/libiotrace/src/event.c index 49df535..d378224 100644 --- a/libiotrace/src/event.c +++ b/libiotrace/src/event.c @@ -3312,11 +3312,14 @@ void power_measurement_step(void) { #ifdef WITH_MPI_IO if (mpi_node_rank == 0 || mpi_node_rank == -1) { - LOG_DEBUG("RUN STEP on Hostname: %s, World Rank: %d. Node Rank: %d\n", hostname,mpi_world_rank, mpi_node_rank); #endif uint64_t diff = gettime() - last_time; if (diff > POWER_MEASUREMENT_INTERVAL) { +#ifdef WITH_MPI_IO + LOG_DEBUG("RUN STEP on Hostname: %s, World Rank: %d. Node Rank: %d\n", hostname,mpi_world_rank, mpi_node_rank); +#endif + #ifdef ENABLE_POWER_MEASUREMENT_RAPL rapl_measurement(); #endif @@ -4186,14 +4189,13 @@ int powercap_open_file(unsigned int offset) { int fd = 0; if (powercap_fd_array[offset].open == 0) { fd = CALL_REAL_POSIX_SYNC(open)(pwoercap_file_path_array[offset], O_SYNC|O_RDONLY); - //fd = CALL_REAL_POSIX_SYNC(open)(pwoercap_file_path_array[offset], O_SYNC|component_sys_flags[powercap_cpu_measurement_tasks[offset].offset_in_file]); if (fd > 0) { powercap_fd_array[offset].file_descriptor = fd; powercap_fd_array[offset].open = 1; //LOG_DEBUG("Open File %3d: %3u => %s", fd, offset, pwoercap_file_path_array[offset]); } else { - LOG_WARN("\n\n\n-------ERROR------\nCant open File for id: %3u\nFile: %s\nFile Descriptor: %d (%d)\nFlags: %d", offset, pwoercap_file_path_array[offset] , fd, errno, O_SYNC|component_sys_flags[powercap_cpu_measurement_tasks[offset].offset_in_file]); + LOG_WARN("\n\n\n-------ERROR------\nCant open File for id: %3u\nFile: %s\nFile Descriptor: %d (%d)", offset, pwoercap_file_path_array[offset] , fd, errno); } } else { fd = powercap_fd_array[offset].file_descriptor; diff --git a/libiotrace/src/power_measurement/defines.h b/libiotrace/src/power_measurement/defines.h index 8406f9a..d339f6f 100644 --- a/libiotrace/src/power_measurement/defines.h +++ b/libiotrace/src/power_measurement/defines.h @@ -160,7 +160,6 @@ static mode_t pkg_sys_flags[PKG_NUM_EVENTS] = {O_RDONLY, O_RDONLY, O_RDONLY, static int component_events[COMPONENT_NUM_EVENTS] = {COMPONENT_ENERGY, COMPONENT_MAX_ENERGY_RANGE, COMPONENT_MAX_POWER_A, COMPONENT_POWER_LIMIT_A, COMPONENT_TIME_WINDOW_A, COMPONENT_ENABLED, COMPONENT_NAME}; static char *component_event_names[COMPONENT_NUM_EVENTS] = {"ENERGY_UJ", "MAX_ENERGY_RANGE_UJ", "MAX_POWER_A_UW", "POWER_LIMIT_A_UW", "TIME_WINDOW_A_US", "ENABLED", "NAME"}; static char *component_sys_names[COMPONENT_NUM_EVENTS] = {"energy_uj", "max_energy_range_uj", "constraint_0_max_power_uw", "constraint_0_power_limit_uw", "constraint_0_time_window_us", "enabled", "name"}; -static mode_t component_sys_flags[COMPONENT_NUM_EVENTS] = {O_RDONLY, O_RDONLY, O_RDONLY, O_RDWR, O_RDONLY, O_RDONLY, O_RDONLY}; #define POWERCAP_MAX_COUNTERS (3 * (PKG_NUM_EVENTS + (3 * COMPONENT_NUM_EVENTS)))