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
2 answers

Chapel: Can you re-index a domain in place?

A great man once said, I have a matrix A. But this time she has a friend B. Like the Montagues and Capulets, they have different domains. // A.domain is { 1..10, 1..10 } // B.domain is { 0.. 9, 0.. 9 } for ij in B.domain { if B[ij]
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
2 answers

How to do an in-place `expand` on a domain in Chapel

The expand command in Chapel returns a new domain. I would like to increase a domain by one kinda like var d: domain(1) = {1..5}; writeln(d); --{1..5} expand(d)(1); writeln(d); --{1..6};
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

Create domain with matrices in Chapel

I have a domain D, and I want to use it to index several matrices A. Something of the form var dom: domain(1) = {0..5}; var mats: [dom] ; var a0 = [[0.0, 0.1, 0.2], [0.3, 0.4, 0.5]]; var a1 = [[1.0, 1.1, 1.2, 1.3], [1.4, 1.5, 1.6,…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
2 answers

How to read a matrix from a file in Chapel

This time I have a matrix --IN A FILE-- called "matrix.csv" and I want to read it in. I can do it in two flavors, dense and sparse. Dense matrix.csv 3.0, 0.8, 1.1, 0.0, 2.0 0.8, 3.0, 1.3, 1.0, 0.0 1.1, 1.3, 4.0, 0.5, 1.7 0.0, 1.0, 0.5, 3.0,…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
2 answers

How to send sparse vectors and matrices over ZeroMQ?

I have a matrix A (how many stories start this way?) that is sparse. [ [0, 0, 0, 1.2, 0] [0, 0, 0, 0, 0] [3.5, 0, 0, 0, 0] [0 7, 0, 0, 0] ] I want to send variants of this back and forth between processes using ZeroMQ. Assume the…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
3 answers

Create / manipulate diagonal matrices in Chapel

I have a square matrix A use LinearAlgebra; proc main() { var A = Matrix( [4.0, 0.8, 1.1, 0.0, 2.0] ,[0.8, 9.0, 1.3, 1.0, 0.0] ,[1.1, 1.3, 1.0, 0.5, 1.7] ,[0.0, 1.0, 0.5, 4.0, 1.5] ,[2.0, 0.0, 1.7, 1.5, 16.0] …
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

Send a matrix as a proc argument in Chapel

I'm getting an error when I try to send a matrix into a proc. I'm pretty sure I'm doing something very wrong, can't figure it out. use LinearAlgebra; proc main() { var A = Matrix( [0.0, 0.8, 1.1, 0.0, 2.0] ,[0.8, 0.0, 1.3, 1.0,…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

Find the number of rows or columns in a Chapel Matrix

I created the following Matrix, and I want to determine the number of rows/columns the matrix now has: module AswanBigMatrix { use LinearAlgebra; proc main() { var A = Matrix( [0.0, 0.8, 1.1, 0.0, 2.0] ,[0.8, 0.0, 1.3, 1.0,…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
2 answers

Pattern for random subsetting with domains in Chapel

Here is my set up. In hockey, players form into "lines" which are on the ice at the same time. A "forward" line is a trio of Left Wing, Center and Right Wing. A "D" line is a pair of Left D and Right D. In beer leagues, you typically dress 13…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

Continuation on: "How do dmapped domains in chapel language get actually mapped onto?"

Cray, sorry for again rising for clarity of answer! I got few more questions about domain-maps after this answer. I will highly appreciate and be very thankful if you clear my doubts about domain-maps. I hope, I have ordered the questions…
PreeJackie
  • 587
  • 4
  • 14
2
votes
1 answer

How Domain maps map indexes to target locales array in multi-dimension case

I didn't find how the domain map maps the indices in the multi-dimensional domains to the multi-dimensional target locales. 1.) How the target locales (one dimension) is arranged in multi-dimension fashion which equals the distribution dimension to…
PreeJackie
  • 587
  • 4
  • 14
2
votes
1 answer

Slicing a matrix: unresolved access of

I'm digging into Chapel and I am stuck at slicing a matrix inside a function. The function receiving the matrix is the following: proc outer_function(x: [?DX]) { var number_rows: int = x.shape(1); var number_columns: int = DX.rank; var…
gire
  • 1,105
  • 1
  • 6
  • 16
2
votes
1 answer

Unexpected type from a slice of 2-dimensional array

In the following code, I'm trying to get the 1st and 2nd rows of array A by using either var or ref. Here, my understanding is that var always creates a new array, while ref creates an alias (or reference) to the right-hand side. var A: [1..2, 1..3]…
roygvib
  • 7,218
  • 2
  • 19
  • 36
2
votes
1 answer

Get Non-primitive Variables from within a Cobegin - Chapel

I want to compute some information in parallel and use the result outside the cobegin. To be more precise, my requirement is to retrieve a domain (and other non primitive types) like this var a,b: domain(1,stridable=true); cobegin{ a = foo1(); b…
xSooDx
  • 493
  • 1
  • 5
  • 19
2
votes
1 answer

Chapel eltType methods

I have a class which contains a field that has an array of eltTypes. This looks like this: type eltType; var size = 5; var elementsDomain: domain(1) = {0..size-1}; var elements: [elementsDomain] eltType; Later on, I have a method that utilizes this…
MegaZeroX
  • 235
  • 1
  • 9