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
1
vote
1 answer

How to maintain sub-type of an object in a Chapel array

Following up on an earlier SO question, now I want to collect the Fruit into a basket but know the sub-type on the way out. class Banana : Fruit { var color: string; } class Apple: Fruit { var poison: bool; } class Fruit { } var a = new…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
2 answers

How to check subclass in Chapel

This one is probably really stupid. How do you check the subclass of an object in Chapel? class Banana : Fruit { var color: string; } class Apple: Fruit { var poison: bool; } class Fruit { } var a = new Apple(poison=true); var b = new…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

How to iterate over objects indexed by a domain in Chapel

I have a set of objects var Players: [domain] Player and I'd like to iterate over the objects in reverse order. Something like This works for p in Players by { writeln(p.name); writeln("I was the %i st player added".format(p.pid)") // pid…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

Iterate a domain in reverse in Chapel

Chapel has a reverse() operator for arrays, but I can't seem to make it work on domains var v = {1..8}; for w in v { writeln(w); } // poops for w in reverse(v) { writeln(w); } How do I go backwards?
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

How to iterate non-zeroes in a sparse matrix in Chapel

I have a matrix A still hanging around. It's large, sparse and new symmetric. I've created a sparse domain called spDom that contains the non-zero entries. Now, I want to iterate along row r and find the non-zero entries there, along with the…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

Custom rowSums of a Matrix in Chapel

Following up on this question. I have a Matrix (yes, I do) which will be large and sparse. A = [ [0, 0, 0, 1.2, 0] [0, 0, 0, 0, 0] [3.5, 0, 0, 0, 0] [0 7, 0, 0, 0] ] And I want to create a vector v that has the sum…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
2 answers

ZeroMQ with Chapel And Python, cannot answer in current state

I can't be sure where the error lies, but I'm attempting to pass messages between a Python client and a Chapel server. The client code is import zmq context = zmq.Context() socket =…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

Counting the number of true elements in a bool array

In Chapel, I can count the number of array elements equal to a given value as var a = [1,2,5,5,5]; writeln( a.count( 5 ) ); // this gives 3 but a similar method does not seem to work for counting the number of true elements: writeln( count( a > 1…
user4834273
1
vote
1 answer

Can one create an object to store multiple domains?

I have some code which I think should look like: on Locales[0] { var slice: domain(1) = {0..#widthOfLocaleMatrix}; on Locales[1] { slice(0) = A.localSubdomain(); } var localSlice: [slice(0)] int = A[slice(0)]; } Basically, I am trying…
barrymoo
  • 140
  • 3
1
vote
1 answer

`forall` expression: parallel or serial calculation?

My understanding of forall statements is that they are executed in parallel, while for statements are executed in serial. Indeed, the following code seems to confirm this expectation (i.e., a random sequence only for forall because of…
roygvib
  • 7,218
  • 2
  • 19
  • 36
1
vote
1 answer

Chapel Iteration

Working on chapel currently and trying to iterate through an array hi of type: eltType called elements and it has elements in it. I am trying to iterate through the whole array hi and print out each element so I'm doing: var hi : int; hi =…
insta catering
  • 151
  • 2
  • 12
1
vote
2 answers

How to specify a return of an array of unknown size in Chapel

I tried to rely on type inference for a function with signature: proc mode(data: [?]int) but the compiler said it could not resolve the return type (which is a warning in in itself I guess given there are only two return statements). I…
Russel Winder
  • 3,436
  • 1
  • 17
  • 12
1
vote
1 answer

Chapel Gasnet unexpected EOF while looking for matching `''

Using Chapel 1.13.1, Gasnet 1.26.4, Fedora release 24 Trying to run the hello6-taskpar-dist.chpl, produces an error: login_node> ./a.out -nl 1 bash: -c: line 0: unexpected EOF while looking for matching `'' bash: -c: line 1: syntax error:…
0
votes
1 answer

How should I resolve this domain error in Chapel?

Consider this code: proc generateTuples(a: int, b: int, bNext: int): [] { var tuples: [1..?] (int,int); for q in (b+1)..(bNext-1) { tuples.push([a, q]); } return tuples; } proc mergeLists(l1: [(int,int)], l2: [(int,int)]): [(int,int)]…
0
votes
1 answer

Good example Chapel code for bad memory management?

Is there some good example code to show poor memory management (e.g. the programmer assumes there is garbage collection)? I would like to demonstrate this during class. The VM we're using has 16 available hardware threads.
Kyle
  • 554
  • 3
  • 10
1 2 3
16
17