Julia¶
Experimental support
Support for the Julia programming language on Polaris is currently experimental. This guide provides a set of best practices, but you may encounter unexpected issues.
Introduction¶
Julia is a high-level, high-performance programming language designed for technical and scientific computing. It combines the ease of use of dynamic languages with the performance of compiled languages, making it well-suited for large-scale simulations and data analysis.
This guide details how to install, configure, and run Julia on the Polaris supercomputer, focusing on leveraging the system's key architectural features for large-scale parallel and GPU-accelerated computing.
!!! example "Contributing*
This guide is a first draft of the Julia documentation for Polaris. If you have suggestions or find errors, please open a pull request or contact us by [opening a ticket](../../support/ticket.md) at the [ALCF Helpdesk](mailto:support@alcf.anl.gov).
All the source files used in this documentation are located at https://github.com/anlsys/julia_alcf. Feel free to open PRs!
Julia Installation¶
We recommend installing Julia in a project directory $PROJECT on Eagle or Flare for faster file access and to avoid your home directory.
- Clone the configuration files
- Run setup script This script contains steps that eventually will be executed by an admin
- Install Julia in
$JULIA_DEPOT_PATH(e.g.,/eagle/$PROJECT/path/to/julia_depot) - Configure Julia options through a global
LocalPreferences.tomlfile - Set up module files
- Install Julia in
-
Add
$JULIA_DEPOT_PATHthat you entered during setup to your shell configuration file (e.g.,~/.bashrcor~/.bash_profile) and load the module path.
Loading Julia¶
Load the Julia module:
Configuring the Programming Environment¶
To leverage Polaris's architecture, you must configure Julia to use the system's optimized libraries for MPI.jl, CUDA.jl, and HDF5.jl. For a modern, interactive development experience, we recommend using Visual Studio Code with the official Julia and Remote - SSH extensions.
Installing all required packages can be done in a Julia REPL with the following commands:
The packages will be loaded with the options specified in theLocalPreferences.toml file created during the setup process in $JULIA_DEPOT_PATH/environments/v1.12. ## Verify Configuration on a Compute Node
The Polaris login nodes do not have GPU access. You must request an interactive job to test your GPU configuration.
```bash
# Request an interactive node
qsub -I -l select=1,walltime=1:00:00,filesystems=home:eagle -A [PROJECT] -q debug
# Once on the node, run the verification
julia --project -e "using CUDA; CUDA.versioninfo()"
# Expected Output Snippet
# CUDA runtime 12.2, local installation
# ...
# Preferences:
# - CUDA_Runtime_jll.local: true
# ...
# 4 devices:
# 0: NVIDIA A100-SXM4-40GB ...
Example Julia Code for Approximating Pi¶
Job Submission Script¶
This PBS script requests resources and launches the Julia application using mpiexec.