Skip to content

Commit

Permalink
Cleaned up a couple code samples in phase 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Greenburg committed Feb 7, 2024
1 parent 780801b commit 3160411
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions project/phase4.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ Your job is to make [WaveSim.jl](https://github.com/BYUHPC/WaveSim.jl) faster wh
# Run this in the julia interpreter: `module load julia; julia`
# Read in the 2D wave orthotope files from wavefiles.tar.gz
using WaveSim
tiny2din, small2din, medium2din = (WaveOrthotope(open(wavefiles(2, s, :in)))
tiny2din, small2din, medium2din = (WaveOrthotope(wavefiles(2, s, :in))
for s in (:tiny, :small, :medium));
# Compile on 2d-tiny-in.wo
@time solve!(tiny2din);
# Time solve on 2d-medium-in.wo
solve!(tiny2din); # compile
@time solve!(medium2din); # should be under 50s
```

Expand All @@ -39,7 +37,7 @@ Julia integrates nicely with VS Code; you can do without, but you'll need to do

```julia
using WaveSim # this will now load the WaveSim.jl in this directory
w = WaveOrthotope(open(wavefiles(2, :small, :in)))
w = WaveOrthotope(wavefiles(2, :small, :in))
@profview solve!(w);
```

Expand Down Expand Up @@ -78,8 +76,8 @@ julia --project=. -e "using Pkg; Pkg.instantiate(); using WaveSim; wavefiles()"
# Time within a job on an m9 node
sbatch -t 10 --mem 16G -N 1 -n 28 -p m9 --wrap 'julia --project=. -e \
"using WaveSim
solve!(WaveOrthotope(wavefiles(2, :tiny, :in)))
@time solve!(WaveOrthotope((wavefiles(2, :medium, :in)))"'
solve!(WaveOrthotope(wavefiles(2, :tiny, :in))) # compile
@time solve!(WaveOrthotope(wavefiles(2, :medium, :in)))"'
```

You should do so as well to ensure that it works as intended. Note that you can request less resources to hasten job submission (e.g. `--mem 2G -N 1 -n 1`)--if your code runs fast enough when sharing resources, it'll run fast enough when it has a node to itself.
Expand Down

0 comments on commit 3160411

Please sign in to comment.