Skip to content

Instantly share code, notes, and snippets.

View ben-albrecht's full-sized avatar

Ben Albrecht ben-albrecht

View GitHub Profile
/* Dynamic dispatch in Chapel */
{
/*
This is not a bug.
Chapel only support virtual method dispatch, not multiple dispatch
*/
class A { }
class B: A { }
use IO;
use LayoutCS;
proc csrDomain(handle: channel) {
var rows: int, cols: int, nnz: int;
handle.read(rows);
handle.read(cols);
handle.read(nnz);
var indices: [1..nnz] (int, int);
var V = [0,0,0];
var T = (1,2,3);
// Works
V = T;
writeln(V);
V = 0;
// Works

Tiny (354 recipes)

date
Thu Nov 30 11:31:35 EST 2017
./yummly --memLeaks --data=test/data/train.tiny.json  --output=crystals.txt --inflations=inflation.txt --ecdf_threshold=0.99
        loading graph
        ...time to load matrix: 1.19049
Original size: 354  vs.size: 350
        ...time to build crystals: 17.4213
# ~/.bashrc excerpt
# alias for compiling Chapel w/ MKL (for LinearAlgebra support)
export CFLAGS = "$CFLAGS -I /opt/intel/mkl/include"
export LDFLAGS = "$LDFLAGS -L /opt/intel/mkl/lib"
alias chkl="chpl ${CFLAGS} ${LDFLAGS} -llapack -lblas --ccflags -Wno-enum-conversion -sisBLAS_MKL=true"
/* Printing pretty colors in Chapel */
module Colors {
// C color codes
param RESET = "\x1B[0m",
BOLD = "\x1B[1m",
UNDERLINE = "\x1B[4m",
GRN = "\x1B[32m",
YEL = "\x1B[33m",
BLU = "\x1B[34m",
use Time;
use IO;
config const toolbarWidth = 40;
proc main() {
const D = {1..1000000};
var arr: [D] real;
writeln('Populating array');
@ben-albrecht
ben-albrecht / pychapel-osx.patch
Created August 7, 2017 16:14
Patch to PyChapel to make OSX work
diff --git a/module/configs/pych.json b/module/configs/pych.json
index 82f3b00..2d1019d 100644
--- a/module/configs/pych.json
+++ b/module/configs/pych.json
@@ -81,7 +81,6 @@
"cflags": [
"--fast",
"--library",
- "--static",
"-searlyShiftData=false"
@ben-albrecht
ben-albrecht / pychapel-osx.patch
Created August 7, 2017 16:14
Patch to PyChapel to make OSX work
diff --git a/module/configs/pych.json b/module/configs/pych.json
index 82f3b00..2d1019d 100644
--- a/module/configs/pych.json
+++ b/module/configs/pych.json
@@ -81,7 +81,6 @@
"cflags": [
"--fast",
"--library",
- "--static",
"-searlyShiftData=false"