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
14
votes
3 answers

How to make multi-threading in Julia scale with the number of threads?

I know that questions about multi-threading performance in Julia have already been asked (e.g. here), but they involve fairly complex code in which many things could be at play. Here, I am running a very simple loop on multiple threads using Julia…
prosoitos
  • 6,679
  • 5
  • 27
  • 41
7
votes
1 answer

Chapel-Python integration questions

I'm trying to see if I can use Chapel for writing parallel code for use in a Python-based climate model: https://github.com/CliMT/climt I don't have any experience with Chapel, but it seems very promising for my use-case. I had a few questions about…
7
votes
2 answers

Is there any writef() format specifier for a bool?

I looked at the writef() documentation for any bool specifier and there didn't seem to be any. In a Chapel program I have: ... config const verify = false; /* that works but I want to use writef() to also print a bunch of other…
6
votes
3 answers

Suggest a text editor or IDE for chapel programming language

I want to write some short numerical programs in chapel. Can somebody just tell an IDE, or text editor which supports code highlighting for chapel (chapel-aware), is there an elisp-file for emacs? I don't prefer vim, even if a script for vim…
fedvasu
  • 1,232
  • 3
  • 18
  • 38
6
votes
1 answer

Multilocale Chapel: make check fails (GASNet: Invalid number of nodes: -nl)

I'm trying to run Chapel in multi-locale mode with Slurm. However, 'make check' fails. Could someone help me with that? I used Chapel 1.23.0. Here are the actual commands I used: cd chapel-1.23.0/ export CHPL_HOME=$PWD source…
dr.eru
  • 63
  • 2
6
votes
1 answer

Orthogonal Recursive Bisection in Chapel (Barnes-Hut algorithm)

I'm implementing a distributed version of the Barnes-Hut n-body simulation in Chapel. I've already implemented the sequential and shared memory versions which are available on my GitHub. I'm following the algorithm outlined here (Chapter…
Rok Novosel
  • 913
  • 1
  • 8
  • 18
6
votes
1 answer

Distribute 2D array row wise among Locales in Chapel

I am learning Chapel and have worked with blockdist but I can't figure out how can I distribute a 2-dimension array in row wise fashion among locales.
Robin Sharma
  • 181
  • 2
  • 11
6
votes
1 answer

Is there an equivalent to Fortran's select type statement in Chapel?

I'd like to try out classes and polymorphism in Chapel, so I am trying to get the following example code to work: module SomeAnimals { class Animal { } class Bird: Animal { } class Fish: Animal { } proc Bird.fly() { …
user10172900
6
votes
1 answer

Chapel domains : differences between `low/high` and `first/last` methods

Chapel domains have two sets of methods domain.low, domain.high and domain.first, domain.last What are the various cases where these return different results (i.e when is domain.first != domain.low and domain.last != domain.high?
6
votes
1 answer

Is there a way to use non-scalar values in functions with where clauses in Chapel?

I've been trying out Chapel off and on over the past year or so. I have used C and C++ briefly in the past, but most of my experience is with dynamic languages such as Python, Ruby, and Erlang more recently. After some exposure to Erlang and its…
anglus
  • 63
  • 3
6
votes
1 answer

Tuple Concatenation in Chapel

Let's say I'm generating tuples and I want to concatenate them as they come. How do I do this? The following does element-wise addition: if ts = ("foo", "cat"), t = ("bar", "dog") ts += t gives ts = ("foobar", "catdog"), but what I really want is ts…
Tshimanga
  • 845
  • 6
  • 16
6
votes
1 answer

How to return a reference to a slice of an array in Chapel?

I'm trying to return a reference to a slice of an array , but am getting the following compile-time error (where the offending line is in slice test.chpl:9: error: illegal expression to return by ref Returning the full array works fine, as does…
6
votes
1 answer

Allocation of arrays in Chapel

Unlike other languages, there seems no allocate or new syntax in Chapel for allocating arrays on the heap, but rather use the usual "declaration"-like syntax. For example, in the following code, I "declare" two arrays A and B in a function based on…
roygvib
  • 7,218
  • 2
  • 19
  • 36
5
votes
1 answer

What is the best way to check/ensure that two arrays have the same domain and distribution?

A nice feature in Chapel is that it distinguishes between the domain of an array and its distribution. What is the best way to check that two arrays have the same domain and distribution (which one often wants)? The best I can see is to check D1==D2…
5
votes
2 answers

Callback functions in Chapel

I have the following Chapel code. proc update(x: int(32)) { return 2*x; } proc dynamics(x: int(32)) { return update(x); } writeln(dynamics(7)); I would like to send some kind of callback to dynamics, like proc update(x: int(32)) { return…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
2 3
16 17