Skip to content
Snippets Groups Projects
Commit 6abcf0b2 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil :bicyclist:
Browse files

updates

parent eda2364c
No related branches found
No related tags found
2 merge requests!138[release] Regular merge of develop,!131julia training slides for 2022-06-08
This commit is part of merge request !131. Comments created here will be created in the context of that merge request.
......@@ -139,15 +139,3 @@ $ julia --project=path/to/project script.jl
```
(Project data is stored in `Project.toml`, `Manifest.toml`.)
<div class=leader>
☕🧋🧃<br>
PAUSE
</div>
Let's have *10 minutes* for a coffee or something.
(Questions?)
......@@ -81,6 +81,11 @@ datafiles = ["file$i.csv" for i=1:20]
# ... do something ...
end
pmap(process_file, datafiles)
```
💡💡 Doing it manually:
```julia
@sync for f in datafiles
@async @spawnat :any process_file(f)
end
......@@ -145,7 +150,7 @@ Utilizing ULHPC 💡
# What does ULHPC look like?
# What does the cluster look like? (Iris)
<center>
<img src="slides/img/iris.png" width="30%">
......@@ -155,6 +160,34 @@ Utilizing ULHPC 💡
# Running Julia on the computing nodes
Start an allocation and connect to it:
```sh
0 [mkratochvil@access1 ~]$ srun -p interactive -t 30 --pty bash -i
```
(You can also use `si`.)
After some brief time, you should get a shell on a compute node. There you can install and start Julia as usual:
```
0 [mkratochvil@iris-131 ~](2696005 1N/T/1CN)$ module add lang/Julia
0 [mkratochvil@iris-131 ~](2696005 1N/T/1CN)$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.2 (2021-07-14)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia>
```
# Making a HPC-compatible Julia script
Main challenges:
......@@ -171,7 +204,7 @@ addprocs_slurm(parse(Int, ENV["SLURM_NTASKS"]))
# Scheduling the script
# Scheduling an analysis script
Normally, you write a "batch script" and add it to a queue using `sbatch`.
......
......@@ -181,6 +181,24 @@ Example:
<div class=leader>
☕🧋🧃<br>
PAUSE
</div>
Let's have *10 minutes* for a coffee or something.
(Questions?)
<div class=leader>
🔵 🔴 🟢 🟣<br>
Julia language primer (part 2)
</div>
# 💡 Structured cycles!
Using functional-style loops is *much less error-prone* to indexing
......@@ -201,6 +219,8 @@ reduce((a,b) -> "$b $a", ["Use", "the Force", "Luke"])
reduce(*, [1 2 3; 4 5 6], dims=1)
```
**Tricky question (💡💡💡):** What is the overhead of the "nice" loops?
# Making new arrays with loops
......
# Overview today
0. Why would you learn another programming language again?
1. Bootstrapping, working with packages, writing a script (45m), pause (10m)
2. Language and syntax primer (20m)
1. Bootstrapping, working with packages, writing a script (30m)
2. Language and syntax primer (35m) with a pause (10m) in the middle
3. Getting the data in and out (15m)
4. Running programs on ULHPC (15m)
5. Questions, hands-on, time buffer (15m)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment