Skip to content

Instantly share code, notes, and snippets.

Jeff Larkin jefflarkin

Block or report user

Report or block jefflarkin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jefflarkin
jefflarkin / use_nvtx.cmake
Last active Jul 3, 2018
Simple way to add libnvToolsExt to a cmake project
View use_nvtx.cmake
# This should be added AFTER the FindCUDA macro has been run
IF(USE_NVTX)
IF(HAVE_CUDA)
ADD_DEFINITIONS(-DUSE_NVTX)
LINK_DIRECTORIES("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
LINK_LIBRARIES("nvToolsExt")
ENDIF(HAVE_CUDA)
ENDIF(USE_NVTX)
@jefflarkin
jefflarkin / cpu_profile.sh
Created Oct 18, 2016
OLCF Hackathon Profiling Scripts
View cpu_profile.sh
#!/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 ./cpu_profile.sh ./foo arg1 arg2
# Give each *rank* a separate file
LOG=cpu_profile_$ALPS_APP_PE.nvprof
# Stripe each profile file by 1 to share the load on large runs
if [ ! -f "$LOG" ] ; then
@jefflarkin
jefflarkin / gpio.sh
Last active Apr 13, 2018
BASH functions for using the C.H.I.P. GPIO pins.
View gpio.sh
#!/bin/bash
#FIXME Add usage() function to improve documentation
# Enable exposure of the specified GPIO pin (0-8)
gpio_enable()
{
if [[("$1" -lt 0) || ("$1" -gt 8)]] ; then
echo "Valid pins are 0-8"
return -1;
fi
@jefflarkin
jefflarkin / nvprof_timeline.sh
Last active Jun 5, 2017
Script for gathering an nvprof timeline on a Cray XK7
View nvprof_timeline.sh
#!/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
@jefflarkin
jefflarkin / keybase.md
Created May 28, 2015
Keybase Identify Verification
View keybase.md

Keybase proof

I hereby claim:

  • I am jefflarkin on github.
  • I am jefflarkin (https://keybase.io/jefflarkin) on keybase.
  • I have a public key whose fingerprint is 13D8 BCCC 1A50 57D3 FB4F E33A 950C 167F 0C1A 041D

To claim this, I am signing this object:

@jefflarkin
jefflarkin / nvtx.w
Last active Aug 29, 2015
Script for generating PMPI wrappers for NVTX ranges using https://github.com/scalability-llnl/wrap
View nvtx.w
#include <pthread.h>
#include <nvToolsExt.h>
#include <nvToolsExtCudaRt.h>
// Setup event category name
{{fn name MPI_Init}}
nvtxNameCategoryA(999, "MPI");
{{callfn}}
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
char name[256];
@jefflarkin
jefflarkin / nvtx.F90
Last active Dec 5, 2018
Simple Fortran bindings to a subset of the NVTX library.
View nvtx.F90
! Fortran bindings for a small subset of the NVIDIA Tools Extensions library
module nvtx
use iso_c_binding
public :: nvtxrangepusha, nvtxrangepop
public :: nvtxrangepushaargb
interface
! Annotate the timeline with a message
! Parameters:
! * string : the message in a string format
subroutine nvtxrangepusha(string) bind(C, name="nvtxRangePushA")
@jefflarkin
jefflarkin / app.js
Created Jan 16, 2014
Error I'mm seeing from HAPI hello world example.
View app.js
var Hapi = require('hapi');
var server = Hapi.createServer(process.env.IP,parseInt(process.env.PORT));
// Define the route
var hello = {
handler: function (request) {
request.reply({ greeting: 'hello world' });
}
};
@jefflarkin
jefflarkin / gist:8293839
Created Jan 7, 2014
Example of using Charlieplexing [http://en.wikipedia.org/wiki/Charlieplexing] to control 6 LEDs with an arduino.
View gist:8293839
/** Charlieplexing 6 LEDs with Arduino Uno **/
/** Jeff Larkin [http://github.com/jefflarkin] **/
/*
* Wiring Diagram:
*
* pin 2 ===== led0+, led1- ===== led4+, led5-
* pin 4 ===== led1+, led0- ===== led2+, led3-
* pin 6 ===== led3+, led2- ===== led5+, led4-
*
*/
@jefflarkin
jefflarkin / nvprof.sh
Last active Jan 30, 2017
This script allows for generating nvprof output files based on the hostname of a Cray XK7 compute node.
View nvprof.sh
#!/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
# Give each *node* a separate file
LOG=profile_$(hostname).nvp
# Stripe each profile file by 1 to share the load on large runs
lfs setstripe -c 1 $LOG
You can’t perform that action at this time.