Skip to content

Instantly share code, notes, and snippets.

View yadudoc's full-sized avatar

Yadu Nand Babuji yadudoc

  • University of Chicago
  • Chicago
View GitHub Profile
@yadudoc
yadudoc / gist:5171550
Created March 15, 2013 17:23
Swift copy
# Initial setups.
cp /home/yadunand/swiftdemo.v04.tgz ./
tar -xvzf swiftdemo.v04.tgz
cd swiftdemo
source ./setup.sh
TEST_HOME=$PWD
# Tests
cd test.local
@yadudoc
yadudoc / gist:6393147
Created August 30, 2013 18:55
Test-Results-30/08/2013
Test-Results
==========================================================================
Test home : /scratch/midway/yadunand/swift-0.94RC2/run-2013-08-30/remote_driver-083939/out
Sites successful : 6
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Results for site : run-2013-08-30-uc3-sub.uchicago.edu
GROUPS |RUN |PASS |FAIL |TIME
G1: Language-Working Tests |98 |98 |0 | 199 seconds
G2: Local Tests |7 |7 |0 | 16 seconds
G3: Should-Not-Work Tests |10 |10 |0 | 5 seconds
@yadudoc
yadudoc / teragen.swift
Last active December 22, 2015 20:18
Mapreduce style programming with SwiftT
import files;
import io;
import random;
import string;
import sys;
import location;
import assert;
app (file out, file err) gen_data (file run, int recsize){
"/bin/bash" run recsize @stdout=out @stderr=err
@yadudoc
yadudoc / EMA simulations
Last active January 1, 2016 04:29
Top EMA combinations from simulation
Results from running a simulation with $5000 USD with :
Starting date : 2012-12-31 16:00:00
Ending date : 2013-12-16 05:00:00
Simulation on 1 hour candles from MtGox.
And basic buy threshold set to 1% of price, and sell threshold set to 3%
Format : EMA1, EMA2, EMA3, Final sum in USD
@yadudoc
yadudoc / 2 EMA vs. 3 EMA
Created December 23, 2013 20:00
2-EMA vs 3-EMA comparison. I use a 3-EMA Ruby cross instead of a simple 2-EMA cross. Here's some simple stats which show performance difference on Bitcoin/USD on MtGox.
I ran a parameter sweep backtest with 2 EMA crosses, with EMAs in range 0,70 on
$5000 USD on MtGox.
Starting date : 2012-12-31 16:00:00
Ending date : 2013-12-16 05:00:00
Simulation on 1 hour candles from MtGox.
Here's the results from running simple 2 EMA crosses, sorted by final USD balance
EMA1, EMA2, FINAL_USD
9, 29, 840301.79202999303
@yadudoc
yadudoc / SwiftReduce.md
Last active January 2, 2016 15:29
Swift Reduce - Hadoop

SwiftReduce - Hadoop Comparison

#Hadoop

  • Hadoop streaming uses STDIN to feed data to the mapper and STDOUT picks up data
  • No concept of files, instead each line is treated as a record.

#SwiftReduce

  • Currently mappers take filename as input via STDIN
  • TODO - Mappers to take filepointers in addition to filenames.
@yadudoc
yadudoc / mem_usage.sh
Created January 24, 2014 21:16
Memory usage tracking script for swift runs.
#!/bin/bash
get_last_swift()
{
ps -u $USER | grep swift | head -n 1 | awk -F ' ' '{print $1}'
}
timestamp()
{
@yadudoc
yadudoc / mem_analysis
Created January 30, 2014 00:04
Swift-Memory Analysis
Number of files, File size, no_strings.swift-Used_Heap, no_strings.swift-Crt_Heap, strings.swift-Used_Heap, strings.swift-Crt_Heap
1, 1, 93Mb, 362M, 95Mb, 362Mb
10, 1, 95Mb, 362M, 175Mb, 457Mb
100, 1, 95Mb, 362M, ---Mb, 362Mb
Experiment 2: Lazy ranges.
Assumptions: An int in swift, is 8 Bytes (64 bit). Array is a hashtable with unknown memory pattern.
@yadudoc
yadudoc / swift_hadoop_guide.md
Last active August 29, 2015 13:56
Swift on Hadoop

Swift on Hadoop

The purpose of this guide is to help you setup swift on a hadoop cluster. This would let you execute swiftscripts on the cluster allowing you to go beyond the limitations of MapReduce style workflows.

In current configurations Swift runs in persistent coasters mode on Hadoop. What this means is that, there are two separate Swift entities required to execute a swift run on a hadoop cluster, the Swift-coaster-service which deals with managing workers on the Hadoop cluster and the swift runtime which executes swiftscripts via the Swift-coaster-service.

Get started.

  1. TODO: Setup git repo with KLab app as example
  2. TODO: Move generating fake data to script.
@yadudoc
yadudoc / persistent_coaster.asc
Last active August 29, 2015 13:56
Persistent coasters documentation

Coasters

Coasters is the resource manager for swift. By default, swift uses automatic-coasters, which provisions compute resources for the duration of a swift run based on the directives in the sites file. Persistent coasters, on the other hand allows you to retain an active service separate from the swift runtime across several swift runs. This can be used to hold on to resources in a queue based system, string together a collection of nodes for use as a quick ad-hoc cluster, or help work-around networking issues.

Modes of operation

There are 3 modes of interest when using persistent-coasters

Coaster-service in active mode.