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

Inserting Batches into Postgres with CDO

So I have the following code that is supposed to batch insert values into Postgres: config const batchsize = 10000; proc bulkInsertSparseMatrix(con:Connection, aTable: string, fromField: string, toField: string, weightField: string, A) { const q =…
Tshimanga
  • 845
  • 6
  • 16
1
vote
1 answer

Basic "Production-grade" hello world gives errors

module Hello { config const message: string = "Hello, world!"; proc main() { writeln( message ); } } The program compiles fine with no errors, but my attempt to run gives the following errors. ./hello2-module.chpl: line 1:…
ytobi
  • 535
  • 1
  • 9
  • 19
1
vote
1 answer

How to build a matrix polynomial in Chapel

A wise man once began, I have this matrix A... (known here as "W") use LinearAlgebra, LayoutCS, LinearAlgebra.Sparse; var nv: int = 8, D = {1..nv, 1..nv}, SD: sparse subdomain(D) dmapped CS(), W: [SD] real; SD += (1,2); W[1,2]…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

How to construct a new Matrix() in Chapel?

I'm getting an error with use LinearAlgebra; var M = Matrix((3,4, 5.1), (5,6,1.3)); How do I correctly construct M? I feel like I knew the answer once...
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

Efficient cast of integer array to integer domain in Chapel

I noticed that this works in Chapel. I can turn an integer array into a set by casting it to domain(int) var x: [1..4] int = (4,5,6,6); var d = x : domain(int); writeln(x); > {4,6,5} This is extremely helpful, but I'm wondering if there are…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

Chapel iterators with conditionals

I am trying to write an iterator with a conditional in Chapel. This works var x = [1,4,5,2,6,3]; iter dx(x) { for y in x do yield 2*y; } for y in dx(x) { writeln("y -> ", y); } returning y -> 2 y -> 8 y -> 10 y -> 4 y -> 12 y -> 6 Suppose I…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

Print string domain values with comma separation in Chapel

I have a domain I'd like to output with commas. In Python I can use the string .join() method, being fed by a list .sort()-ed product, but in Chapel I am not getting the right results. var names = { "anze kopitar", "tyler toffoli", …
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

Calling external module from Chapel

I am trying to use my NumSuch module in another program. My Makefile includes NUMSUCH_HOME=/home/buddha314/numsuch/src MODULES=-M$(NUMSUCH_HOME) yummly: yummlyAnalysis.chpl $(CC) $(FLAGS) $(MODULES) -o yummlyAnalysis $< #$(CC) $(MODULES)…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

How to load variable length JSON arrays in Chapel?

I'm trying to load the Yummly Data which includes JSON formatted training data. Here is a sample of a single record: { "id": 10259, "cuisine": "greek", "ingredients": [ "romaine lettuce", "black olives", "grape…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

How do I use `chpldoc` on GitHub

When running chpldoc and pushing to github, the themes are corrupted. Do I need to set a flag to allow github to insert a theme? == UPDATE == A specific example is here I ran this with chpldoc src/*.chpl -o docs
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

How to extract the upper triangular matrix w or w/o diagonal in Chapel

The best stories start with my matrix A. var A: [{1..4,1..4}] real = ( (4, -30, 60, -35), (-30, 300, -675, 420), (60, -675, 1620, -1050), (-35, 420, -1050, 700) ); I recall somewhere you can get the upper triangle, but I can't find it in…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
2 answers

Efficient construction of cosine similarity matrix from corpus in Chapel

I have a corpus V of TF/IDF vectors, so they are pretty sparse. It's an array about 2,500 by 150,000. I want to calculate the cosine similarity between each document in the corpus. This is almost the most naive way I can think of to do it. I know…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

How to make a 2D domain from 1D domains in Chapel

In order to keep my matrices A in sync with my vectors v I want to create var vdom: domain(1) = {1...10}, mdom: domain(2) = {odom, odom}; However, this gives me a compiler error.
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

How to generate knock-out vectors in Chapel?

I have a matrix, yes, A. Operating on her rows, I often need to create "knock-out" vectors. Basically var v = [5, 4, 3, 2, 1]; v_{-2} = [5, 3, 2, 1]; // e.g. v[2] is removed I don't want to remove it permanently, just for this calculation, and I…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
1
vote
1 answer

How to find the max of an array in Chapel

It starts like all good stories, I have a matrix A and I want to find the max, sometimes of the whole thing or sometimes along the rows. var dom = {1..2, 1..5}; var m: [dom] real; m[1,..] = [1.0, 2.0, 3.1, 4.8, 5.6]; m[2,..] = [2.0, 3.0, 4.1, 5.8,…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35