Skip to content

Instantly share code, notes, and snippets.

View tkphd's full-sized avatar
🏳️‍🌈

Trevor Keller tkphd

🏳️‍🌈
View GitHub Profile
@tkphd
tkphd / the-quiet-year.py
Created January 22, 2023 23:19
Random card generator for The Quiet Year
#!/usr/bin/python3
# -*- coding: utf-8 -*-
about = """
A random card generator for The Quiet Year, which ends when 🂮 is drawn.
"""
fleet = """
short game: remove 5 cards from each suit; drop 🃎 but keep 🂮
"""
@tkphd
tkphd / children.py
Last active April 1, 2022 18:19
How often would 983 births produce 453 girls? With a male ratio of 51.47%, I see it in 0.80% of 100,000 samples. Low, but not extraordinary.
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from numpy.random import default_rng
rng = default_rng()
n = int(100_000)
N = int(1_000_000_000)
pop = int(983) # children born in Kiev
@tkphd
tkphd / Moire-sine.ipynb
Created September 13, 2021 15:38
Moiré Patterns with the Sine Function
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tkphd
tkphd / banking.R
Created May 7, 2020 21:20
Simple scripts to play with scope in R and Python
# Ross is a programmer for Megabank, working on a new smartphone app that
# helps users transfer money between accounts. He's relatively new to R,
# the language preferred by the top brass, and is not entirely sure of
# the difference between all the operators available for assigning
# values to variables. Specifically, there's this "scoped assignment" thing
# that sure looks like a harpoon to Ross. What's it for?
# Ross opens a bank account, then uses the app to perform a series of
# transactions. Because he's no fool, he does so in the lobby of a
# Megabank branch, and the bank teller informs him after each step what
@tkphd
tkphd / HPL.dat
Created June 28, 2019 22:14
HPL config for multi-node tests
HPLinpack benchmark input file
Innovative Computing Laboratory, University of Tennessee
HPL.out output file name (if any)
6 device out (6=stdout,7=stderr,file)
1 # of problems sizes (N)
17400 Ns
1 # of NBs
128 NBs
0 PMAP process mapping (0=Row-,1=Column-major)
1 # of process grids (P x Q)
@tkphd
tkphd / HPL.dat
Created June 28, 2019 20:52
HPL config
HPLinpack benchmark input file
Innovative Computing Laboratory, University of Tennessee
HPL.out output file name (if any)
6 device out (6=stdout,7=stderr,file)
1 # of problems sizes (N)
5040 Ns
1 # of NBs
128 NBs
0 PMAP process mapping (0=Row-,1=Column-major)
1 # of process grids (P x Q)
@tkphd
tkphd / vector_addition.cu
Last active May 15, 2019 19:59
CUDA vector addition
/* vector_addition.cu
* Available as a Gist at https://tinyurl.com/y34nfxgc
*/
#include <stdio.h>
#include <cuda.h>
#define N 16
__global__ void vector_addition(int* d_u, int* d_v, int* d_w)

Bottom line: use du --apparent-size to compare information content (independent of filesystems), rather than disk utilization (block-size dependent).

                *Distributed Disk Utilization*
BeeGFS Items Apparent Size per Item On Disk per Item
hsf_0/ 176893 162.0 MB 0.94 KB 100.2 MB 0.58 KB
hsf_1/ 165189 152.5 MB 0.94 KB 93.9 MB 0.58 KB
@tkphd
tkphd / bite-size.tex
Created March 8, 2019 01:16
Modifications for @B0rk's excellent Bite Size Networking to get a proper 2-sided booklet
% Modifications for @b0rk's excellent Bite Size Networking
% to get a proper 2-sided booklet
\documentclass[12pt]{article}
\usepackage{graphicx,pdfpages}
\usepackage[paperheight=11in,paperwidth=8.5in,margin=0in]{geometry}
\pagestyle{empty}
\begin{document}
\begin{figure}\centering
\vskip-1cm
\includegraphics[page=24,width=8.25in,angle=180]{bite-size-networking.pdf}
@tkphd
tkphd / EPYC-vs-Xeon.md
Last active May 24, 2018 21:39
AMD EPYC vs. Intel Xeon Compute Nodes

Compute Node Comparison

Trevor Keller, Ph.D.NIST MML MSED • May 15, 2018

Description

This document summarizes the side-by-side comparison of dual-socket servers:

2× [AMD EPYC 7601][_epyc] vs. 2× [Intel Xeon E5-2697Av4][_xeon].

The AMD system is a testbed, access to which was provided by [KOI Computers][_koic].