Skip to content

Instantly share code, notes, and snippets.

@christophernhill
christophernhill / all_dirs_list.txt
Last active April 17, 2023 15:15
Experimenting with HRA download
HRR339728
HRR339729
HRR339730
HRR339731
HRR339732
HRR339733
HRR339734
HRR339735
HRR339736
HRR339737
@christophernhill
christophernhill / chris01.jl
Created January 29, 2023 02:54
DJ 4 Earth Onan Enzyme Field only
using Pkg
Pkg.add("Enzyme")
Pkg.add("Oceananigans")
using Enzyme
using Oceananigans
# Lets create a one-dimensional array, with N elements, using Oceananigans data structures
#
@christophernhill
christophernhill / setup_and_test_julia_mpi.slurm
Created July 18, 2022 01:48
Gist example of Julia with system MPI on a cluster for Matin and Sana
#!/bin/bash
#
# ==
# == Typical run command for this script
# ==
# $ cat setup_and_test_julia_mpi.slurm | sbatch -p sched_mit_darwin2 -N 2 --exclusive --time=0-12:00:00
#
#
# == Activate cluster MPI
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@christophernhill
christophernhill / mpi_basic.sbatch
Last active February 16, 2022 21:44
Quick test of engaging IB
#!/bin/bash
# sbatch -p sched_mit_darwin2 -N 2 -n 24 --mincpus=12 --cores-per-socket=12
cd /nfs/cnhlab001/cnh/projects/mpi-test/argonne-tests/barrier
scontrol -o show node=${SLURM_STEP_NODELIST} | awk '{print $1}' | awk -F= '{print $2}' | awk '{print $1" slots=12"}' > hf
module purge
module load gcc/9.3.0
module load openmpi/4.0.5
module load ucx/1.9.0
cat > barrier.c <<EOF
@christophernhill
christophernhill / p6face.jl
Created June 20, 2021 13:01
Quick six face plot
using Plots
pyplot()
struct Corner end
ts=f["timeseries/η"] |> keys
ncs=32
cmap_id=:bwr
cmap_id=:jet1
@christophernhill
christophernhill / stretchy-solver.jl
Created June 1, 2021 13:31
Hmm a stretched grid FFT solver - is that possible?
# Setup environment
using Pkg
Pkg.add("PyPlot")
using PyPlot
Pkg.add("Printf")
using Printf
Pkg.add("LinearAlgebra")
using LinearAlgebra
Pkg.add("FFTW")
using FFTW
@christophernhill
christophernhill / onan-prov.src
Last active July 7, 2021 19:07
Provision directory on Mac for current oceananigans validation/ examples
alias julia=~/projects/julia-1.6.1/bin/julia
plat="Linux"
alias julia=/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
plat="MacOSX"
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-${plat}-x86_64.sh
# To set up MPI may need
# /home/ubuntu/projects/julia-1.6.1/bin/julia -e 'using Libdl; p=dlopen("libmpi", RTLD_LAZY; throw_error=false); p=dlopen("libmpi", RTLD_LAZY; throw_error=false); using Pkg; Pkg.build("MPI"; verbose=true)'
chmod +x Miniconda3-latest-${plat}-x86_64.sh
@christophernhill
christophernhill / Dockerfile
Last active May 26, 2021 00:11
Dockerfile that creates environment for Ali's cube sphere Oceananigans with plotting etc....
FROM julia:1.6.1
RUN apt-get update && apt-get install -y hdf5-tools
RUN apt-get install -y ffmpeg
RUN apt-get install -y git
RUN apt-get install -y wget
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN chmod +x Miniconda3-latest-Linux-x86_64.sh
RUN ./Miniconda3-latest-Linux-x86_64.sh -b -p miniconda3
@christophernhill
christophernhill / list-couple-run-bucket.py
Last active January 19, 2022 03:45
OSN stuff for Jim, Ali, Ryan
# ./Miniconda3-latest-Linux-x86_64.sh -b -p ./miniconda3
# source miniconda3/bin/activate
# conda create -n py38 python=3.8
# conda activate py38
# conda install s3fs
# conda install xarray
# conda install dask
# conda install fsspec
# conda install zarr
# conda install requests aiohttp