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

How does Chapel handle "includes"

Now, if I have two Chapel projects ProjA and ProjB. If I want to use ProjA in B, I include the -M/path/to/ProjA flag in my makefile. In c++ however, the paradigm is often to include whole libraries, like boost, that are install system-wide. What…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

Convert a 'ref dataType' argument to a 'ptr(dataType)' in Chapel

Is there an official way to convert an argument passed by reference to a pointer to the exact same type? I know that during the CodeGen phase of compilation that ref int becomes int *, and I know that you can do so with extern for C interoperability…
Louis Jenkins
  • 391
  • 1
  • 2
  • 10
2
votes
1 answer

Error: "sync variables cannot currently be written"

One of my students is having a severe problem with their project (assignment is: http://turing.plymouth.edu/~kgb1013/?course=4310&project=0). They (and I) are getting a weird error when compiling with my test file, testSemaphore.chpl, available at:…
Kyle
  • 554
  • 3
  • 10
2
votes
1 answer

How do I use domain.find() as a test in Chapel

I have a domain of strings and I want to test for an elements. The find seems to be what I want, but it's giving me an error. var names: domain(string); names += "bob"; if !names.find("bob") { writeln("Where is Bob?") } produces an error error:…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

When do I need to include LayoutCS in Chapel sparse matrices?

I have not been able to isolate, but sometimes I get an error for not including use LayoutCS; When I use LinearAlgebra.Sparse; in Chapel. When do I need to include it and what other options do I have?
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
0 answers

How do you do a bulk insert into Postgres from Chapel?

I'm using the CDO Library to insert data into Postgres. This example fails; use Postgres, LinearAlgebra; const DB_HOST="localhost", DB_USER="buddha", DB_NAME="buddha", DB_PWD="buddha"; var q = "INSERT INTO r.condition_w…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

How to create a ragged array in Chapel

I'm attempting to create and "array of arrays" all of different lengths. For instance A = [[1 2 5 ] [3 5] [2 6 9]] With Chapel strongly typed, I don't know how to declare and populate A. My first use of this will be to iterate over A…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

Order an array with another array as an index in Chapel

I'm looking through the Sort operator in Chapel and trying to order two arrays. const a = [2.2, 3.3, 1.1, 4.4]; const b = [7, 10, 23, 1]; Now I want an iterator or new array that produces b in descending order of a. That is var output = [1, 10, 7,…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

unresolved call 'init' in Domain Map Class when implementing DSI

(chpl version 1.16.0.e43acc7) I'm starting to learn the DSI interface and have run into a confusing issue when constructing a Domain class from the dsiNewRectangularDom function in the Distribution class: class MyDist : BaseDist { proc MyDist(…
2
votes
1 answer

Filling an array using forall in Chapel

This is working fine on my laptop, but I'm wondering if this is going to cause problems at scale. Suppose I want to fill an array that is going to be very large, but each entry requires an intense matrix operation on a large, sparse, distributed…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

Retrieve an array from Postgres using Chapel CDO

I am getting an error pulling an array from Postgres using the Chapel CDO Library I have a pg instance with the following table DROP TABLE IF EXISTS aagg; CREATE TABLE aagg (team text, name text); INSERT INTO aagg VALUES ('Wonder Pets', 'Linny');…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
2 answers

Compiling C++ with Chapel's "compileline"

I want to include some C++ code in my chapel libs, the first step is getting the Chapel compiler to compile cpp according to this page. However, I'm getting a strange error. My .cpp is /* Hello World program *…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

Continue out of FORALL loop in Chapel

When you write it all caps like that, you really see the FORTRAN heritage. Anyway, I can't get the forall continue syntax correct. var ids = {1,2,3,5,7,11}; forall id in ids { if id == 5 then writeln("High Five!!"); if id == 7 then continue; …
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

How do I do a bi-directional look up in Chapel for dictionary-like data?

In Python, if I have a list I can find the index. This allows me to keep running IDs as I add things. > things = [] > things.append("spinach") > things.append("carrots") > things.index("carrots") 1 So give a vegetable (or tuber) I can find an ID…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
2
votes
1 answer

How to loop over an array sorted by one dimension in Chapel?

Suppose our darling A looks like 60.0 3.0 675.0 3.0 1050.0 4.0 0.0 0.0 I want to loop through the rows in decreasing order of the first column. Something like... for r in sorted(A, by=A[1,], reverse=True) { writeln(r); } I'd…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35