Skip to content

Instantly share code, notes, and snippets.

@christophernhill
christophernhill / nf90io_mitgcm_test_20170807.sh
Last active August 9, 2017 03:11
Bits and pieces to do with setting up a container for testing NF90io
# Make sure system drive has some free space
# Setup docker
curl -fsSL https://get.docker.com/ | sh
systemctl enable docker
systemctl start docker
# Fetch an image from Docker hub
docker pull centos:7.3.1611
@christophernhill
christophernhill / push_mitgcm_testreport_image_to_dockerhub.sh
Last active August 11, 2017 13:58
Code for pushing MITgcm testreport image to dockerhub
docker run --name centos_base-7.3.1611 -d -t centos:7.3.1611 /bin/bash
docker exec -t -i centos_base /bin/bash
# in container
yum -y install epel-release
yum -y install environment-modules
yum -y install which make m4 bc
yum -y install gcc gcc-gfortran
yum -y install mvapich2-2.2 mvapich2-2.2-devel
yum -y install mpich-3.2 mpich-3.2-devel
yum -y install mpich mpich-devel
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
./letsencrypt-auto certonly --standalone -d mit-12-010-fall2019.cyberinfrastructure.org.tld
key: /etc/letsencrypt/live/mit-12-010-fall2019.cyberinfrastructure.org.tld/privkey.pem
cert: /etc/letsencrypt/live/mit-12-010-fall2019.cyberinfrastructure.org.tld/fullchain.pem
# Julia code for Helmholtz solve with tridiag Neumann in inner dimension and
# periodic in outer up to 2 dimensions.
# Set environment
using Pkg
Pkg.add("LinearAlgebra")
using LinearAlgebra
Pkg.add("FFTW")
using FFTW
## Functions for eigvfft notebook.
## to use: include("./eigvfft.jl")
# Set environment
using Pkg
Pkg.add("LinearAlgebra")
using LinearAlgebra
Pkg.add("FFTW")
include("./eigvfft-for-oliver.jl");
IJulia.clear_output();
dz=ones(4,1)[:];dz[1]=4.;dz
dz=[1.,2.,3,4.]
# dz=[ones(1,10) ones(1,20)*2 ones(1,100)*5 ]
Az=mkA_N(dz);Nz=size(Az,1)
Ah,Nx,Ny,Nzz,NN=mkA_PPN(3,3,1);
Nh=size(Ah,1);
@christophernhill
christophernhill / cuml-tsne.py
Last active January 27, 2020 04:34
Code fragments for Satori Speed Up Green Up Hackathon during IAP 2020
# demo for profiling python using command
#
# nvprof --print-gpu-trace python cuml_tsne.py
from sklearn.datasets import load_digits
X, y = load_digits().data, load_digits().target
from cuml.manifold import TSNE
tsne = TSNE(n_components = 2)
X_hat = tsne.fit_transform(X)
@christophernhill
christophernhill / batch-job-example.lsf
Last active January 28, 2020 15:34
Satori IAP 2020 energy profiling code fragments from Florin
#BSUB -L /bin/bash
##
## Begin LSF Directives (change only no of required GPUs processes/GPUs and job-name-single name as desired/need)
## - "-n 4" for single AC922, "-n 8" for 2x AC922s, "-n 16" for 4x AC922s etc
##
#BSUB -J "energy-ai"
#BSUB -o "energy-ai_o.%J"
#BSUB -e "energy-ai_e.%J"
#BSUB -n 16
#BSUB -R "span[ptile=4]"
@christophernhill
christophernhill / plot-gh-pr-open-close-rate.py
Created February 10, 2020 02:24
Plot repo Github PR open v close rates
import requests
import time
import json
from github import Github
import pandas as pd
import os
gt = os.getenv('GIT_TOKEN') # Get this from your Github Oauth tokens
print(gt)
# Get list of all PRs