Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ blt_add_library(
"src/Kripke/Kernel/Scattering.cpp"
"src/Kripke/Kernel/Source.cpp"
"src/Kripke/Kernel/SweepSubdomain.cpp"
"src/Kripke/Kernel/ErrorNorms.cpp"
"src/Kripke/ParallelComm/BlockJacobiComm.cpp"
"src/Kripke/ParallelComm/SweepComm.cpp"
"src/Kripke/ParallelComm.cpp"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The steady-state solution method uses the source-iteration technique, where each
4. Rhs = LPlusTimes(PhiOut)
5. Psi = Sweep(Rhs, Psi) which is solving Psi=(Hinverse * Rhs) a.k.a _"Inverting H"_


Kripke can compute error norms for the type 3i problem by passing the "--compute_errors" flag on the command line. Problem 3i does not have scattering, so the scattering terms should be turned off by passing Kripke "--sigs 0,0,0". In the future we may add comparisons to the 3ii benchmark points given in the original paper for specific scattering coefficients.

Building and Running
====================
Expand Down
308 changes: 308 additions & 0 deletions src/Kripke/Arch/ErrorNorms.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
/*
* NOTICE
*
* This work was produced at the Lawrence Livermore National Laboratory (LLNL)
* under contract no. DE-AC-52-07NA27344 (Contract 44) between the U.S.
* Department of Energy (DOE) and Lawrence Livermore National Security, LLC
* (LLNS) for the operation of LLNL. The rights of the Federal Government are
* reserved under Contract 44.
*
* DISCLAIMER
*
* This work was prepared as an account of work sponsored by an agency of the
* United States Government. Neither the United States Government nor Lawrence
* Livermore National Security, LLC nor any of their employees, makes any
* warranty, express or implied, or assumes any liability or responsibility
* for the accuracy, completeness, or usefulness of any information, apparatus,
* product, or process disclosed, or represents that its use would not infringe
* privately-owned rights. Reference herein to any specific commercial products,
* process, or service by trade name, trademark, manufacturer or otherwise does
* not necessarily constitute or imply its endorsement, recommendation, or
* favoring by the United States Government or Lawrence Livermore National
* Security, LLC. The views and opinions of authors expressed herein do not
* necessarily state or reflect those of the United States Government or
* Lawrence Livermore National Security, LLC, and shall not be used for
* advertising or product endorsement purposes.
*
* NOTIFICATION OF COMMERCIAL USE
*
* Commercialization of this product is prohibited without notifying the
* Department of Energy (DOE) or Lawrence Livermore National Security.
*/

#ifndef KRIPKE_ARCH_ERRORNORMS
#define KRIPKE_ARCH_ERRORNORMS

#include <Kripke.h>
#include <Kripke/VarTypes.h>

namespace Kripke {
namespace Arch {

template<typename AL>
struct Policy_ErrorNorms;

template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_DGZ>> {
using ReducePolicy = seq_reduce;

using ExecPolicy =
KernelPolicy<
For<0, loop_exec, // direction
For<1, loop_exec, // group
For<2, loop_exec, // k
For<3, loop_exec, // j
For<4, loop_exec, // i
Lambda<0>
>
>
>
>
>
>;
};


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_DZG>> {
using ReducePolicy = seq_reduce;
using ExecPolicy =
KernelPolicy<
For<0, loop_exec, // direction
For<2, loop_exec, // k
For<3, loop_exec, // j
For<4, loop_exec, // i
For<1, loop_exec, // group
Lambda<0>
>
>
>
>
>
>;
};


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_GDZ>> {
using ReducePolicy = seq_reduce;
using ExecPolicy =
KernelPolicy<
For<1, loop_exec, // group
For<0, loop_exec, // direction
For<2, loop_exec, // k
For<3, loop_exec, // j
For<4, loop_exec, // i
Lambda<0>
>
>
>
>
>
>;
};


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_GZD>> {
using ReducePolicy = seq_reduce;
using ExecPolicy =
KernelPolicy<
For<1, loop_exec, // group
For<2, loop_exec, // k
For<3, loop_exec, // j
For<4, loop_exec, // i
For<0, loop_exec, // direction
Lambda<0>
>
>
>
>
>
>;
};


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_ZDG>> {
using ReducePolicy = seq_reduce;
using ExecPolicy =
KernelPolicy<
For<2, loop_exec, // k
For<3, loop_exec, // j
For<4, loop_exec, // i
For<0, loop_exec, // direction
For<1, loop_exec, // group
Lambda<0>
>
>
>
>
>
>;
};


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_ZGD>> {
using ReducePolicy = seq_reduce;
using ExecPolicy =
KernelPolicy<
For<2, loop_exec, // k
For<3, loop_exec, // j
For<4, loop_exec, // i
For<1, loop_exec, // group
For<0, loop_exec, // direction
Lambda<0>
>
>
>
>
>
>;
};




#ifdef KRIPKE_USE_OPENMP


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_OpenMP, LayoutT_DGZ>> {

using ReducePolicy = omp_reduce;

using ExecPolicy =
KernelPolicy<
Collapse<omp_parallel_collapse_exec, ArgList<0,1>, // direction, group
For<2, loop_exec, // k
For<3, loop_exec, // j
For<4, loop_exec, // i
Lambda<0>
>
>
>
>
>;
};


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_OpenMP, LayoutT_DZG>> {
using ReducePolicy = omp_reduce;
using ExecPolicy =
KernelPolicy<
For<0, omp_parallel_for_exec, // direction
For<2, loop_exec, // k
For<3, loop_exec, // j
For<4, loop_exec, // i
For<1, loop_exec, // group
Lambda<0>
>
>
>
>
>
>;
};


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_OpenMP, LayoutT_GDZ>> {
using ReducePolicy = omp_reduce;
using ExecPolicy =
KernelPolicy<
Collapse<omp_parallel_collapse_exec, ArgList<1,0>, // group, direction
For<2, loop_exec, // k
For<3, loop_exec, // j
For<4, loop_exec, // i
Lambda<0>
>
>
>
>
>;
};


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_OpenMP, LayoutT_GZD>> {
using ReducePolicy = omp_reduce;
using ExecPolicy =
KernelPolicy<
For<1, omp_parallel_for_exec, // group
For<2, loop_exec, // k
For<3, loop_exec, // j
For<4, loop_exec, // i
For<0, loop_exec, // direction
Lambda<0>
>
>
>
>
>
>;
};


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_OpenMP, LayoutT_ZDG>> {
using ReducePolicy = omp_reduce;
using ExecPolicy =
KernelPolicy<
Hyperplane<2, seq_exec, ArgList<3,4>, omp_parallel_collapse_exec,
For<0, loop_exec, // direction
For<1, loop_exec, // group
Lambda<0>
>
>
>
>;
};


template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_OpenMP, LayoutT_ZGD>> {
using ReducePolicy = omp_reduce;
using ExecPolicy =
KernelPolicy<
Hyperplane<2, seq_exec, ArgList<3,4>, omp_parallel_collapse_exec,
For<1, loop_exec, // group
For<0, loop_exec, // direction
Lambda<0>
>
>
>
>;
};

#endif // KRIPKE_USE_OPENMP


#ifdef KRIPKE_USE_CUDA

template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_CUDA, LayoutT_DGZ>> : public Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_DGZ>> {};

template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_CUDA, LayoutT_DZG>> : public Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_DZG>> {};

template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_CUDA, LayoutT_GDZ>> : public Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_GDZ>> {};

template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_CUDA, LayoutT_GZD>> : public Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_GZD>> {};

template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_CUDA, LayoutT_ZDG>> : public Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_ZDG>> {};

template<>
struct Policy_ErrorNorms<ArchLayoutT<ArchT_CUDA, LayoutT_ZGD>> : public Policy_ErrorNorms<ArchLayoutT<ArchT_Sequential, LayoutT_ZGD>> {};

#endif // KRIPKE_USE_CUDA

}
}

#endif
Loading