File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ bats_require_minimum_version 1.5.0
2+
13launch_mpi () {
24 # timeout just to avoid burning too much hours when bug are introduced
35 timeout 40s $MPIRUN " $@ "
@@ -39,3 +41,11 @@ launch_mpi() {
3941 # Current bug in the CI where `mpi_finalize_session` hang
4042 THAPI_SYNC_DAEMON_MPI_NO_FINALIZE=1 THAPI_SYNC_DAEMON=mpi launch_mpi -n 2 iprof ./mpi_helloworld
4143}
44+
45+ # Test Traced Rank
46+
47+ @test " iprof_mpi+traced_ranks" {
48+ trace_dir=" ${BATS_TEST_TMPDIR} /${BATS_TEST_NAME} "
49+ run -0 launch_mpi -n 2 iprof --backend cl --traced-ranks 1 -- clinfo
50+ [[ " $outout " =~ " 1 Hostnames | 1 Processes | 1 Threads |" ]]
51+ }
Original file line number Diff line number Diff line change 881881def all_env_tracers
882882 # Return the list of backends (used by local master to enable lttng events)
883883 # and the ENV used by any traced-ranks to preload THAPI tracers
884- need_env = Set [ -1 , MPITopo . rank_id ] . intersect? ( OPTIONS [ :'traced-ranks' ] )
885-
886- # Early exit to be nice with the FileSystem
887- return [ [ ] , { } ] unless need_env
888884
889885 h = Hash . new { |h , k | h [ k ] = [ ] }
890886 backends = [ ]
@@ -958,7 +954,13 @@ def all_env_tracers
958954 h [ 'THAPI_SAMPLING_LIBRARIES' ] << File . join ( PKGLIBDIR , 'sampling' , 'libHeartbeatSampling.so' )
959955 end
960956
957+ # Only the local master need to backend (to enable the event)
958+ # TODO: Only enable local rank who have traced rank in them
959+ # All the traced ranks, and only them, need the ENV
960+ # TODO: Refactor the code to avoid calling `whichlib64` for non traced-rank
961961 backends = [ ] unless MPITopo . local_master?
962+ h = { } unless Set [ -1 , MPITopo . rank_id ] . intersect? ( OPTIONS [ :'traced-ranks' ] )
963+
962964 LOGGER . info ( "Backends found: #{ backends } " )
963965 LOGGER . debug ( "User app env: #{ h } " )
964966
You can’t perform that action at this time.
0 commit comments