-
Notifications
You must be signed in to change notification settings - Fork 4
Update README to focus on Codespace usage instructions #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ShreyasKhandekar
wants to merge
1
commit into
chapel-lang:main
Choose a base branch
from
ShreyasKhandekar:update-readme-for-codespace
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,50 @@ | ||
| # 'Hello, world!' in Chapel | ||
|
|
||
| [Chapel](https://github.com/chapel-lang/chapel/) is a programming language for productive parallel computing. This repository contains starter code for a Chapel project. Please see the [Learning Chapel](https://chapel-lang.org/learning.html) page to learn more of the language's features. | ||
| [Chapel](https://github.com/chapel-lang/chapel/) is a programming language for productive parallel computing. This repository is a simple starting point for Chapel in GitHub Codespaces, with runnable examples in [examples/](examples). | ||
|
|
||
| To get started with this template, you can either use [GitHub Codespaces](#using-a-codespace) or [your own machine](#using-your-machine). | ||
| > ⚠️ **Warning:** Codespaces runs in a virtualized environment with shared hardware and a modest core count. Performance and available parallelism in Codespaces are not representative of what you should expect on a native Chapel installation. | ||
|
|
||
| For more code samples, consider trying out the [Primers](https://chapel-lang.org/docs/primers/), | ||
| or the [many programs from a past Chapel tutorial](https://github.com/chapel-lang/chapel/tree/main/test/exercises/Oct2023tutorial). | ||
| ## Compile And Run In The Terminal | ||
|
|
||
| ## Using a Codespace | ||
|
|
||
| > :warning: Because Codespaces are a virtualized environment running on shared hardware with a modest core count, don't expect parallelism or performance observed here to be reflective of what a native installation of Chapel can achieve. | ||
|
|
||
| The `chapel-hello-world` repo includes a `devcontainer.json` file, making it usable from GitHub Codespaces. When viewing this repository from GitHub's UI, click __Use this template > Open in a codespace__ to get started. The codespace includes the Visual Studio Code extension for Chapel, and tools such as [`chpl-language-server`](https://chapel-lang.org/docs/main/tools/chpl-language-server/chpl-language-server.html) and [`chplcheck`](https://chapel-lang.org/docs/main/tools/chplcheck/chplcheck.html). | ||
|
|
||
| In the Codespace, compile Chapel programs using the __Terminal__ tab by using the `chpl` compiler: | ||
| Compile and run the main hello-world program: | ||
|
|
||
| ```bash | ||
| chpl hello.chpl | ||
| ./hello | ||
| ``` | ||
|
|
||
| Although the Codespace is set to a single-locale (single-node) mode by default, you can simulate multiple nodes by setting the `CHPL_COMM` environment variable to `gasnet` when compiling. | ||
| Compile and run one of the included examples: | ||
|
|
||
| ```bash | ||
| # Compile a program that distributes computation to multiple nodes | ||
| CHPL_COMM=gasnet chpl examples/hello4-datapar-dist.chpl | ||
| chpl examples/hello3-datapar.chpl | ||
| ./hello3-datapar | ||
| ``` | ||
|
|
||
| ## Simulated Distributed (Multi-Locale) Runs | ||
|
|
||
| The Codespace defaults to single-locale mode (`CHPL_COMM=none`). | ||
|
|
||
| To simulate multi-locale execution, compile with `CHPL_COMM=gasnet`: | ||
|
|
||
| # Run hello using two simulated nodes | ||
| ./hello4-datapar-dist -nl 2 | ||
| ```bash | ||
| CHPL_COMM=gasnet chpl examples/hello4-datapar-dist.chpl | ||
| ./hello4-datapar-dist -nl 2 | ||
| ``` | ||
|
|
||
| To avoid having to include `CHPL_COMM` in each compilation command, you can | ||
| `export` it: | ||
| Or export once per shell and compile as usual: | ||
|
|
||
| ```bash | ||
| export CHPL_COMM=gasnet | ||
| chpl examples/hello4-datapar-dist.chpl | ||
| ./hello4-datapar-dist -nl 2 | ||
| ./hello4-datapar-dist -nl 2 | ||
| ``` | ||
|
|
||
| ## Using Your Machine | ||
| ## Learn More And Try More Programs | ||
|
|
||
| Please follow the instructions on the [Download Chapel](https://chapel-lang.org/download.html) page to get set up with the Chapel compiler `chpl`. From there, you can compile and run the `hello.chpl` file in this repository as follows: | ||
|
|
||
| ```bash | ||
| chpl hello.chpl | ||
| ./hello | ||
| ``` | ||
| You can copy in additional examples from Chapel Primers or Chapel tutorial/example programs to explore more language features. | ||
|
|
||
| To make use of multiple nodes (or to simulate multi-node execution), please | ||
| refer to [Multilocale Chapel Execution](https://chapel-lang.org/docs/usingchapel/multilocale.html). | ||
| - [Learning Chapel](https://chapel-lang.org/learning.html) | ||
| - [Chapel Primers](https://chapel-lang.org/docs/primers/) | ||
| - [Chapel tutorial examples](https://github.com/chapel-lang/chapel/tree/main/test/exercises/Oct2023tutorial) | ||
| - [Multilocale Chapel Execution](https://chapel-lang.org/docs/usingchapel/multilocale.html) | ||
| - [Download Chapel](https://chapel-lang.org/download.html) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bradcray suggested we put instructions for using the play button in the VSCode editor. This is an example of how we'd do that if we wanted to.