Skip to content

Commit

Permalink
Move tutorials (#1876)
Browse files Browse the repository at this point in the history
  • Loading branch information
atmyers authored Mar 22, 2021
1 parent 384ca23 commit d146800
Show file tree
Hide file tree
Showing 582 changed files with 150 additions and 23,890 deletions.
68 changes: 34 additions & 34 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ jobs:
export PATH=/tmp/my-amrex/bin:$PATH
which fcompare
# Build libamrex and all tutorials
tutorials:
name: GNU@7.5 C++14 [tutorials]
# Build libamrex and all tests
tests_build:
name: GNU@7.5 C++14 [tests]
runs-on: ubuntu-18.04
env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"}
steps:
Expand All @@ -74,13 +74,13 @@ jobs:
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_PARTICLES=ON
make -j 2
# Build libamrex and all tutorials
tutorials_cxx20:
name: GNU@10.1 C++20 OMP [tutorials]
# Build libamrex and all tests
tests_cxx20:
name: GNU@10.1 C++20 OMP [tests]
runs-on: ubuntu-18.04
env: {CXXFLAGS: "-Werror -Wno-error=deprecated-declarations -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"}
steps:
Expand All @@ -94,7 +94,7 @@ jobs:
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_OMP=ON \
-DAMReX_PARTICLES=ON \
-DCMAKE_CXX_STANDARD=20 \
Expand All @@ -103,8 +103,8 @@ jobs:
-DCMAKE_Fortran_COMPILER=$(which gfortran-10)
make -j 2
tutorials_clang:
name: Clang@6.0 C++14 SP Particles DP Mesh Debug [tutorials]
tests_clang:
name: Clang@6.0 C++14 SP Particles DP Mesh Debug [tests]
runs-on: ubuntu-18.04
env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -fno-operator-names"}
steps:
Expand All @@ -118,7 +118,7 @@ jobs:
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_MPI=OFF \
-DAMReX_PARTICLES=ON \
-DAMReX_PRECISION=DOUBLE \
Expand All @@ -129,9 +129,9 @@ jobs:
-DCMAKE_Fortran_COMPILER=$(which gfortran)
make -j 2
# Build libamrex and all tutorials w/o MPI
tutorials-nonmpi:
name: GNU@7.5 C++14 NOMPI [tutorials]
# Build libamrex and all tests w/o MPI
tests-nonmpi:
name: GNU@7.5 C++14 NOMPI [tests]
runs-on: ubuntu-18.04
env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"}
steps:
Expand All @@ -145,14 +145,14 @@ jobs:
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_MPI=OFF \
-DAMReX_PARTICLES=ON
make -j 2
# Build libamrex and all tutorials
tutorials-nofortran:
name: GNU@7.5 C++14 w/o Fortran [tutorials]
# Build libamrex and all tests
tests-nofortran:
name: GNU@7.5 C++14 w/o Fortran [tests]
runs-on: ubuntu-18.04
env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"}
steps:
Expand All @@ -166,14 +166,14 @@ jobs:
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_PARTICLES=ON \
-DAMReX_FORTRAN=OFF
make -j 2
# Build libamrex and all tutorials with CUDA 9.2
tutorials-cuda9:
name: CUDA@9.2 GNU@6.5.0 C++14 Release [tutorials]
# Build libamrex and all tests with CUDA 9.2
tests-cuda9:
name: CUDA@9.2 GNU@6.5.0 C++14 Release [tests]
runs-on: ubuntu-18.04
env: {CXXFLAGS: "-fno-operator-names"}
steps:
Expand All @@ -189,7 +189,7 @@ jobs:
cd build
cmake .. \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_PARTICLES=ON \
-DAMReX_GPU_BACKEND=CUDA \
-DCMAKE_C_COMPILER=$(which gcc-6) \
Expand All @@ -200,9 +200,9 @@ jobs:
-DAMReX_CUDA_ERROR_CROSS_EXECUTION_SPACE_CALL=ON
make -j 2
# Build libamrex and all tutorials with CUDA 11.0.2 (recent supported)
tutorials-cuda11:
name: CUDA@11.2 GNU@9.3.0 C++17 Release [tutorials]
# Build libamrex and all tests with CUDA 11.0.2 (recent supported)
tests-cuda11:
name: CUDA@11.2 GNU@9.3.0 C++17 Release [tests]
runs-on: ubuntu-20.04
env: {CXXFLAGS: "-fno-operator-names"}
steps:
Expand All @@ -217,7 +217,7 @@ jobs:
cmake -S . -B build \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_PARTICLES=ON \
-DAMReX_GPU_BACKEND=CUDA \
-DCMAKE_C_COMPILER=$(which gcc) \
Expand All @@ -232,8 +232,8 @@ jobs:
cmake --build build -j 2
tutorials-dpcpp:
name: DPCPP GFortran@7.5 C++17 [tutorials]
tests-dpcpp:
name: DPCPP GFortran@7.5 C++17 [tests]
runs-on: ubuntu-20.04
env: {CXXFLAGS: "-fno-operator-names"}
steps:
Expand All @@ -250,7 +250,7 @@ jobs:
-DCMAKE_CXX_COMPILER_VERSION=12.0 \
-DCMAKE_CXX_STANDARD_COMPUTED_DEFAULT="17" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_PARTICLES=ON \
-DAMReX_GPU_BACKEND=SYCL \
-DCMAKE_C_COMPILER=$(which clang) \
Expand All @@ -261,8 +261,8 @@ jobs:
# the 2021.1 DPC++ release / CMake 3.19.0-3.19.1
# https://gitlab.kitware.com/cmake/cmake/-/issues/21551#note_869580

tutorials-hip:
name: HIP ROCm@3.8 GFortran@9.3 C++17 [tutorials]
tests-hip:
name: HIP ROCm@3.8 GFortran@9.3 C++17 [tests]
runs-on: ubuntu-20.04
env: {CXXFLAGS: "-fno-operator-names"}
steps:
Expand All @@ -277,7 +277,7 @@ jobs:
cd build
cmake .. \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_PARTICLES=ON \
-DAMReX_FORTRAN=ON \
-DAMReX_LINEAR_SOLVERS=ON \
Expand Down Expand Up @@ -387,7 +387,7 @@ jobs:
make -j2 USE_MPI=FALSE USE_OMP=FALSE WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS=-fno-operator-names
# Build libamrex and run all tests
tests:
tests_run:
name: GNU@7.5 C++14 [tests]
runs-on: ubuntu-18.04
env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ env:
CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -fno-operator-names"

jobs:
# Build libamrex and all tutorials
tutorials-macos:
name: AppleClang@11.0 GFortran@9.3 [tutorials]
# Build libamrex and all tests
tests-macos:
name: AppleClang@11.0 GFortran@9.3 [tests]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -20,15 +20,15 @@ jobs:
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_PARTICLES=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache)
cmake --build build --parallel 2
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_PARTICLES=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache)
cmake --build build --parallel 2
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: windows
on: [push, pull_request]

jobs:
# Build libamrex and all tutorials
tutorials_msvc:
# Build libamrex and all tests
tests_msvc:
name: MSVC C++17 w/o Fortran w/o MPI
runs-on: windows-latest
steps:
Expand All @@ -15,14 +15,14 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug `
-DBUILD_SHARED_LIBS=ON `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DAMReX_BUILD_TUTORIALS=ON `
-DAMReX_ENABLE_TESTS=ON `
-DAMReX_FORTRAN=OFF `
-DAMReX_MPI=OFF `
-DAMReX_PARTICLES=ON
cmake --build build --config Debug -j 2
# Build libamrex and all tutorials (static)
tutorials_msvc_static:
# Build libamrex and all test (static)
test_msvc_static:
name: MSVC C++17 w/o Fortran w/o MPI static
runs-on: windows-latest
steps:
Expand All @@ -32,14 +32,14 @@ jobs:
cmake -S . -B build `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DAMReX_BUILD_TUTORIALS=ON `
-DAMReX_ENABLE_TESTS=ON `
-DAMReX_FORTRAN=OFF `
-DAMReX_MPI=OFF `
-DAMReX_PARTICLES=ON
cmake --build build --config RelWithDebInfo -j 2
# Build libamrex and all tutorials
tutorials_clang:
# Build libamrex and all tests
tests_clang:
name: Clang C++17 w/o Fortran w/o MPI
runs-on: windows-latest
steps:
Expand All @@ -54,7 +54,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_SHARED_LIBS=ON ^
-DCMAKE_VERBOSE_MAKEFILE=ON ^
-DAMReX_BUILD_TUTORIALS=ON ^
-DAMReX_ENABLE_TESTS=ON ^
-DAMReX_FORTRAN=OFF ^
-DAMReX_MPI=OFF ^
-DAMReX_OMP=ON ^
Expand Down
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,6 @@ get_property(_amrex_targets
DIRECTORY Src
PROPERTY BUILDSYSTEM_TARGETS)

#
# Tutorials and "test_install" target
#
option(AMReX_BUILD_TUTORIALS "Build tutorials" NO)

if (AMReX_BUILD_TUTORIALS)
message(STATUS "Enabling Tutorials")
add_subdirectory(Tutorials)
endif ()

#
# Plotfile tools
#
Expand Down
34 changes: 0 additions & 34 deletions Docs/sphinx_documentation/source/BuildingAMReX.rst
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,6 @@ The list of available options is reported in the :ref:`table <tab:cmakevar>` bel
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_PLOTFILE_TOOLS | Build and install plotfile postprocessing tools| NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_BUILD_TUTORIALS | Build tutorials | NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_ENABLE_TESTS | Enable CTest suite | NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_DIFFERENT_COMPILER | Allow an app to use a different compiler | NO | YES, NO |
Expand Down Expand Up @@ -519,38 +517,6 @@ are defined, AMReX default flags are used.

For a detailed explanation of GPU support in AMReX CMake, refer to section :ref:`sec:gpu:build`.


Building Tutorials
------------------

In order to build the tutorials provided in ``Tutorials/`` alongside the AMReX library,
follows these steps:

.. highlight:: console

::

mkdir /path/to/builddir
cd /path/to/builddir
cmake [options] -DAMReX_BUILD_TUTORIALS=YES /path/to/amrex
make


Note that only the tutorials compatible with ``[options]`` will be built.
To run one of the tutorials, do:

.. highlight:: console

::

cd /path/to/builddir/Tutorials/group/name
./Tutorial_group_name [input_file]


``[input_file]`` is any of the input files required by the tutorials and located in
``/path/to/builddir/Tutorials/group/name/``


CMake and macOS
---------------

Expand Down
12 changes: 6 additions & 6 deletions Src/Base/AMReX_FabArrayBase.H
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,13 @@ public:
};

//! Default tilesize in MFIter
static IntVect mfiter_tile_size;
static AMREX_EXPORT IntVect mfiter_tile_size;

//! Default tilesize in MFGhostIter
static IntVect mfghostiter_tile_size;
static AMREX_EXPORT IntVect mfghostiter_tile_size;

//! The maximum number of components to copy() at a time.
static int MaxComp;
static AMREX_EXPORT int MaxComp;

//! Initialize from ParmParse with "fabarray" prefix.
static void Initialize ();
Expand All @@ -308,7 +308,7 @@ public:
* intersections among boxes into smaller tiles. This sets
* their maximum size.
*/
static IntVect comm_tile_size; //!< communication tile size
static AMREX_EXPORT IntVect comm_tile_size; //!< communication tile size

struct FPinfo
{
Expand Down Expand Up @@ -422,7 +422,7 @@ public:
static void pushRegionTag (std::string t);
static void popRegionTag ();

static std::vector<std::string> m_region_tag;
static AMREX_EXPORT std::vector<std::string> m_region_tag;
struct RegionTag {
RegionTag (const char* t) { pushRegionTag(t); }
RegionTag (std::string t) { pushRegionTag(std::move(t)); }
Expand Down Expand Up @@ -687,7 +687,7 @@ public:
<< " max # of BoxArray uses: " << max_num_ba_use << "\n";
}
};
static FabArrayStats m_FA_stats;
static AMREX_EXPORT FabArrayStats m_FA_stats;

};

Expand Down
2 changes: 1 addition & 1 deletion Src/Base/AMReX_NFiles.H
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class NFilesIter

static const int indexUndefined = -1;

static int minDigits; //!< for Concatenate
static AMREX_EXPORT int minDigits; //!< for Concatenate

NFilesIter(); //!< disallow
};
Expand Down
Loading

0 comments on commit d146800

Please sign in to comment.