Skip to content

Instantly share code, notes, and snippets.

View LouisJenkinsCS's full-sized avatar
💭
Fellow of the Department of Energy's Computational Sciences Graduate Fellowship.

Louis Jenkins LouisJenkinsCS

💭
Fellow of the Department of Energy's Computational Sciences Graduate Fellowship.
View GitHub Profile

As important as I believe that privatization is, I believe that the user should be able to privatize their own data structure in a manner that is as painless as possible. However DSI distributions obtain support from both the compiler (remote-value forwarding) and runtime (privatization tables). Seeing how long it is taking for privatization to get more first-class support, I would propose that, at least for the time being, there should be a package (and later standard) module that allows for privatization. As I mentioned in chapel-lang/chapel#10275 (comment), the privatization table in the runtime is extremely minimal, and while there are issues in terms of memory reclamation, I believe the solution to that problem

@LouisJenkinsCS
LouisJenkinsCS / Aggregation.md
Last active July 18, 2018 02:05
Chapel Aggregation API

Aggregation

Aggregation is the grouping of individual units of data into collections of units of data. Aggregation is sometimes necessary for performance when data parallelism cannot be exploited, such as for irregular accesses of data, such as for histograms and graph algorithms. To remedy this, I propose a design for an aggregation library for Chapel, which may well be the first. The library should provide an easy-to-use interface and as well as some performance guarantees.

Privatization

The aggregation library should strive to eliminate as much implicit communication as possible, as so it will be privatized.

Questions to Ask

Aggregation

  • Aggregation Layer - Runtime Approach
    • Built on top of communication layer
      • Has a unique Active Message Handler
    • When to flush aggregated buffers?
      • Buffer is Full
  • Manually by user
use Collection;
class PriorityQueue : CollectionImpl {
var comparator : func(eltType, eltType, eltType);
var dom = {0..1024};
var arr : [dom] eltType;
var size : int;
proc PriorityQueue(type eltType, comparator : func(eltType, eltType, eltType)) {
this.comparator = comparator;
var goodEscapedString = "\"Hello World\"";
var badEscapedString = "\"Hello World";
// This won't be highlighted properly...
for i in 1 .. 10 {
on Locales[here.id] do writeln("Bad Syntax Highlighting...");
}
var endEscapedString = "\"";
// This will be highlighted properly...
for i in 1 .. 10 {
on Locales[here.id] do writeln("Good Syntax Highlighting...");
use GlobalAtomicObject;
use Time;
config const nOpsPerLocale = 1000000;
config const isGlobalAtomic : bool;
config param useOnStmt : bool;
config const isSync : bool;
config const logNodes : bool;
proc syncTest() {
public interface Storeable {
void deserialize(JSONObject data);
JSONObject serialize();
}
public class DatabaseManager {
public store(Storeable data) {
JSONObject json = data.serialize();
byte[] bin = json.toString().toByteArray();
public interface Storeable {
long getId();
void deserialize(byte[] data);
byte[] serialize();
}
public class DatabaseManager {
public store(Storeable data) {
byte[] bin = data.serialize();
// Do something that stores it into a table
c0108000 b .bss
00000000 n .comment
c0108ce8 b .create_stack
c0107000 d .data
00000000 N .debug_abbrev
00000000 N .debug_frame
00000000 N .debug_info
00000000 N .debug_line
00000000 N .debug_loc
00000000 N .debug_macinfo
----- pid 467 at 2015-11-17 20:29:21 -----
Cmd line: system_server
ABI: arm
Build type: optimized
Zygote loaded classes=3593 post zygote classes=2443
Intern table: 38848 strong; 7665 weak
JNI: CheckJNI is off; globals=1884 (plus 21 weak)
Libraries: /system/lib/libandroid.so /system/lib/libandroid_servers.so /system/lib/libaudioeffect_jni.so /system/lib/libcompiler_rt.so /system/lib/libjavacrypto.so /system/lib/libjnigraphics.so /system/lib/libmedia_jni.so /system/lib/librs_jni.so /system/lib/libsoundpool.so /system/lib/libwebviewchromium_loader.so /system/lib/libwifi-service.so libjavacore.so (12)
Heap: 26% free, 23MB/31MB; 305336 objects