Skip to content

Instantly share code, notes, and snippets.

View cmd-ntrf's full-sized avatar

Félix-Antoine Fortin cmd-ntrf

View GitHub Profile
@cmd-ntrf
cmd-ntrf / protobuf-v3.0.0-beta-4.md
Last active July 21, 2016 15:11
Instruction to build TensorFlow for Python 3.5 on Helios
module purge -f
module load apps/git compilers/gcc/4.8.5 apps/buildtools

git clone https://github.com/google/protobuf.git

cd protobuf
export CXXFLAGS='-fPIC'
export CFLAGS='-fPIC'
./configure
from ctypes import CDLL
from ctypes.util import find_library
LIBPAM = CDLL(find_library("pam"))
PAM_STRERROR = LIBPAM.pam_strerror
@cmd-ntrf
cmd-ntrf / bazel_0.3.0.md
Created June 29, 2016 15:40
Bazel 0.3.0 - Helios

Compile Bazel 0.3.0

module purge -f
module load compilers/gcc/4.8.5 compilers/java/1.8 apps/buildtools

cd /software6/apps/bazel
wget https://github.com/bazelbuild/bazel/archive/0.3.0.tar.gz
tar xvf 0.3.0.tar.gz
mv {bazel-,}0.3.0

Compile Bazel 0.2.3

module purge -f
module load compilers/gcc/4.8.5 compilers/java/1.8 apps/buildtools

cd /software-gpu/src/
mkdir bazel023_tensorflow0.8
cd bazel023_tensorflow0.8

TensorFlow with a non-system GCC

Bazel

version : 0.2.2b hash: b74d9b5

module load compilers/java/1.8
module load compilers/gcc/4.8.5 # clumeq group

TensorFlow with a non-system GCC

These instructions were written for our system running CentOS 6.6 using the following SHA of Bazel and TensorFlow:

  • Bazel : c553e35976582ca861040dac3af12c5ed9f11ede
  • TensorFlow : 3972c791b9f4d9a61b9ad6399b481df396f359ff

Requirements

  • GCC 4.6.x or greater
@cmd-ntrf
cmd-ntrf / submit_spark.sh
Created July 15, 2015 19:11
Example to submit an PySpark interactive job on a Torque cluster.
#!/bin/bash -f
#PBS -N apache-spark
#PBS -l nodes=2:ppn=8
#PBS -l walltime=00:01:00:00
#PBS -A <specify account>
# Define variables
SPARK_MASTER="spark://$HOSTNAME:7077"
SPARK_HOME=<specify where is spark installed>
@cmd-ntrf
cmd-ntrf / hash.py
Created October 30, 2014 19:56
Add method to individual in DEAP
from deap import base
from deap import creator
def hash_ind_list(self):
return hash(tuple(self))
creator.create("FitnessMin", base.Fitness, weights=(-1.0,))
creator.create("Individual", list, fitness=creator.FitnessMin, __hash__=hash_ind_list)
@cmd-ntrf
cmd-ntrf / merging_logbooks.py
Last active August 29, 2015 14:07
DEAP example of logbook merging
import numpy
from deap import tools
logbook1 = tools.Logbook()
logbook2 = tools.Logbook()
logbook3 = tools.Logbook()
# Filling the logbooks [...]
@cmd-ntrf
cmd-ntrf / gsl.pyx
Created October 9, 2014 20:18
GSL wrapper to sample Sobol QRNG
from cpython.mem cimport PyMem_Malloc, PyMem_Free
# Declare the few types and functions we need
cdef extern from "gsl/gsl_qrng.h":
ctypedef struct gsl_qrng
ctypedef struct gsl_qrng_type
gsl_qrng_type* gsl_qrng_sobol
gsl_qrng* gsl_qrng_alloc(gsl_qrng_type* T, unsigned int d)
void gsl_qrng_free(gsl_qrng* q)