Skip to content

Instantly share code, notes, and snippets.

using Distributed
using DelimitedFiles
@everywhere using StaticArrays
@everywhere using SharedArrays
import Base.+
@everywhere const POINT_SIZE = 100
# Type alias for Point type
@everywhere const Point = SVector{POINT_SIZE, Float64}
use Random;
use Time;
use BlockDist;
use CyclicDist;
use ReplicatedDist;
use CommDiagnostics;
/* Config variables */
config const filename = "../data/test_10_10_2.chpl.txt";
config const outFilename = "out.txt";
use Random;
use Time;
use BlockDist;
/* Config variables */
config const filename = "../data/test_10_10_2.chpl.txt";
config const outFilename = "out.txt";
config const k = 2;
config const maxIter = 10;
config const numPoints = 10;
This file has been truncated, but you can view the full file.
using DelimitedFiles
using StaticArrays
import Base.+
const POINT_SIZE = 100
# Type alias for Point type
const Point = SVector{POINT_SIZE, Float64}
# Datatypes
using DelimitedFiles
using StaticArrays
const POINT_SIZE = 100
# Type alias for Point type
const Point = SVector{POINT_SIZE, Float64}
# Datatypes
mutable struct Cluster
size::Int64
This file has been truncated, but you can view the full file.
1.184894E+04 5.654326E+04 5.907482E+05 -9.846318E+02 -2.163987E+03 8.007838E+02 8.613457E+19
4.982234E+04 4.927830E+05 -2.350271E+05 -1.549084E+02 -2.905466E+03 -1.378157E+03 6.630254E+20
-6.140187E+04 3.148604E+05 1.192126E+04 -2.298229E+03 1.446356E+03 -1.952097E+02 1.461500E+20
-3.712425E+05 4.299456E+05 -2.676301E+05 1.842154E+03 -2.505566E+03 1.558639E+03 7.460969E+20
1.678310E+05 -5.357696E+05 -1.940057E+05 1.391965E+03 -7.285908E+02 -2.301435E+03 8.141498E+20
-3.143823E+05 -2.902738E+04 5.492425E+05 1.674761E+03 -1.759690E+03 2.537564E+03 3.805597E+20
4.244213E+04 4.411015E+05 1.306613E+05 2.277845E+03 -1.964589E+03 -1.876921E+03 8.725240E+20
-5.679920E+03 5.688436E+05 3.643281E+05 -1.487858E+03 -2.505441E+02 1.884941E+03 1.675821E+20
5.821950E+05 4.850269E+05 -1.505871E+05 -2.506206E+03 -7.524069E+02 2.988431E+02 3.416489E+20
This file has been truncated, but you can view the full file.
1.184894E+04 5.654326E+04 5.907482E+05 -9.846318E+02 -2.163987E+03 8.007838E+02 8.613457E+19
4.982234E+04 4.927830E+05 -2.350271E+05 -1.549084E+02 -2.905466E+03 -1.378157E+03 6.630254E+20
-6.140187E+04 3.148604E+05 1.192126E+04 -2.298229E+03 1.446356E+03 -1.952097E+02 1.461500E+20
-3.712425E+05 4.299456E+05 -2.676301E+05 1.842154E+03 -2.505566E+03 1.558639E+03 7.460969E+20
1.678310E+05 -5.357696E+05 -1.940057E+05 1.391965E+03 -7.285908E+02 -2.301435E+03 8.141498E+20
-3.143823E+05 -2.902738E+04 5.492425E+05 1.674761E+03 -1.759690E+03 2.537564E+03 3.805597E+20
4.244213E+04 4.411015E+05 1.306613E+05 2.277845E+03 -1.964589E+03 -1.876921E+03 8.725240E+20
-5.679920E+03 5.688436E+05 3.643281E+05 -1.487858E+03 -2.505441E+02 1.884941E+03 1.675821E+20
5.821950E+05 4.850269E+05 -1.505871E+05 -2.506206E+03 -7.524069E+02 2.988431E+02 3.416489E+20
config const filename = "../data/input.txt";
config const out_filename = "out.txt";
config const iterations = 1;
config const k = 2;
var f = open(filename, iomode.r);
var reader = f.reader();
const rows = reader.read(int);
const cols = reader.read(int);
use CyclicDist;
use Time;
config const filename = "input.txt";
config const iterations = 1;
config const out_filename = "out1.txt";
const X = 1;
const Y = 2;
const Z = 3;
const G = 6.67e-11;