Questions tagged [chapel]

Chapel (https://chapel-lang.org) is a portable, open-source programming language for parallel programming from the desktop to large-scale supercomputers. Use this tag to ask questions about the Chapel language or its implementation that are likely to be of use to a broad audience. To make user-specific bug reports or feature requests, please use Chapel's Github issues page instead (https://github.com/chapel-lang/chapel/issues).

Chapel, the Cascade High Productivity Language, is a parallel programming language, developed by Cray Inc.


Characteristics :

productive: . . . . code tends to be similarly readable/writable as Python
scalable: . . . . . . runs on laptops, clusters, the cloud, and HPC systems
fast: . . . . . . . . . . performance competes with or beats C/C++ & MPI & OpenMP
portable: . . . . . . compiles and runs in virtually any *nix environment
open-source: . . hosted on GitHub, permissively licensed


How Does Chapel Boost Productivity?

Chapel improves the programmability of parallel computers by providing a higher level of expression than current programming languages do, and by improving the separation between algorithmic expression and data structure implementation details. Chapel provides a global namespace, permitting tasks running on one compute node to refer directly to variables stored in the memories of remote compute nodes. It also supports a general and dynamic model of parallelism in which new tasks can be created, locally or remotely, at any point during a program's execution.


Interactive Supercomputing for Data Science in Chapel on HPC ?

Whereas the culture of HPC tends to eschew interactivity in favor of compiled programs and batch jobs, thanks to Dr. Reus and his colleagues from U.S. DoD, there is a bridge - Arkouda - a Python library for interactive data science that supports familiar NumPy and Pandas routines that are implemented in Chapel to run fast and scalably from the desktop to thousands of compute nodes or processor cores.


Mastering Chapel :

For easy experimentation with the Chapel language, there is an on-line programming and code-execution ecosystem supported by Attempt This Online, so one need not wait for a new HPE Cray supercomputer to be delivered or to install it themselves, before experimenting with the language.

Chapel supports a multi-threaded parallel programming model at a high level, by supporting abstractions for data parallelism, task parallelism, and nested parallelism. It enables optimizations for the locality of data and computation in the program via abstractions for data distribution and data-driven placement of subcomputations. It allows for code reuse and generality through object-oriented concepts and generic programming features. For instance, Chapel allows for the declaration of locales and allows to use explicit syntax-constructors to direct the parts of the computations to take place on respective locale instances.


Tools for Parallel HPC Code Execution Performance Tuning :

Chapel language environment also delivers tools for exploring and monitoring the run-time state performance factors of the distributed computing process, which is being executed over multi-node physical computing infrastructure.

enter image description here

While Chapel borrows concepts from many preceding languages, its parallel concepts are most closely based on ideas from High Performance Fortran (HPF), ZPL, and the Cray MTA's extensions to Fortran and C. Language specification and documentation is being maintained here.

Chapel is being developed as an open source project hosted on GitHub, under the Apache license.

The recent Annual 2020 CHIUW Conference announcements show both productivity and performance boosts from using Chapel in scientific and other HPC tasks. enter image description here Having boosted even further above the Universal Parallel C [UPC] in optimised code for larger computing fabrics, as was demonstrated in Nikhil Padmanabhan's talk - getting the performance beyond 9.7 [Top/s] on 512-locale x 36-cores system

The recent Annual 2019 CHIUW Conference slides showing Chapel achievements, performance advantages over MPI-code, current state of Chapel-on-GPU/NUMA-computing and also the outlook for 2018-2021

Previous CHIUW Conferences on HPC use-cases where shown its powers, productivity and excellence

247 questions
5
votes
1 answer

Initializing Chapel Atomic Instance Variables

Last year the solution to a problem was to make my instance variables atomics to ensure other tasks would see their changes. (While loop in a method gets stuck. Adding an assignment of a field to itself fixes the issue) This year I'm replacing my…
Kyle
  • 554
  • 3
  • 10
5
votes
2 answers

Output precision of `writeln()` for floating-point numbers

Using writef(), I can control the output precision of a floating-point number, for example: writef( "%20.15dr\n", 1.0 / 3.0 ); // 0.333333333333333 but if I use writeln() for convenience, the number is output with 6 digits: writeln( 1.0 / 3.0…
roygvib
  • 7,218
  • 2
  • 19
  • 36
5
votes
1 answer

How can I pass a Chapel string to a C function that requires (non-const) char*?

Suppose I have a Chapel string var s : string; How would I send it to a function that expects a char*(since c_string assumes const char *)?
5
votes
1 answer

Is there a way to customize the default parallelization behavior of whole-array statements in Chapel?

According to the available documentation for Chapel, (whole-)array statements like A = B + alpha * C; // with A, B, and C being arrays, and alpha some scalar are implemented in the language as the following forall iteration: forall (a,b,c) in…
user10172900
5
votes
1 answer

Rank-independent code: array and domain from list of sizes

So of course it's easy to create a domain (and from that, an array) with fixed known rank and array of sizes, proc do_something(sizes: [1..2] int) { const D: domain(2) = {1..sizes[1], 1..sizes[2]}; var arr: [D] int; // ... } But what does…
Jonathan Dursi
  • 50,107
  • 9
  • 127
  • 158
5
votes
2 answers

How to keep a list of acceptable types for comparison in Chapel

Suppose I have class Student, BadStudent:Student, GoodStudent:Student and ExcellentStudent: Student. I want a class method to only operate on Good and Exceptional students. Something like: class AdvancedBasketWeaving { // this is the question: …
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
5
votes
2 answers

Can type instantiation be separated from value instantiation?

In C++, I can instantiate a generic type at compile time and then construct it at runtime: struct Vertex {}; struct Edge {}; template struct Wrapper { IdType id; Wrapper(IdType id) : id{id} {}; }; int…
Marcin Zalewski
  • 512
  • 3
  • 8
5
votes
2 answers

Domain resizing on an array of records hangs

I have a hypergraph data structure with two arrays, one for edges, and one for vertices (similar to bipartite graph). I have a problem with resizing the arrays, so I tried the simplified example: ar dom = {0..0}; var arr: [dom]…
Marcin Zalewski
  • 512
  • 3
  • 8
5
votes
1 answer

While loop in a method gets stuck. Adding an assignment of a field to itself fixes the issue

Starting our Semaphore project, I gave my students a bad version of the p() method: proc p() { while (this.tokens <= 0) { sleep(1); writeln("Tokens: ", this.tokens); } this.tokens -= 1; } I give them some additional…
Kyle
  • 554
  • 3
  • 10
5
votes
1 answer

Extract DSI array class from dmapped array instance?

I'm doing some performance testing on a custom distribution hierarchy, and I need to access the array class that backs a mapped array. I can access the backing domain through array.domain, but there doesn't seem to be anything for the backing array…
5
votes
2 answers

improving bigint write to disk performance

I am working with really large bigint numbers and I need to write them to disk and read them back later because they won't all fit in memory at a time. The current Chapel implementation first converts the bigint to a string and then writes that…
zx228
  • 93
  • 4
5
votes
1 answer

Is it possible to declare an array with config?

Or any similar data structure of dynamic length, which, can be cast easily to an array. The only workaround I have found is entering the array as a string and manually parsing it. config var not_array: string = '[1,2,3,4,5]' ; proc main() { //…
uqtredd1
  • 187
  • 3
5
votes
1 answer

Nested reductions -- what is the most idiomatic way to write these in Chapel?

Chapel reductions currently ignore the initial values of variables. That means this code var x: int; for i in 1..3 { forall j in 1..10 with (+ reduce x) { x += 1; } } writeln(x); returns 10 and not 30, as this user naively thought. While…
5
votes
1 answer

Incremental compilation in Chapel

I have been learning Chapel with small programs and they are working great. But as a program becomes longer, the compilation time also becomes longer. So I looked for the way to compile multiple files one by one, but not with success yet. By…
roygvib
  • 7,218
  • 2
  • 19
  • 36
5
votes
1 answer

Gathering info about GASNet communicative operations in Cray Chapel

Working on a basic profiler which will gather start and finish time of GASNet communicative operations in Cray Chapel. Only idea which came in mind was to insert instructions in Chapel comm functions to get function call time. Is there any way to do…
dreamca4er
  • 381
  • 3
  • 14
1
2
3
16 17