Skip to content

Instantly share code, notes, and snippets.

View chathurawidanage's full-sized avatar
🏠
Working from home

Chathura Widanage chathurawidanage

🏠
Working from home
View GitHub Profile
@chathurawidanage
chathurawidanage / array_for_in.js
Last active November 20, 2019 21:19
Iterate over javascript arrays with for in | Performance Comparison [https://gists.cwidanage.com/2019/11/how-to-iterate-over-javascript-arrays.html]
let arr = [1,2,3,4];
for(let i in arr){
let x = i+1;
}
@chathurawidanage
chathurawidanage / array_for_loop.js
Last active November 20, 2019 21:20
Iterate over javascript arrays with for loop | Performance Comparison [https://gists.cwidanage.com/2019/11/how-to-iterate-over-javascript-arrays.html]
let arr = [1,2,3];
for (let i = 0; i < arr.length; i++) {
let x = arr[i] + 1;
}
package com.cwidanage;
import java.util.LinkedList;
import java.util.Queue;
public class KryoTest {
public static Queue<A> queue = new LinkedList<>();
static class A {
@chathurawidanage
chathurawidanage / struct_with_harpc.cpp
Created February 1, 2019 15:43
Example showing how stucts can be used in HarpCPP
#include <iostream>
#include "harp.h"
using namespace std;
using namespace harp;
struct X {
double a;
double b;
};
/*
* Copyright 2013-2017 Indiana University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@chathurawidanage
chathurawidanage / tw2_mvn.js
Created November 14, 2018 15:30
Twister2 mvn artifact script
let fs = require('fs');
let http = require('http');
let crypto = require('crypto');
var algo = 'sha256';
function getSha(file, cb) {
var shasum = crypto.createHash(algo);
var s = fs.ReadStream(file);
from harp.applications import KMeansApplication
import numpy
my_kmeans = KMeansApplication('My Harp KMeans with Harp')
my_kmeans.args("1000 10 100 5 2 2 10", "/kmeans", "/kmeans", "allreduce")
# sets following variables mentioned in docs : https://dsc-spidal.github.io/harp/docs/getting-started/
# <num of points> <num of centriods> <vector size> <num of point files per worker> <number of map tasks> <num threads><number of iteration>
# <work dir>
# <local points dir>
./bin/twister2 submit nomad jar examples/libexamples-java.jar edu.iu.dsc.tws.examples.harp.HelloHarp
@chathurawidanage
chathurawidanage / t2_mpi_error.txt
Created September 27, 2018 14:48
t2_mpi_error
twister2-core/ompi/bin/mpirun: Symbol `orte_rml' has different size in shared object, consider re-linking
[chathura-OptiPlex-960:07828] *** Process received signal ***
[chathura-OptiPlex-960:07828] Signal: Segmentation fault (11)
[chathura-OptiPlex-960:07828] Signal code: Address not mapped (1)
[chathura-OptiPlex-960:07828] Failing at address: 0x1
[chathura-OptiPlex-960:07828] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7fe854d62f20]
[chathura-OptiPlex-960:07828] [ 1] /opt/openmpi-3.0.0/build/lib/libopen-rte.so.40(orte_util_print_name_args+0x14)[0x7fe855446d24]
[chathura-OptiPlex-960:07828] [ 2] /opt/openmpi-3.0.0/build/lib/libopen-rte.so.40(orte_rml_API_send_buffer_nb+0x2d)[0x7fe8554a0bfd]
[chathura-OptiPlex-960:07828] [ 3] twister2-core/ompi/bin/mpirun(+0x10d1)[0x55b19dc100d1]
[chathura-OptiPlex-960:07828] [ 4] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fe854d45b97]
./bin/twister2 submit nodesmpi jar examples/libexamples-java.jar edu.iu.dsc.tws.examples.basic.comms.ExampleMain -itr 100 -workers 4 -size 1000 -op "gather" -stages 8,1