Skip to content

Instantly share code, notes, and snippets.

View rmcgibbo's full-sized avatar

Robert T. McGibbon rmcgibbo

View GitHub Profile

Compiling an optimized ATLAS on Ubuntu 12.04

  1. Download the latest ATLAS source from http://sourceforge.net/projects/math-atlas/files/. I'm using version 3.10.1
  2. Download the latest Netlib LAPACK from http://www.netlib.org/lapack/. I'm using version 3.4.2
  3. Turn off frequency scalings on your chip so that you can get reliable timings. This is essential to get a good ATLAS build
  sudo apt-get install cpufreq-info cpuspeed cpufrequtils sysfsutils
  # set each core to the "performance" governor, so that the clock frequency doesn't go down when idle
  # I have 8 cores, which is why I need to do this 8 times
  sudo cpufreq-selector -c 0 -g performance
@rmcgibbo
rmcgibbo / LICENSE
Last active January 27, 2023 16:33
Propagating 2D dynamics on the Muller potential using OpenMM. OpenMM runs the dynamics in CUDA or OpenCL, so this is pretty snappy.
Copyright 2020 Robert T. McGibbon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE O
@rmcgibbo
rmcgibbo / github_comment_on_commit.py
Created August 23, 2012 07:22
Jenkins setup to automatically comment on github commits with build status
// Using the Jenkins Groovy Post build plugin to execute the following after every build
// https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin
// It would be nice not to have to specify these here... the repo name should be available within the hudson
// api somehow, but I didn't know how to get it. The access token should maybe be saved in a config file, and
// read in at runtime?
GITHUB_REPO_NAME = 'myusername/myreponame'
GITHUB_ACCESS_TOKEN = 'my_github_api_v3_access_token'
@rmcgibbo
rmcgibbo / MPI_ManualReduce.cpp
Last active August 16, 2022 23:15
Efficient MPI Parallel Reduction Without MPI_Reduce or MPI_Scan (only Send/Recv)
/*
* An efficient MPI parallel reduction without MPI_Scan or MPI_Reduce. (i.e.
* only send/recv).
*
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
* 0. You just DO WHAT THE FUCK YOU WANT TO.
*/
#include <mpi.h>
#include <cstdio>
#include <vector>
@rmcgibbo
rmcgibbo / LICENSE
Last active July 24, 2022 02:58
Parallel Sparse Matrix Dense Matrix Product in C/Cython/Python.
Copyright 2013 Robert T. McGibbon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE O
@rmcgibbo
rmcgibbo / neb.py
Created January 30, 2013 03:51
Nudged Elastic Band in Python
from __future__ import division
import numpy as np
import IPython as ip
import matplotlib.pyplot as pp
import warnings
from collections import namedtuple
import scipy.optimize
#symbolic algebra
import theano
@rmcgibbo
rmcgibbo / rmsd.py
Created May 5, 2013 23:43
RMSD calculation, via quaterion-based characteristic polynomial in pure python/numpy. (Rapid calculation of RMSDs using a quaternion-based characteristic polynomial. Acta Crystallogr A 61(4):478-480.)
"""
RMSD calculation, via quaterion-based characteristic polynomial in
pure python/numpy.
Reference
---------
Rapid calculation of RMSDs using a quaternion-based characteristic polynomial.
Acta Crystallogr A 61(4):478-480.
target
@rmcgibbo
rmcgibbo / Install Intel-CPU OpenCL on Ubuntu.md
Last active November 6, 2021 10:00
Installing Intel CPU OpenCL on Ubuntu 12.04

Open Computing Language (OpenCL) is a language and framework for writing computationally intensive kernels that run accross heterogenious platforms, including GPUs, CPUs, and perhaps other more esoteric devices.

Intel provides an OpenCL implementation for Intel CPUs, but there's not a lot of instructions on how to get it set up. Here's what I did.

Installing Intel CPU OpenCL on Ubuntu (12.04)

  1. Download the Intel® SDK for OpenCL* Applications XE 2013 from the Intel website, here http://software.intel.com/en-us/vcsource/tools/opencl-sdk-xe. The download is a tarball -- the one I got is called intel_sdk_for_ocl_applications_2013_xe_sdk_3.0.67279_x64.tgz
  2. Unpack the tarball and cd into the new directory
@rmcgibbo
rmcgibbo / free-slots.py
Last active October 26, 2021 15:04
Summarize free slots on SLURM queues [script].
#!/usr/bin/python
from __future__ import print_function, division
import os
import re
import sys
import itertools
from pprint import pprint
import subprocess
from distutils.spawn import find_executable
from collections import defaultdict