Skip to content

Commit

Permalink
Merge branch 'devel' into fabric_mem_rebased
Browse files Browse the repository at this point in the history
  • Loading branch information
sbekele81 authored Oct 1, 2024
2 parents 02d92a2 + 41248b2 commit 0a175ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
16 changes: 13 additions & 3 deletions xprof/xprof.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,16 @@ def env_tracers
end

# Sample
if sampling?
# Currently the same `so` does the tracing, and the sampling
# This mean that is the local rank is not part of the `traced-ranks`
# No sampling will be performed
if sampling?
LOGGER.debug('Sampling Enabled')
h['LTTNG_UST_SAMPLING'] = 1
h['LTTNG_UST_SAMPLING_ENERGY'] = 1
h['ZES_ENABLE_SYSMAN'] = 0 if OPTIONS[:'backend-names'].include?('ze')
# The current only reliable way to use zes api
# is to call zesInit and set ZES_ENABLE_SYSMAN to 0
h['ZES_ENABLE_SYSMAN'] = 0 if OPTIONS[:'backend-names'].include?('ze')
end

backends = [] unless need_backend
Expand Down Expand Up @@ -522,7 +527,12 @@ end

def enable_events_mpi(channel_name, tracing_mode: 'default', profiling: true)
lttng_enable = "lttng enable-event --userspace --session=#{lttng_session_uuid} --channel=#{channel_name}"
exec("#{lttng_enable} lttng_ust_mpi:*")
case tracing_mode
when 'full'
exec("#{lttng_enable} lttng_ust_mpi:*")
when 'default'
exec("#{lttng_enable} lttng_ust_mpi:* -x lttng_ust_mpi:MPI_WTime*")
end
exec("#{lttng_enable} lttng_ust_mpi_type:*")
end

Expand Down
7 changes: 4 additions & 3 deletions ze/tracer_ze_helpers.include.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,8 @@ static int initializeHandles() {
_sampling_hSubDevices = (ze_device_handle_t***) calloc(_sampling_driverCount, sizeof(ze_device_handle_t**));
for (uint32_t driverIdx = 0; driverIdx < _sampling_driverCount; driverIdx++) {
_sampling_deviceCount[driverIdx] = 0;
// Query device count
for (uint32_t driverIdx = 0; driverIdx < _sampling_driverCount; driverIdx++) {
res = ZES_DEVICE_GET_PTR(_sampling_hDrivers[driverIdx], &_sampling_deviceCount[driverIdx], NULL);
if (res != ZE_RESULT_SUCCESS || _sampling_deviceCount[driverIdx] == 0) {
fprintf(stderr, "ERROR: No device found!\n");
Expand All @@ -1053,7 +1055,6 @@ static int initializeHandles() {
_sampling_subDeviceCount[driverIdx] = (uint32_t*) calloc(_sampling_deviceCount[driverIdx], sizeof(uint32_t));
_sampling_hSubDevices[driverIdx] = (ze_device_handle_t**) calloc(_sampling_deviceCount[driverIdx], sizeof(ze_device_handle_t*));
for (uint32_t deviceIdx = 0; deviceIdx < _sampling_deviceCount[driverIdx]; deviceIdx++) {
// zes_device_ext_properties_t deviceProps = {0};
zes_device_properties_t deviceProps = {0};
deviceProps.stype = ZES_STRUCTURE_TYPE_DEVICE_PROPERTIES;
deviceProps.pNext = NULL;
Expand All @@ -1065,9 +1066,9 @@ static int initializeHandles() {
&deviceProps );

_sampling_subDeviceCount[driverIdx][deviceIdx] = 0;
res = ZE_DEVICE_GET_SUB_DEVICES_PTR((ze_device_handle_t)_sampling_hDevices[driverIdx][deviceIdx], &_sampling_subDeviceCount[driverIdx][deviceIdx], NULL);
res = ZE_DEVICE_GET_SUB_DEVICES_PTR((ze_device_handle_t)_sampling_hDevices[driverIdx][deviceIdx], &_sampling_subDeviceCount[driverIdx][deviceIdx], NULL)
if (res != ZE_RESULT_SUCCESS) {
_ZE_ERROR_MSG("ZE_DEVICE_GET_SUB_DEVICES_PTR", res);
_ZE_ERROR_MSG("ZES_DEVICE_GET_PROPERTIES_PTR", res);
_sampling_subDeviceCount[driverIdx][deviceIdx] = 0;
}
if (_sampling_subDeviceCount[driverIdx][deviceIdx] > 0) {
Expand Down

0 comments on commit 0a175ba

Please sign in to comment.