-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into shock_paper_detonation
- Loading branch information
Showing
55 changed files
with
34,822 additions
and
1,596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# http://EditorConfig.org | ||
# | ||
# precedence of rules is bottom to top | ||
|
||
# this is the top-most EditorConfig file | ||
root = true | ||
|
||
|
||
[*.{c,h,cpp,hpp,H,py}] | ||
# 4 space indentation | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# Clean up trailing whitespace | ||
trim_trailing_whitespace = true | ||
|
||
# unix-style newlines | ||
end_of_line = lf | ||
|
||
# newline ending in files | ||
insert_final_newline = true | ||
|
||
|
||
[*.md] | ||
# two end of line whitespaces are newlines without a paragraph | ||
trim_trailing_whitespace = false | ||
|
||
|
||
[*.rst] | ||
# Enforce UTF-8 encoding | ||
charset = utf-8 | ||
|
||
# Unix-style newlines | ||
end_of_line = lf | ||
|
||
# Newline ending in files | ||
insert_final_newline = true | ||
|
||
# 3 space indentation | ||
indent_style = space | ||
indent_size = 3 | ||
|
||
# Clean up trailing whitespace | ||
trim_trailing_whitespace = true | ||
|
||
[{Makefile,GNUmakefile,Make.*}] | ||
# TABs are part of its syntax | ||
indent_style = tab | ||
indent_size = unset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
********************* | ||
GPU Programming Model | ||
********************* | ||
|
||
CPUs and GPUs have separate memory, which means that working on both | ||
the host and device may involve managing the transfer of data between | ||
the memory on the host and that on the GPU. | ||
|
||
In Castro, the core design when running on GPUs is that all of the compute | ||
should be done on the GPU. | ||
|
||
When we compile with ``USE_CUDA=TRUE`` or ``USE_HIP=TRUE``, AMReX will allocate | ||
a pool of memory on the GPUs and all of the ``StateData`` will be stored there. | ||
As long as we then do all of the computation on the GPUs, then we don't need | ||
to manage any of the data movement manually. | ||
|
||
.. note:: | ||
|
||
We can tell AMReX to allocate the data using managed-memory by | ||
setting: | ||
|
||
:: | ||
|
||
amrex.the_arena_is_managed = 1 | ||
|
||
This is generally not needed. | ||
|
||
The programming model used throughout Castro is C++-lambda-capturing | ||
by value. We access the ``FArrayBox`` stored in the ``StateData`` | ||
``MultiFab`` by creating an ``Array4`` object. The ``Array4`` does | ||
not directly store a copy of the data, but instead has a pointer to | ||
the data in the ``FArrayBox``. When we capture the ``Array4`` by | ||
value in the GPU kernel, the GPU gets access to the pointer to the | ||
underlying data. | ||
|
||
|
||
Most AMReX functions will work on the data directly on the GPU (like | ||
``.setVal()``). | ||
|
||
In rare instances where we might need to operate on the data on the | ||
host, we can force a copy to the host, do the work, and then copy | ||
back. For an example, see the reduction done in ``Gravity.cpp``. | ||
|
||
.. note:: | ||
|
||
For a thorough discussion of how the AMReX GPU offloading works | ||
see :cite:`amrex-ecp`. | ||
|
||
|
||
Runtime parameters | ||
------------------ | ||
|
||
The main exception for all data being on the GPUs all the time are the | ||
runtime parameters. At the moment, these are allocated as managed | ||
memory and stored in global memory. This is simply to make it easier | ||
to read them in and initialize them on the CPU at runtime. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
PRECISION = DOUBLE | ||
PROFILE = FALSE | ||
DEBUG = FALSE | ||
DIM = 2 | ||
|
||
COMP = gnu | ||
|
||
USE_MPI = TRUE | ||
USE_OMP = FALSE | ||
|
||
USE_GRAV = TRUE | ||
USE_REACT = TRUE | ||
|
||
USE_SHOCK_VAR = TRUE | ||
|
||
MAX_NPTS_MODEL = 32678 | ||
|
||
USE_MODEL_PARSER = TRUE | ||
|
||
USE_SIMPLIFIED_SDC = TRUE | ||
|
||
CASTRO_HOME ?= ../../.. | ||
|
||
# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos | ||
EOS_DIR := helmholtz | ||
|
||
# This sets the network directory in $(MICROPHYSICS_HOME)/networks | ||
NETWORK_DIR := subch_simple | ||
|
||
PROBLEM_DIR ?= ./ | ||
|
||
Bpack := $(PROBLEM_DIR)/Make.package | ||
Blocs := $(PROBLEM_DIR) | ||
|
||
include $(CASTRO_HOME)/Exec/Make.Castro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
void ca_dergradpoverp | ||
(const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, int /*ncomp*/, | ||
const amrex::FArrayBox& datfab, const amrex::Geometry& geomdata, | ||
amrex::Real /*time*/, const int* /*bcrec*/, int /*level*/); | ||
|
||
void ca_dergradpoverp1 | ||
(const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, int /*ncomp*/, | ||
const amrex::FArrayBox& datfab, const amrex::Geometry& geomdata, | ||
amrex::Real /*time*/, const int* /*bcrec*/, int /*level*/); |
Oops, something went wrong.