Skip to content

Instantly share code, notes, and snippets.

View smutch's full-sized avatar

Simon Mutch smutch

View GitHub Profile
@smutch
smutch / transform_and_reference-MPI.c
Created October 26, 2013 08:42
c: exploring 3d parallel ffts with FFTW
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#include <mpi.h>
#include <complex.h>
#include <fftw3.h>
#include <fftw3-mpi.h>
/*
@smutch
smutch / test.c
Created June 16, 2014 23:41
c: Test compilation code for Paul
/*
* Test code
* GistID:3f6fb4b2ef632906fe37
*
* Complie with:
* /usr/local/x86_64/gnu/openmpi-1.6.1/bin/mpicc -lhdf5 -lhdf5_hl -o test test.c
*
* Run with:
* ./test
*
@smutch
smutch / read_grids.py
Created July 30, 2014 04:44
python: example grid plotting script for Meraxes
#!/usr/bin/env python
"""Simple test script showing how to read / plot slices from Meraxes grids."""
import numpy as np
import matplotlib.pyplot as plt
from ssimpl import meraxes
# path to meraxes file and snapshot to read
fname = "/path/to/meraxes.hdf5"
@smutch
smutch / example_grid_read.c
Created July 30, 2014 04:59
c: example read for a Meraxes grid
#include <stdlib.h>
#include <hdf5.h>
#include <hdf5_hl.h>
#include <math.h>
int main(int argc, char *argv[])
{
hsize_t dims[1];
size_t type_size;
H5T_class_t class_id;
@smutch
smutch / smf.py
Created September 2, 2014 04:19
py: basic SMF plot with ssimpl & Meraxes
#!/usr/bin/env python
"""Plot the stellar mass function."""
import numpy as np
import matplotlib.pyplot as plt
from ssimpl import meraxes, munge
# if you want to use the plot style that I often use then uncomment these lines
# from ssimpl import plotutils
@smutch
smutch / SConstruct
Last active August 29, 2015 14:06
c: test split MPI_Comm with gbpSID
import os
env = Environment(env=os.environ)
env.Replace(CC = "mpicc")
env.AppendUnique(CFLAGS = ["-std=gnu99"])
libs = {}
libs["gbpCode"] = {"I" : "~/3rd_party/gbpCode/myInclude",
"L" : "~/3rd_party/gbpCode/myLib/mpi",
@smutch
smutch / plot_smf.py
Last active March 22, 2017 13:26
py: simple SMF plot from Meraxes data (for new python users)
#!/usr/bin/env python
"""A simple example of plotting the stellar mass function (SMF) from Meraxes
output."""
# First off, import the packages we need
import numpy as np # work horse package for numerical work in python
import matplotlib.pyplot as plt # plotting library
# DRAGONS modules for reading and dealing with model ouput
@smutch
smutch / tmux.md
Last active August 29, 2015 14:08 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@smutch
smutch / read_grid.c
Created January 15, 2015 10:34
c: simple read of gbpCode grid
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#define SNAPSHOT 99
#define INPUT_DIR "/home/gpoole/SSimPL/simulations/GiggleZ/GiggleZ_HR/grids/"
/**
* Compile with: