{'fraction_non_alphanumeric': 0.017578125, 'fraction_numerical': 0.0026041666666666665, 'mean_word_length': 5.099206349206349, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Type System for Distributed Arrays

Multicore systems with non-uniform memory are of increasing importance in desktop and server computing. Such systems represent both potentially vast computing power and significant research problems in expressing and maximizing parallelism, which has prompted researchers to design new languages such as X10, Fortress, and Chapel. Common to these languages is support for location-aware programming, which gives the programmer control over the location of both data and computations. One primary data structure in these languages is the distributed array, which elevates the location of individual array elements to a language concept. A location-aware algorithm executing on a particular core must be designed to exploit the locality of the distributed array, because access to remote data is far slower than to local data. In this paper, we solve the open problem of statically checking whether such a program has achieved the desired locality of access. We present a statically-typed core language in which a well-typed program only accesses local parts of distributed arrays and every array access is within the array bounds. The type system integrates dependent types and set constraints, with the key operation during type checking being constraint entailment. Type checking for this system is co-NP-complete. We have integrated our type system into the object-oriented language X10 and shown that for seven benchmarks, a programmer needs insert only a few casts to make a program type check.