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
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.
The aggregation library should strive to eliminate as much implicit communication as possible, as so it will be privatized.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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..."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----- 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 |