Skip to content

Instantly share code, notes, and snippets.

@TApplencourt
Created February 21, 2023 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TApplencourt/b71d4c7b2c5c80f5e6321be75154b262 to your computer and use it in GitHub Desktop.
Save TApplencourt/b71d4c7b2c5c80f5e6321be75154b262 to your computer and use it in GitHub Desktop.
lttng_mpi_live
# This code will be executed by multiple processes
# each process will have a RANKID
MPI_RANK=$PALS_RANKID
# UUID for each process
THAPI_LOCK_DIR=$HOME/.lttng_mpi/$MPI_RANK
rm -rf $THAPI_LOCK_DIR
mkdir -p $THAPI_LOCK_DIR/
# Independ lttng session
export LTTNG_HOME=$THAPI_LOCK_DIR
# Our user space lttng tracepoint
export LD_PRELOAD=$home/applenco/THAPI/build/ici/libTracerZE.so:$LD_PRELOAD
lttng-sessiond --daemonize
lttng-relayd --daemonize
lttng create THAPI_$MPI_RANK --live
lttng enable-event --channel=blocking-channel --userspace lttng_ust_ze:*
lttng add-context --userspace --channel=blocking-channel -t vpid -t vtid
lttng start THAPI_$MPI_RANK
babeltrace2 \
--component=source.ctf.lttng-live \
--params="inputs=[\"net://localhost/host/$(hostname)/THAPI_$MPI_RANK\"],
session-not-found-action=end" \
--component=sink.utils.dummy |& tee $MPI_RANK.log &
pid=$!
# Some user code that we want to trace
zeinfo &> /dev/null
lttng stop THAPI_$MPI_RANK
lttng destroy THAPI_$MPI_RANK
wait $pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment