Skip to content

Instantly share code, notes, and snippets.

@jefflarkin
Last active June 5, 2017 20:53
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 jefflarkin/678a707c4217dab14156 to your computer and use it in GitHub Desktop.
Save jefflarkin/678a707c4217dab14156 to your computer and use it in GitHub Desktop.
Script for gathering an nvprof timeline on a Cray XK7
#!/bin/bash
# USAGE: Add between aprun options and executable
# For Example: aprun -n 16 -N 1 ./foo arg1 arg2
# Becomes: aprun -n 16 -N 1 ./nvprof.sh ./foo arg1 arg2
export PMI_NO_FORK=1
# Give each *rank* a separate file
LOG=timeline_$ALPS_APP_PE.nvprof
# Set the process and context names
NAME="MPI Rank: %q{ALPS_APP_PE}"
# Stripe each profile file by 1 to share the load on large runs
if [ !-f $LOG ] ; then lfs setstripe -c 1 $LOG ; fi
# Execute the provided command.
exec nvprof --process-name "$NAME" --context-name "$NAME" -o "$LOG" $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment