Skip to content

Instantly share code, notes, and snippets.

@jefflarkin
Last active December 16, 2015 01:39
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/5356512 to your computer and use it in GitHub Desktop.
Save jefflarkin/5356512 to your computer and use it in GitHub Desktop.
Quick trick for getting different cuda command-line profiler log files per node 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 ./profile.sh ./foo arg1 arg2
# Enable command-line profiler
export COMPUTE_PROFILE=1
# Set output to CSV (optional)
export COMPUTE_PROFILE_CSV=1
# Give each *node* a separate file
export COMPUTE_PROFILE_LOG=cuda_profile_$(hostname).log
# Stripe each profile file by 1 to share the load on large runs
lfs setstripe -c 1 $COMPUTE_PROFILE_LOG
# Execute the provided command.
exec $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment