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
2
votes
1 answer

Is there a literal for the empty array in Chapel?

I'm trying to make an empty array in Chapel. An array of one element can be made like this: var a: [1..1] int = (1); But when I try var b: [1..0] int = (); I get syntax error: near ')' Is there an empty array literal in Chapel? I haven't been…
Ray Toal
  • 86,166
  • 18
  • 182
  • 232
2
votes
1 answer

Chapel, locales, and multicore multiprocessor machines

If a Chapel program does not use locales (*) so there is just one locale, will a program use all the processors/cores on the machine of execution (if so presumably by using kernel threads). (*) Locales as used in Chapel is a somewhat unfortunate…
Russel Winder
  • 3,436
  • 1
  • 17
  • 12
1
vote
1 answer

Where do you put the type in Chapel variable declarations?

Where do you put the type in Chapel variable declarations? More specifically, what’s the difference between var a = 42: int; and var a: int = 42;?
ben-albrecht
  • 1,785
  • 10
  • 23
1
vote
1 answer

How to access class or record field with the name of the field as a string?

Say you have a record or class: record R { var value: int; } How can I access the field value by using the string "value"? For example, in Python, you can access fields using the getattr built-in: class C: def __init__(self, val): …
ben-albrecht
  • 1,785
  • 10
  • 23
1
vote
1 answer

Does Chapel have something similar to a Python context manager?

In Python, you can use context managers to allocate and release resources within a block of code, such as opening and closing a file handle within the scope of a with block in this example: with open('some_file', 'w') as opened_file: …
ben-albrecht
  • 1,785
  • 10
  • 23
1
vote
0 answers

Multi-Locale Chapel Cluster Setup

I am new at the chapel Language and I want to set up a Chapel Multi-locale Cluster. I have a LAN of computers with Windows installed on all of them. So my specific questions are Should I install LINUX on all machines to be able to use them as a…
1
vote
1 answer

Error on function call when captured as values

So I have a program in which I have a function that needs to be passed as an argument to another function call. So I was running a Test Case. Let's say there are two classes Abstract and Concrete, the latter one being the child class of earlier. //…
Destry003
  • 33
  • 1
  • 4
1
vote
1 answer

warning: implicitly reading from a sync is deprecated; apply a '.read??()' method

I just upgraded from chapel 1.23 to 1.24. Now the compiler screams at me; warning: implicitly reading from a sync is deprecated; apply a '.read??()' method For example. the code block below lists this warning at the last line. var allStatesLock$:…
ahysing
  • 11
  • 1
1
vote
2 answers

Unexpected result from i == j == k?

In this code I am looping over all indices in a 3D domain, and printing the "diagonal" part as for (i, j, k) in {0..9, 0..9, 0..9} { if i == j == k // (1) //if (i == j) && (j == k) // (2) -> gives expected result { …
minibean
  • 263
  • 1
  • 7
1
vote
1 answer

Using square brackets for the output of array elements

This code creates one record variable (r) and one tuple variable (t) that contain several arrays and prints them to stdout: const N = 5; record Myrec { var a: [1..N] int = (for i in 1..N do i); var b: [1..N] int = (for i in 1..N do i); …
minibean
  • 263
  • 1
  • 7
1
vote
0 answers

I do not understand the error in object initializer

I'm getting the following error in the initializer in the chapel class I'm writing: unresolved access of 'int(64)' by '()' I've tried removing as much as possible from my code and am still getting the error, but only when I compile with the class…
1
vote
1 answer

Optional function arguments with no default value possible?

In Chapel, we can set the default value of function formal arguments easily, for example, proc test( a = 1, b = 2.0, c = "hi" ) { ... } and call the function by using keywords also: test( 10 ); // a = 10, b = 2.0, c = "hi" test( b =…
roygvib
  • 7,218
  • 2
  • 19
  • 36
1
vote
1 answer

Can I use an array as a config const in Chapel

I'd like to have the starting position of my agents configurable. Within the Chapel code I have var DOG_STARTING_POSITION: [1..0] int; Then within the .cfg file I have DOG_STARTING_POSITION=[25,25] But this produces the error error: type…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

Invalid use of a type field or array element as a loop counter

In the following code, I have tried using a field variable (of class or record) or an array element directly as a loop counter, but this was illegal ("error: invalid index expression"). Is this simply because the loop counter must be a scalar…
roygvib
  • 7,218
  • 2
  • 19
  • 36
1
vote
1 answer

How to use the `writeThis()` construct in Chapel

I have a class in Chapel, and I want to let it control it's own print statement. So for instance class Noob { var name: string, experience:int; // constructor } Later, I want to do something like me = new Noob('brian', 0) writeln(me) > Hi,…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35