From e80707479e2495ffbc2a9aca2302caa282a51cf4 Mon Sep 17 00:00:00 2001 From: a2ray <52647259+a2ray@users.noreply.github.com> Date: Thu, 11 Jan 2024 00:26:47 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Geoscien?= =?UTF-8?q?ceAustralia/HiQGA.jl@4dfa98fc2e6a3fc184c3cfabbc5b194eecd51792?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .documenter-siteinfo.json | 2 +- index.html | 7 ++++--- search_index.js | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.documenter-siteinfo.json b/.documenter-siteinfo.json index 79c730c5..5b7b2777 100644 --- a/.documenter-siteinfo.json +++ b/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-12T23:11:56","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-01-11T00:26:46","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/index.html b/index.html index 38d3989c..f49622de 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,7 @@ -HiQGA Documentation · HiQGA - High Quality Geophysical Analysis

HiQGA Documentation

This is a general purpose package for spatial statistical inference, geophysical forward modeling, Bayesian inference and inversion (both determinstic and probabilistic).

Readily usable geophysical forward operators are to do with AEM, CSEM and MT physics (references underneath), for which the time domain AEM codes are fairly production-ready. The current EM modeling is in 1D, but the inversion framework is dimensionally agnostic (e.g., you e regress images). Adding your own geophysical operators is easy, keep reading down here.

This package implements both the nested (2-layer) and vanilla trans-dimensional Gaussian process algorithm as published in

Installation

NCI users look here first!

To install, in a perfect world we'd use Julia's Pkg REPL by hitting ] to enter pkg> mode. Then enter the following, at the pkg> prompt:

pkg> add HiQGA 

If installing to follow along for the 2022 AEM workshop branch use instead of the above pkg> add HiQGA@0.2.2

Usage

Examples of how to use the package can be found in the examples directory. Simply cd to the relevant example directory and include the .jl files in the order they are named. If using VSCode make sure to do Julia: Change to this Directory from the three dots menu on the top right. The Markov Chain Monte Carlo sampler is configured to support parallel tempering on multiple CPUs - some of the examples accomplish this with Julia's built-in multiprocessing, and others use MPI in order to support inversions on HPC clusters that don't work with Julia's default SSH-based multiprocessing. The MPI examples require MPI.jl and MPIClusterManagers.jl, which are not installed as dependencies for this package, so you will need to ensure they are installed and configured correctly to run these examples. See here for MPI on the NCI.

Some example scripts have as a dependency Revise.jl as we're still actively developing this package, so you may need to install Revise if not already installed. All Julia users should be developing with Revise! After installation, to run the examples, simply clone the package separately (or download as a ZIP), navigate to the examples folder and run the scripts in their numerical order.

Updating the package

pkg> update HiQGA

Developing HiQGA or modifying it for your own special forward physics

After you have ]added HiQGA you can simply do:

pkg>dev HiQGA

If you haven't added it already, you can do:

pkg>dev https://github.com/GeoscienceAustralia/HiQGA.jl.git

It will download to your JULIA_PKG_DEVDIR.

Another way is to simply clone or download this repository to your JULIA_PKG_DEVDIR, rename the cloned directory HiQGA removing the .jl bit and do

pkg>dev HiQGA

Here's a gist on adding your own module if you want to modify the source code. Alternatively, if you only want to use the sampling methods in HiQGA.transD_GP without contributing to the source (boo! j/k) here's another gist which is more appropriate. These gists were written originally for a package called transD_GP so you will have to modify using transD_GP to using HiQGA.transD_GP. Documentation is important and we're working on improving it before a full-release.

Development setup on NCI

If you don't already have access to a julia binary, download the appropriate version .tar.gz from here and then untar it in a location you have write access to. Then, in your $HOME/bin directory make a symlink to the julia binary like so:

cd ~/bin
-ln -s /somwehere/home/me/julia-x.x.x/bin/julia .

The preferred development and usage environment for HiQGA is Visual Studio Code, which provides interactive execution of Julia code through the VSCode Julia extension. To install VSCode on the National Computational Infrastructure (NCI), you need to extract the VSCode rpm package using the steps in this gist, to a location where your account has write access. You will NOT be using vscode on a gadi login node, but on OOD.

Get Julia language support from VSCode after launching the VSCode binary by going to File->Extensions by searching for Julia. If after installation it doesn't find the Julia binary, go to File->Extensions->Julia->Manage(the little gear icon) and manually type in /home/yourusername/bin/julia in the "Executable Path" field.

It is also useful to use Revise.jl to ensure changes to the package are immediately reflected in a running Julia REPL (this is the reason that Revise is a dependency on some example scripts as noted above). More information on a workflow to use Revise during development can be found here.

Installing MPI.jl and MPIClusterManagers.jl on NCI

We have found that the safest bet for MPI.jl to work without UCX issues on NCI is to use intel-mpi. In order to install MPI.jl and configure it to use the intel-mpi provided by the module intel-mpi/2021.10.0, following the example below.

$ module load intel-mpi/2021.10.0
+HiQGA Documentation · HiQGA - High Quality Geophysical Analysis

HiQGA Documentation

This is a general purpose package for spatial statistical inference, geophysical forward modeling, Bayesian inference and inversion (both determinstic and probabilistic).

Readily usable geophysical forward operators are to do with AEM, CSEM and MT physics (references underneath), for which the time domain AEM codes are fairly production-ready. The current EM modeling is in 1D, but the inversion framework is dimensionally agnostic (e.g., you e regress images). Adding your own geophysical operators is easy, keep reading down here.

This package implements both the nested (2-layer) and vanilla trans-dimensional Gaussian process algorithm as published in

Installation

HPC users look here to set up MPI for large jobs, or if you do not have Julia installed at all.

To install HiQGA, in a perfect world we'd use Julia's Pkg REPL by hitting ] to enter pkg> mode. Then enter the following, at the pkg> prompt:

pkg> add HiQGA 

If installing to follow along for the 2022 AEM workshop branch use instead of the above pkg> add HiQGA@0.2.2

Usage

Examples of how to use the package can be found in the examples directory. Simply cd to the relevant example directory and include the .jl files in the order they are named. If using VSCode make sure to do Julia: Change to this Directory from the three dots menu on the top right. The Markov Chain Monte Carlo sampler is configured to support parallel tempering on multiple CPUs - some of the examples accomplish this with Julia's built-in multiprocessing, and others use MPI in order to support inversions on HPC clusters that don't work with Julia's default SSH-based multiprocessing. The MPI examples require MPI.jl and MPIClusterManagers.jl, which are not installed as dependencies for this package, so you will need to ensure they are installed and configured correctly to run these examples. See here for MPI on the NCI.

Some example scripts have as a dependency Revise.jl as we're still actively developing this package, so you may need to install Revise if not already installed. All Julia users should be developing with Revise! After installation, to run the examples, simply clone the package separately (or download as a ZIP), navigate to the examples folder and run the scripts in their numerical order.

Updating the package

pkg> update HiQGA

Developing HiQGA or modifying it for your own special forward physics

After you have ]added HiQGA you can simply do:

pkg>dev HiQGA

If you haven't added it already, you can do:

pkg>dev https://github.com/GeoscienceAustralia/HiQGA.jl.git

It will download to your JULIA_PKG_DEVDIR.

Another way is to simply clone or download this repository to your JULIA_PKG_DEVDIR, rename the cloned directory HiQGA removing the .jl bit and do

pkg>dev HiQGA

Here's a gist on adding your own module if you want to modify the source code. Alternatively, if you only want to use the sampling methods in HiQGA.transD_GP without contributing to the source (boo! j/k) here's another gist which is more appropriate. These gists were written originally for a package called transD_GP so you will have to modify using transD_GP to using HiQGA.transD_GP. Documentation is important and we're working on improving it before a full-release.

HPC setup on NCI

If you don't already have access to a julia binary, download the appropriate version .tar.gz from here and then untar it in a location you have write access to, like so:

cd /somwehere/home/me
+tar -xvzf /somwehere/home/me/julia-x.x.x.ta.gz

Then, in your $HOME/bin directory make a symlink to the julia binary like so:

cd ~/bin
+ln -s /somwehere/home/me/julia-x.x.x/bin/julia .

Make sure your $HOME/bin is in your $PATH else which you can check with echo $PATH | grep"$HOME/bin". If you do not see your bin directory highlighted, do export PATH=~/opt/bin:$PATH The preferred development and usage environment for HiQGA is Visual Studio Code, which provides interactive execution of Julia code through the VSCode Julia extension. To install VSCode on the National Computational Infrastructure (NCI), you need to extract the VSCode rpm package using the steps in this gist, to a location where your account has write access. You will NOT be using vscode on a gadi login node, but on OOD.

Get Julia language support from VSCode after launching the VSCode binary by going to File->Extensions by searching for Julia. If after installation it doesn't find the Julia binary, go to File->Extensions->Julia->Manage(the little gear icon) and manually type in /home/yourusername/bin/julia in the "Executable Path" field.

It is also useful to use Revise.jl to ensure changes to the package are immediately reflected in a running Julia REPL (this is the reason that Revise is a dependency on some example scripts as noted above). More information on a workflow to use Revise during development can be found here.

Installing MPI.jl and MPIClusterManagers.jl on NCI

We have found that the safest bet for MPI.jl to work without UCX issues on NCI is to use intel-mpi. In order to install MPI.jl and configure it to use the intel-mpi provided by the module intel-mpi/2021.10.0, following the example below.

$ module load intel-mpi/2021.10.0
 $ julia
 
 julia > ] 
@@ -62,4 +63,4 @@
 rmprocs(workers())
 exit()

Run the code after loading the intel-mpi module you have linked MPI.jl against with

module load intel-mpi/2021.10.0
 mpirun -np 3 julia mpitest.jl

and you should see output like:

[ Info: size is 3
-[ Info: there are 2 workers

This is the basic recipe for all the cluster HiQGA jobs on NCI. After the call to manager = MPIClusterManagers.start_main_loop(MPI_TRANSPORT_ALL), standard MPI execution stops, and we return to an explicit manager-worker mode with code execution only continuing on the manager which is Julia process 1.

The next time you start julia you have HiQGA ready for use with

julia> using HiQGA

navigate to the examples folder to run some example scripts. You can end here as a regular user, however for development mode see below.

For installing development mode pre-release versions

pkg> dev HiQGA

Make a pull request if you wish to submit your change – we welcome feature additions. If you want to switch back to the official version from development mode, do

pkg> free HiQGA

References for AEM and CSEM physics

+[ Info: there are 2 workers

This is the basic recipe for all the cluster HiQGA jobs on NCI. After the call to manager = MPIClusterManagers.start_main_loop(MPI_TRANSPORT_ALL), standard MPI execution stops, and we return to an explicit manager-worker mode with code execution only continuing on the manager which is Julia process 1.

The next time you start julia you have HiQGA ready for use with

julia> using HiQGA

navigate to the examples folder to run some example scripts. You can end here as a regular user, however for development mode see below.

For installing development mode pre-release versions

pkg> dev HiQGA

Make a pull request if you wish to submit your change – we welcome feature additions. If you want to switch back to the official version from development mode, do

pkg> free HiQGA

References for AEM and CSEM physics

diff --git a/search_index.js b/search_index.js index a71a5ff7..924acd57 100644 --- a/search_index.js +++ b/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"#HiQGA-Documentation","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"This is a general purpose package for spatial statistical inference, geophysical forward modeling, Bayesian inference and inversion (both determinstic and probabilistic).","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Readily usable geophysical forward operators are to do with AEM, CSEM and MT physics (references underneath), for which the time domain AEM codes are fairly production-ready. The current EM modeling is in 1D, but the inversion framework is dimensionally agnostic (e.g., you e regress images). Adding your own geophysical operators is easy, keep reading down here.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"This package implements both the nested (2-layer) and vanilla trans-dimensional Gaussian process algorithm as published in ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"An information theoretic Bayesian uncertainty analysis of AEM systems over Menindee Lakes, Australia. A.Ray, A-Y. Ley-Cooper, R.C. Brodie, R. Taylor, N. Symington, N. F. Moghaddam, Geophysical Journal International, 235(2)., 2023.\nBayesian inversion using nested trans-dimensional Gaussian processes, A. Ray, Geophysical Journal International, 226(1), 2021.\nBayesian geophysical inversion with trans-dimensional Gaussian process machine learning, A. Ray and D. Myer, Geophysical Journal International 217(3), 2019.\nThere is also a flavour of within-bounds Gauss-Newton/Occam's inversion implemented. For SkyTEM, TEMPEST and VTEM (all AEM), this is fully functional, but for other forward propagators you will have to provide a Jacobian (the linearization of the forward operator).","category":"page"},{"location":"#Installation","page":"HiQGA Documentation","title":"Installation","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"NCI users look here first!","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"To install, in a perfect world we'd use Julia's Pkg REPL by hitting ] to enter pkg> mode. Then enter the following, at the pkg> prompt:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg> add HiQGA ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"If installing to follow along for the 2022 AEM workshop branch use instead of the above pkg> add HiQGA@0.2.2","category":"page"},{"location":"#Usage","page":"HiQGA Documentation","title":"Usage","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Examples of how to use the package can be found in the examples directory. Simply cd to the relevant example directory and include the .jl files in the order they are named. If using VSCode make sure to do Julia: Change to this Directory from the three dots menu on the top right. The Markov Chain Monte Carlo sampler is configured to support parallel tempering on multiple CPUs - some of the examples accomplish this with Julia's built-in multiprocessing, and others use MPI in order to support inversions on HPC clusters that don't work with Julia's default SSH-based multiprocessing. The MPI examples require MPI.jl and MPIClusterManagers.jl, which are not installed as dependencies for this package, so you will need to ensure they are installed and configured correctly to run these examples. See here for MPI on the NCI.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Some example scripts have as a dependency Revise.jl as we're still actively developing this package, so you may need to install Revise if not already installed. All Julia users should be developing with Revise! After installation, to run the examples, simply clone the package separately (or download as a ZIP), navigate to the examples folder and run the scripts in their numerical order.","category":"page"},{"location":"#Updating-the-package","page":"HiQGA Documentation","title":"Updating the package","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg> update HiQGA","category":"page"},{"location":"#Developing-HiQGA-or-modifying-it-for-your-own-special-forward-physics","page":"HiQGA Documentation","title":"Developing HiQGA or modifying it for your own special forward physics","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"After you have ]added HiQGA you can simply do: ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg>dev HiQGA","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"If you haven't added it already, you can do:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg>dev https://github.com/GeoscienceAustralia/HiQGA.jl.git","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"It will download to your JULIA_PKG_DEVDIR. ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Another way is to simply clone or download this repository to your JULIA_PKG_DEVDIR, rename the cloned directory HiQGA removing the .jl bit and do","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg>dev HiQGA","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Here's a gist on adding your own module if you want to modify the source code. Alternatively, if you only want to use the sampling methods in HiQGA.transD_GP without contributing to the source (boo! j/k) here's another gist which is more appropriate. These gists were written originally for a package called transD_GP so you will have to modify using transD_GP to using HiQGA.transD_GP. Documentation is important and we're working on improving it before a full-release. ","category":"page"},{"location":"#Development-setup-on-NCI","page":"HiQGA Documentation","title":"Development setup on NCI","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"If you don't already have access to a julia binary, download the appropriate version .tar.gz from here and then untar it in a location you have write access to. Then, in your $HOME/bin directory make a symlink to the julia binary like so:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"cd ~/bin\nln -s /somwehere/home/me/julia-x.x.x/bin/julia .","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"The preferred development and usage environment for HiQGA is Visual Studio Code, which provides interactive execution of Julia code through the VSCode Julia extension. To install VSCode on the National Computational Infrastructure (NCI), you need to extract the VSCode rpm package using the steps in this gist, to a location where your account has write access. You will NOT be using vscode on a gadi login node, but on OOD.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Get Julia language support from VSCode after launching the VSCode binary by going to File->Extensions by searching for Julia. If after installation it doesn't find the Julia binary, go to File->Extensions->Julia->Manage(the little gear icon) and manually type in /home/yourusername/bin/julia in the \"Executable Path\" field.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"It is also useful to use Revise.jl to ensure changes to the package are immediately reflected in a running Julia REPL (this is the reason that Revise is a dependency on some example scripts as noted above). More information on a workflow to use Revise during development can be found here.","category":"page"},{"location":"#Installing-MPI.jl-and-MPIClusterManagers.jl-on-NCI","page":"HiQGA Documentation","title":"Installing MPI.jl and MPIClusterManagers.jl on NCI","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"We have found that the safest bet for MPI.jl to work without UCX issues on NCI is to use intel-mpi. In order to install MPI.jl and configure it to use the intel-mpi provided by the module intel-mpi/2021.10.0, following the example below. ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"$ module load intel-mpi/2021.10.0\n$ julia\n\njulia > ] \npkg> add MPIPreferences\n Resolving package versions...\n Installed MPIPreferences ─ v0.1.7\n Updating `/g/data/up99/admin/yxs900/cr78_depot/environments/v1.7/Project.toml`\n [3da0fdf6] + MPIPreferences v0.1.7\n Updating `/g/data/up99/admin/yxs900/cr78_depot/environments/v1.7/Manifest.toml`\n [3da0fdf6] + MPIPreferences v0.1.7\nPrecompiling project...\n 1 dependency successfully precompiled in 2 seconds (213 already precompiled)\n\njulia > using MPIPreferences\n\njulia> MPIPreferences.use_system_binary(;library_names=[\"/apps/intel-mpi/2021.10.0/lib/release/libmpi.so\"],mpiexec=\"mpiexec\",abi=\"MPICH\",export_prefs=true,force=true)\n[Info: MPIPreferences changed\n| binary = \"system\"\n| libmpi = \"/apps/intel-mpi/2021.10.0/lib/release/libmpi.so\"\n| abi = \"MPICH\"\n| mpiexec = \"mpiexec\"\n| preloads = Any[]\n[ preloads_env_switch = nothing\n\njulia> exit()","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Once the configuration is completed, install MPI.jl and MPIClusterManagers.jl in a restarted Julia session. We had errors with other versions of MPI.jl besides v0.19.2 on NCI, maybe not an issue elsewhere.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg>add MPI@0.19.2, MPIClusterManagers, Distributed\nResolving package versions...\n No Changes to `~/.julia/environments/v1.9/Project.toml`\n No Changes to `~/.julia/environments/v1.9/Manifest.toml`\nPrecompiling project...\n 4 dependencies successfully precompiled in 5 seconds. 225 already precompiled.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Just to be safe, ensure that MPI has indeed built wth the version you have specified above:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"julia> using MPI\n\njulia> MPI.MPI_VERSION\nv\"3.1.0\"\n\njulia> MPI.MPI_LIBRARY\nIntelMPI::MPIImpl = 4\n\njulia> MPI.MPI_LIBRARY_VERSION\nv\"2021.0.0\"\n\njulia> MPI.identify_implementation()\n(MPI.IntelMPI, v\"2021.0.0\")\n","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"To test, use an interactive NCI job with the following submission:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"qsub -I -lwalltime=1:00:00,mem=16GB,ncpus=4,storage=gdata/z67+gdata/cr78\n.\n.\n.\njob is ready","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"now create a file called mpitest.jl with the following lines on some mount you have access to:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"## MPI Init\nusing MPIClusterManagers, Distributed\nimport MPI\nMPI.Init()\nrank = MPI.Comm_rank(MPI.COMM_WORLD)\nsz = MPI.Comm_size(MPI.COMM_WORLD)\nif rank == 0\n @info \"size is $sz\"\nend\nmanager = MPIClusterManagers.start_main_loop(MPI_TRANSPORT_ALL)\n@info \"there are $(nworkers()) workers\"\nMPIClusterManagers.stop_main_loop(manager)\nrmprocs(workers())\nexit()","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Run the code after loading the intel-mpi module you have linked MPI.jl against with ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"module load intel-mpi/2021.10.0\nmpirun -np 3 julia mpitest.jl","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"and you should see output like:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"[ Info: size is 3\n[ Info: there are 2 workers","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"This is the basic recipe for all the cluster HiQGA jobs on NCI. After the call to manager = MPIClusterManagers.start_main_loop(MPI_TRANSPORT_ALL), standard MPI execution stops, and we return to an explicit manager-worker mode with code execution only continuing on the manager which is Julia process 1.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"The next time you start julia you have HiQGA ready for use with","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"julia> using HiQGA","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"navigate to the examples folder to run some example scripts. You can end here as a regular user, however for development mode see below.","category":"page"},{"location":"#For-installing-development-mode-pre-release-versions","page":"HiQGA Documentation","title":"For installing development mode pre-release versions","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg> dev HiQGA","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Make a pull request if you wish to submit your change – we welcome feature additions. If you want to switch back to the official version from development mode, do","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg> free HiQGA","category":"page"},{"location":"#References-for-AEM-and-CSEM-physics","page":"HiQGA Documentation","title":"References for AEM and CSEM physics","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Blatter, D., Key, K., Ray, A., Foley, N., Tulaczyk, S., & Auken, E. (2018). Trans-dimensional Bayesian inversion of airborne transient EM data from Taylor Glacier, Antarctica. Geophysical Journal International, 214(3)\nBrodie, R. C. (2010). Holistic inversion of airborne electromagnetic data. PhD thesis, Australian National University.\nRay, A., & Key, K. (2012). Bayesian inversion of marine CSEM data with a trans-dimensional self parametrizing algorithm. Geophysical Journal International, 191(3), 1135-1151.","category":"page"}] +[{"location":"#HiQGA-Documentation","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"This is a general purpose package for spatial statistical inference, geophysical forward modeling, Bayesian inference and inversion (both determinstic and probabilistic).","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Readily usable geophysical forward operators are to do with AEM, CSEM and MT physics (references underneath), for which the time domain AEM codes are fairly production-ready. The current EM modeling is in 1D, but the inversion framework is dimensionally agnostic (e.g., you e regress images). Adding your own geophysical operators is easy, keep reading down here.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"This package implements both the nested (2-layer) and vanilla trans-dimensional Gaussian process algorithm as published in ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"An information theoretic Bayesian uncertainty analysis of AEM systems over Menindee Lakes, Australia. A.Ray, A-Y. Ley-Cooper, R.C. Brodie, R. Taylor, N. Symington, N. F. Moghaddam, Geophysical Journal International, 235(2)., 2023.\nBayesian inversion using nested trans-dimensional Gaussian processes, A. Ray, Geophysical Journal International, 226(1), 2021.\nBayesian geophysical inversion with trans-dimensional Gaussian process machine learning, A. Ray and D. Myer, Geophysical Journal International 217(3), 2019.\nThere is also a flavour of within-bounds Gauss-Newton/Occam's inversion implemented. For SkyTEM, TEMPEST and VTEM (all AEM), this is fully functional, but for other forward propagators you will have to provide a Jacobian (the linearization of the forward operator).","category":"page"},{"location":"#Installation","page":"HiQGA Documentation","title":"Installation","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"HPC users look here to set up MPI for large jobs, or if you do not have Julia installed at all.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"To install HiQGA, in a perfect world we'd use Julia's Pkg REPL by hitting ] to enter pkg> mode. Then enter the following, at the pkg> prompt:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg> add HiQGA ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"If installing to follow along for the 2022 AEM workshop branch use instead of the above pkg> add HiQGA@0.2.2","category":"page"},{"location":"#Usage","page":"HiQGA Documentation","title":"Usage","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Examples of how to use the package can be found in the examples directory. Simply cd to the relevant example directory and include the .jl files in the order they are named. If using VSCode make sure to do Julia: Change to this Directory from the three dots menu on the top right. The Markov Chain Monte Carlo sampler is configured to support parallel tempering on multiple CPUs - some of the examples accomplish this with Julia's built-in multiprocessing, and others use MPI in order to support inversions on HPC clusters that don't work with Julia's default SSH-based multiprocessing. The MPI examples require MPI.jl and MPIClusterManagers.jl, which are not installed as dependencies for this package, so you will need to ensure they are installed and configured correctly to run these examples. See here for MPI on the NCI.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Some example scripts have as a dependency Revise.jl as we're still actively developing this package, so you may need to install Revise if not already installed. All Julia users should be developing with Revise! After installation, to run the examples, simply clone the package separately (or download as a ZIP), navigate to the examples folder and run the scripts in their numerical order.","category":"page"},{"location":"#Updating-the-package","page":"HiQGA Documentation","title":"Updating the package","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg> update HiQGA","category":"page"},{"location":"#Developing-HiQGA-or-modifying-it-for-your-own-special-forward-physics","page":"HiQGA Documentation","title":"Developing HiQGA or modifying it for your own special forward physics","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"After you have ]added HiQGA you can simply do: ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg>dev HiQGA","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"If you haven't added it already, you can do:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg>dev https://github.com/GeoscienceAustralia/HiQGA.jl.git","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"It will download to your JULIA_PKG_DEVDIR. ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Another way is to simply clone or download this repository to your JULIA_PKG_DEVDIR, rename the cloned directory HiQGA removing the .jl bit and do","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg>dev HiQGA","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Here's a gist on adding your own module if you want to modify the source code. Alternatively, if you only want to use the sampling methods in HiQGA.transD_GP without contributing to the source (boo! j/k) here's another gist which is more appropriate. These gists were written originally for a package called transD_GP so you will have to modify using transD_GP to using HiQGA.transD_GP. Documentation is important and we're working on improving it before a full-release. ","category":"page"},{"location":"#HPC-setup-on-NCI","page":"HiQGA Documentation","title":"HPC setup on NCI","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"If you don't already have access to a julia binary, download the appropriate version .tar.gz from here and then untar it in a location you have write access to, like so: ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"cd /somwehere/home/me\ntar -xvzf /somwehere/home/me/julia-x.x.x.ta.gz","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Then, in your $HOME/bin directory make a symlink to the julia binary like so:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"cd ~/bin\nln -s /somwehere/home/me/julia-x.x.x/bin/julia .","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Make sure your $HOME/bin is in your $PATH else which you can check with echo $PATH | grep\"$HOME/bin\". If you do not see your bin directory highlighted, do export PATH=~/opt/bin:$PATH The preferred development and usage environment for HiQGA is Visual Studio Code, which provides interactive execution of Julia code through the VSCode Julia extension. To install VSCode on the National Computational Infrastructure (NCI), you need to extract the VSCode rpm package using the steps in this gist, to a location where your account has write access. You will NOT be using vscode on a gadi login node, but on OOD.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Get Julia language support from VSCode after launching the VSCode binary by going to File->Extensions by searching for Julia. If after installation it doesn't find the Julia binary, go to File->Extensions->Julia->Manage(the little gear icon) and manually type in /home/yourusername/bin/julia in the \"Executable Path\" field.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"It is also useful to use Revise.jl to ensure changes to the package are immediately reflected in a running Julia REPL (this is the reason that Revise is a dependency on some example scripts as noted above). More information on a workflow to use Revise during development can be found here.","category":"page"},{"location":"#Installing-MPI.jl-and-MPIClusterManagers.jl-on-NCI","page":"HiQGA Documentation","title":"Installing MPI.jl and MPIClusterManagers.jl on NCI","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"We have found that the safest bet for MPI.jl to work without UCX issues on NCI is to use intel-mpi. In order to install MPI.jl and configure it to use the intel-mpi provided by the module intel-mpi/2021.10.0, following the example below. ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"$ module load intel-mpi/2021.10.0\n$ julia\n\njulia > ] \npkg> add MPIPreferences\n Resolving package versions...\n Installed MPIPreferences ─ v0.1.7\n Updating `/g/data/up99/admin/yxs900/cr78_depot/environments/v1.7/Project.toml`\n [3da0fdf6] + MPIPreferences v0.1.7\n Updating `/g/data/up99/admin/yxs900/cr78_depot/environments/v1.7/Manifest.toml`\n [3da0fdf6] + MPIPreferences v0.1.7\nPrecompiling project...\n 1 dependency successfully precompiled in 2 seconds (213 already precompiled)\n\njulia > using MPIPreferences\n\njulia> MPIPreferences.use_system_binary(;library_names=[\"/apps/intel-mpi/2021.10.0/lib/release/libmpi.so\"],mpiexec=\"mpiexec\",abi=\"MPICH\",export_prefs=true,force=true)\n[Info: MPIPreferences changed\n| binary = \"system\"\n| libmpi = \"/apps/intel-mpi/2021.10.0/lib/release/libmpi.so\"\n| abi = \"MPICH\"\n| mpiexec = \"mpiexec\"\n| preloads = Any[]\n[ preloads_env_switch = nothing\n\njulia> exit()","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Once the configuration is completed, install MPI.jl and MPIClusterManagers.jl in a restarted Julia session. We had errors with other versions of MPI.jl besides v0.19.2 on NCI, maybe not an issue elsewhere.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg>add MPI@0.19.2, MPIClusterManagers, Distributed\nResolving package versions...\n No Changes to `~/.julia/environments/v1.9/Project.toml`\n No Changes to `~/.julia/environments/v1.9/Manifest.toml`\nPrecompiling project...\n 4 dependencies successfully precompiled in 5 seconds. 225 already precompiled.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Just to be safe, ensure that MPI has indeed built wth the version you have specified above:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"julia> using MPI\n\njulia> MPI.MPI_VERSION\nv\"3.1.0\"\n\njulia> MPI.MPI_LIBRARY\nIntelMPI::MPIImpl = 4\n\njulia> MPI.MPI_LIBRARY_VERSION\nv\"2021.0.0\"\n\njulia> MPI.identify_implementation()\n(MPI.IntelMPI, v\"2021.0.0\")\n","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"To test, use an interactive NCI job with the following submission:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"qsub -I -lwalltime=1:00:00,mem=16GB,ncpus=4,storage=gdata/z67+gdata/cr78\n.\n.\n.\njob is ready","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"now create a file called mpitest.jl with the following lines on some mount you have access to:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"## MPI Init\nusing MPIClusterManagers, Distributed\nimport MPI\nMPI.Init()\nrank = MPI.Comm_rank(MPI.COMM_WORLD)\nsz = MPI.Comm_size(MPI.COMM_WORLD)\nif rank == 0\n @info \"size is $sz\"\nend\nmanager = MPIClusterManagers.start_main_loop(MPI_TRANSPORT_ALL)\n@info \"there are $(nworkers()) workers\"\nMPIClusterManagers.stop_main_loop(manager)\nrmprocs(workers())\nexit()","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Run the code after loading the intel-mpi module you have linked MPI.jl against with ","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"module load intel-mpi/2021.10.0\nmpirun -np 3 julia mpitest.jl","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"and you should see output like:","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"[ Info: size is 3\n[ Info: there are 2 workers","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"This is the basic recipe for all the cluster HiQGA jobs on NCI. After the call to manager = MPIClusterManagers.start_main_loop(MPI_TRANSPORT_ALL), standard MPI execution stops, and we return to an explicit manager-worker mode with code execution only continuing on the manager which is Julia process 1.","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"The next time you start julia you have HiQGA ready for use with","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"julia> using HiQGA","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"navigate to the examples folder to run some example scripts. You can end here as a regular user, however for development mode see below.","category":"page"},{"location":"#For-installing-development-mode-pre-release-versions","page":"HiQGA Documentation","title":"For installing development mode pre-release versions","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg> dev HiQGA","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Make a pull request if you wish to submit your change – we welcome feature additions. If you want to switch back to the official version from development mode, do","category":"page"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"pkg> free HiQGA","category":"page"},{"location":"#References-for-AEM-and-CSEM-physics","page":"HiQGA Documentation","title":"References for AEM and CSEM physics","text":"","category":"section"},{"location":"","page":"HiQGA Documentation","title":"HiQGA Documentation","text":"Blatter, D., Key, K., Ray, A., Foley, N., Tulaczyk, S., & Auken, E. (2018). Trans-dimensional Bayesian inversion of airborne transient EM data from Taylor Glacier, Antarctica. Geophysical Journal International, 214(3)\nBrodie, R. C. (2010). Holistic inversion of airborne electromagnetic data. PhD thesis, Australian National University.\nRay, A., & Key, K. (2012). Bayesian inversion of marine CSEM data with a trans-dimensional self parametrizing algorithm. Geophysical Journal International, 191(3), 1135-1151.","category":"page"}] }