Skip to content

Instantly share code, notes, and snippets.

View AndiH's full-sized avatar
🤖
q|^_^|p

Andreas Herten AndiH

🤖
q|^_^|p
View GitHub Profile
@AndiH
AndiH / measure.py
Created August 30, 2023 08:44
GPU Power with Context
import os
import subprocess
import io
import time
import pandas as pd
class GetPower(object):
def __enter__(self):
cmd = "nvidia-smi --query-gpu=index,timestamp,name,power.draw --format=csv --loop-ms=5"
@AndiH
AndiH / .gitignore
Last active April 19, 2021 06:41
Impf Extraction
*.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/make -f
# Makefile for installing OpenMPI
#
# -Andreas Herten, 15 Dec 2017
SHELL = /bin/bash
PRGNAME = openmpi
VERSION = 4.0.1
@AndiH
AndiH / .gitignore
Last active September 30, 2019 16:03
MPI Rank, OpenMP Thread ID, Core ID
omp_id
#!/usr/bin/env bash
_SYSTEMNAME=$(cat /etc/FZJ/systemname)
USERSHELL=/bin/zsh
case $_SYSTEMNAME in
juron)
export SYSTEMNAME="JURON"
;;
juwels)
@AndiH
AndiH / 1.12.0.mk
Last active February 1, 2019 12:11
TensorFlow Build Script
#!/usr/bin/make -f
# Makefile for installing Tensorflow
#
# -Andreas Herten, 1 Feb 2019
SHELL = /bin/bash
NAME = tensorflow
VERSION = 1.12.0
#!/bin/bash
# This file sets the environment variable CUDA_VISIBLE_DEVICES to the MPI local rank to enable multi-GPU usage of this benchmark. Note that this disables any GPU distribution handling by he batch scheduler.
# Background: Most/some batch schedulers set CUDA_VISIBLE_DEVICES to all available GPUs on a node. In that case, the Arbor benchmark would only use the first entry in the list, probably GPU#0. This script changes that.
# -Andreas Herten, Nov 2018
_verbose=1
localrank=$CUDA_VISIBLE_DEVICES
if [[ -n "$OMPI_COMM_WORLD_NODE_RANK" ]]; then
@AndiH
AndiH / simplecounter.py
Last active September 25, 2018 12:40
Python Simple Counter (decorator; explicit function call)
# import inspect
from __future__ import print_function
class Counter(object):
"""Simple counter, counting an invocation my means of a string (explicit call) or function name (decorator)"""
counters = {}
def __init__(self, *args, **kwargs):
"""Construct class. First, check if class is called via a decorator or directly. If true, defer incrementing counter until wrapped function is actually called (see __call__). If false, increment counter now."""
if callable(args[0]):
@AndiH
AndiH / tikz-arrows.pdf
Last active April 23, 2024 01:54
TikZ Arrow Tip Overview
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.