Manual Installation¶
Getting Components¶
General Information¶
The Git version control system is fundamental to the evolution, storage, and retrieval of turboWAVE components.
TurboWAVE components are maintained in a single repository. Unless you are doing development yourself, you will typically interact only with the master branch. The commits that make up the master branch have varying degrees of stability. Stable releases are identified by a tag. The tag may have letter suffixes a, b, or rc, indicating alpha, beta, or release candidate. A numerical tag with no letter suffix is the most stable.
The turboWAVE repository is at https://github.com/USNavalResearchLaboratory/turboWAVE.
Cloning the Repository¶
The first step to getting the components is to clone the repository. This copies the entire history of the code to your local computer (storage requirement is in the tens of megabytes). Perform the following procedure:
Open a terminal window
Test to see if you have Git installed by executing
git --versionInstall Git if necessary.
Anaconda —
conda install gitMacOS with Homebrew —
brew install gitUbuntu —
sudo apt install gitWindows —
winget install Git.Git(run as administrator)Navigate to the directory where you want to install turboWAVE (you don’t need to make an enclosing directory).
git clone https://github.com/USNavalResearchLaboratory/turboWAVE.git
Switching to a Stable Version¶
When you clone the repository the active files (the version you have checked out) will likely be the latest commit, which is not necessarily the most stable. In order to select a stable version perform the following procedure.
Open a terminal and navigate to
turboWAVE.
git tag --listChoose the latest tag without a letter suffix,
latest_stable_tag.
git switch --detach latest_stable_tag.
To go back from the detached state use
git switch master, or, to automatically throw out any changes, add the-fflag.
Note
if you are viewing this documentation on readthedocs, you are likely viewing the latest documentation which is not necessarily the stable documentation. There should be a hovering dropdown to select between the two.
Tools Installation¶
General Notes¶
Most of the tools are built on Python 3. It is highly recommended to operate in a virtual environment. Virtual environments can be created using native Python tools, or Anaconda.
Tools are synchronized with core to within major and minor version numbers (the patch and build numbers may differ). For the best results, keep the installed versions consistent.
Python Module twutils¶
You can create a conda environment with the necessary modules and scripts using
conda create -n NAME -c dfxgordon twutils, whereNAMEis the name of the environment (your choice).You can install from the local repository using
pip install .(note dot) from within theturboWAVE/tools/twutilsdirectory.
Python DataViewer (optional)¶
The Python DataViewer has to be run in a Jupyter Notebook.
Copy
turboWAVE/tools/DataViewer.ipynbto wherever you keep your notebooksCreate a directory
~/.jupyter/custom/and copyturboWAVE/tools/config-files/custom.cssto the new directory.
Input File Support (optional)¶
You can add language support for turboWAVE input files in various editors.
For
VS Code, language support can be installed using the editor’s own GUI, search forturbowave.To enable turboWAVE input file syntax highlights with the
microeditorCopy
turboWAVE/tools/config-files/turbowave.micro.yamlto%HomePath%\.config\micro\syntax\(Windows) or~/.config/micro/syntax/(others).
To enable turboWAVE input file syntax highlights with the
nanoeditorCopy
turboWAVE/tools/config-files/.turbowave.nanoto your home directory.Edit (create if necessary)
%HomePath%\nano.rc(windows) or~/.nanorc(others) and add the lineinclude "~/.turbowave.nanorc".
To enable turboWAVE input file syntax highlights with the
vimeditorCopy
turboWAVE/tools/config-files/filetype.vimto%HomePath%\vimfiles\(Windows) or~/.vim/(others)Copy
turboWAVE/tools/config-files/turbowave.vimto%HomePath%\vimfiles\syntax\or~/.vim/syntax/(others).
Core Installation¶
As of this writing there is only one build system that can be used, CMake. This is because only CMake fully supports C++20 modules.
Configuration¶
Manually edit
base/config.h.in
Performance Tuning Parameters¶
There are a few parameters hard coded in source that can be used to tune performance. These are as follows.
Particle bundle size - In
base.h, you should changemax_bundle_sizeto be a multiple ofvbitsdivided by 32. The optimal choice is difficult to predict, but a rule of thumb is to make it close to the typical number of particles per cell.There are some constants in
Pusher.cpp, in the methodSpecies::Push, that it may be advantageous to adjust. Namely, the constantsmin_particles_per_taskandpreferred_tasks. This has to do with how particles are partitioned among OpenMP threads.
Build and Install¶
See the comments in
CMakeLists.txt
Core Install for HPC¶
As of this writing we have not found an HPC center with sufficiently up-to-date build tools