Skip to content

Commit

Permalink
Merge branch 'reformat-code' into 'master'
Browse files Browse the repository at this point in the history
Reorder #include directives

See merge request OPAL/Libraries/ippl!160
  • Loading branch information
Arc676 committed Mar 17, 2023
2 parents d2e380e + 9b727cf commit dbfaf74
Show file tree
Hide file tree
Showing 93 changed files with 279 additions and 188 deletions.
27 changes: 26 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,32 @@ BreakConstructorInitializers: BeforeComma
ColumnLimit: 100
DerivePointerAlignment: false
IndentWidth: 4
IncludeBlocks: Preserve
IncludeBlocks: Regroup
IncludeCategories:
- Regex: 'Kokkos_Core'
Priority: -1
SortPriority: -2
- Regex: '^"Ippl'
Priority: -1
SortPriority: -1
- Regex: '^<.*>$'
Priority: 2
- Regex: 'Types[^/]*"$'
Priority: 10
- Regex: '^"Types'
Priority: 20
- Regex: '^"Utility'
Priority: 30
- Regex: '^"Expression'
Priority: 40
- Regex: '.*Field.h"$'
Priority: 50
- Regex: 'BConds'
Priority: 50
SortPriority: 51
- Regex: 'BcTypes'
Priority: 50
SortPriority: 52
IndentGotoLabels: false
NamespaceIndentation: All
PackConstructorInitializers: Never
Expand Down
8 changes: 4 additions & 4 deletions alpine/BumponTailInstability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
// along with IPPL. If not, see <https://www.gnu.org/licenses/>.
//

#include <Kokkos_Random.hpp>
#include <chrono>
#include <cmath>
#include <iostream>
#include <random>
#include <set>
#include <string>
#include <vector>
#include "ChargedParticles.hpp"

#include <Kokkos_Random.hpp>

#include <random>
#include "Utility/IpplTimings.h"

#include "ChargedParticles.hpp"

template <typename T>
struct Newton1D {
double tol = 1e-12;
Expand Down
1 change: 1 addition & 0 deletions alpine/ChargedParticles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//

#include "Ippl.h"

#include "Solver/FFTPeriodicPoissonSolver.h"

// dimension of our positions
Expand Down
8 changes: 4 additions & 4 deletions alpine/LandauDamping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@
// along with IPPL. If not, see <https://www.gnu.org/licenses/>.
//

#include <Kokkos_Random.hpp>
#include <chrono>
#include <cmath>
#include <iostream>
#include <random>
#include <set>
#include <string>
#include <vector>
#include "ChargedParticles.hpp"

#include <Kokkos_Random.hpp>

#include <random>
#include "Utility/IpplTimings.h"

#include "ChargedParticles.hpp"

template <typename T>
struct Newton1D {
double tol = 1e-12;
Expand Down
8 changes: 4 additions & 4 deletions alpine/PenningTrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
// You should have received a copy of the GNU General Public License
// along with IPPL. If not, see <https://www.gnu.org/licenses/>.
//
#include "ChargedParticles.hpp"

#include <Kokkos_Random.hpp>
#include <chrono>
#include <cmath>
#include <iostream>
#include <random>
#include <set>
#include <string>
#include <vector>

#include <Kokkos_Random.hpp>
#include <random>
#include "Utility/IpplTimings.h"

#include "ChargedParticles.hpp"

template <typename T>
struct Newton1D {
double tol = 1e-12;
Expand Down
9 changes: 4 additions & 5 deletions alpine/UniformPlasmaTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,18 @@
// You should have received a copy of the GNU General Public License
// along with IPPL. If not, see <https://www.gnu.org/licenses/>.
//
#include "ChargedParticles.hpp"

#include <Kokkos_Random.hpp>
#include <chrono>
#include <iostream>
#include <random>
#include <set>
#include <string>
#include <vector>

#include <Kokkos_Random.hpp>

#include <random>
#include "Utility/IpplTimings.h"

#include "ChargedParticles.hpp"

const char* TestName = "UniformPlasmaTest";

template <typename T, class GeneratorPool, unsigned Dim>
Expand Down
3 changes: 1 addition & 2 deletions src/AmrParticle/AmrParticleBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@

#include "Ippl.h"

#include "Particle/IpplParticleBase.h"

#include "AmrParticleLevelCounter.h"
#include "Particle/IpplParticleBase.h"

template <class PLayout>
class AmrParticleBase : public IpplParticleBase<PLayout> {
Expand Down
3 changes: 2 additions & 1 deletion src/Communicate/Archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
#define IPPL_ARCHIVE_H

#include "Types/IpplTypes.h"
#include "Types/Vector.h"
#include "Types/ViewTypes.h"

#include "Types/Vector.h"

namespace ippl {
namespace detail {
/*!
Expand Down
4 changes: 2 additions & 2 deletions src/Communicate/Archive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with IPPL. If not, see <https://www.gnu.org/licenses/>.
//
#include "Archive.h"

#include <cstring>

#include "Archive.h"

namespace ippl {
namespace detail {

Expand Down
2 changes: 1 addition & 1 deletion src/Communicate/Communicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#ifndef IPPL_COMMUNICATE_H
#define IPPL_COMMUNICATE_H

#include <mpi.h>
#include <map>
#include <mpi.h>

// For message size check; see below
#include <climits>
Expand Down
8 changes: 5 additions & 3 deletions src/Communicate/GlobalComm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
***************************************************************************/

// include files
#include <algorithm>

#include "Communicate/DataTypes.h"

#include "Utility/IpplInfo.h"

#include "Communicate/GlobalComm.h"
#include "Communicate/Operations.h"
#include "Communicate/Tags.h"
#include "Utility/IpplInfo.h"

#include <algorithm>

////////////////////////////////////////////////////////////////////////////
// Reduce equally-sized arrays across the machine, by sending to node
Expand Down
2 changes: 1 addition & 1 deletion src/Communicate/Operations.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#ifndef IPPL_MPI_OPERATIONS_H
#define IPPL_MPI_OPERATIONS_H

#include <mpi.h>
#include <functional>
#include <mpi.h>

template <class>
struct is_ippl_mpi_type : std::false_type {};
Expand Down
8 changes: 5 additions & 3 deletions src/FFT/FFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,19 @@
#ifndef IPPL_FFT_FFT_H
#define IPPL_FFT_FFT_H

#include <array>
#include <heffte_fft3d.h>
#include <heffte_fft3d_r2c.h>
#include <array>
#include <memory>
#include <type_traits>

#include "Field/Field.h"
#include "FieldLayout/FieldLayout.h"
#include "Utility/IpplException.h"
#include "Utility/ParameterList.h"

#include "Field/Field.h"

#include "FieldLayout/FieldLayout.h"

namespace heffte {

template <>
Expand Down
6 changes: 4 additions & 2 deletions src/FFT/FFT.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
Implementations for FFT constructor/destructor and transforms
*/

#include "FFT/FFT.h"
#include "Utility/IpplTimings.h"

#include "Field/BareField.h"

#include "FFT/FFT.h"
#include "FieldLayout/FieldLayout.h"
#include "Utility/IpplTimings.h"

namespace ippl {

Expand Down
4 changes: 2 additions & 2 deletions src/Field/BConds.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
#ifndef IPPL_FIELD_BC_H
#define IPPL_FIELD_BC_H

#include "Field/BcTypes.h"

#include <array>
#include <iostream>
#include <memory>

#include "Field/BcTypes.h"

namespace ippl {
template <typename T, unsigned Dim, class Mesh, class Cell>
class Field;
Expand Down
12 changes: 6 additions & 6 deletions src/Field/BareField.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@

#include <Kokkos_Core.hpp>

#include "Expression/IpplExpressions.h"
#include <cstdlib>
#include <iostream>

#include "Types/IpplTypes.h"
#include "Types/ViewTypes.h"

#include "FieldLayout/FieldLayout.h"

#include "Utility/IpplInfo.h"
#include "Utility/PAssert.h"

#include "Field/HaloCells.h"
#include "Expression/IpplExpressions.h"

#include <cstdlib>
#include <iostream>
#include "Field/HaloCells.h"
#include "FieldLayout/FieldLayout.h"

namespace ippl {
class Index;
Expand Down
8 changes: 5 additions & 3 deletions src/Field/BareField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
// You should have received a copy of the GNU General Public License
// along with IPPL. If not, see <https://www.gnu.org/licenses/>.
//
#include "Communicate/DataTypes.h"
#include "Ippl.h"
#include "Utility/Inform.h"
#include "Utility/IpplInfo.h"

#include <cstdlib>
#include <map>
#include <utility>

#include "Communicate/DataTypes.h"

#include "Utility/Inform.h"
#include "Utility/IpplInfo.h"

namespace ippl {
namespace detail {
template <typename T, unsigned Dim>
Expand Down
5 changes: 3 additions & 2 deletions src/Field/BcTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
#ifndef IPPL_FIELD_BC_TYPES_H
#define IPPL_FIELD_BC_TYPES_H

#include "Types/IpplTypes.h"
#include "Types/ViewTypes.h"

#include "Communicate/Archive.h"
#include "FieldLayout/FieldLayout.h"
#include "Index/NDIndex.h"
#include "Meshes/UniformCartesian.h"
#include "Types/IpplTypes.h"
#include "Types/ViewTypes.h"

namespace ippl {
template <typename T, unsigned Dim, class Mesh, class Cell>
Expand Down
3 changes: 2 additions & 1 deletion src/Field/BcTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
// along with IPPL. If not, see <https://www.gnu.org/licenses/>.
//

#include "Field/HaloCells.h"
#include "Utility/IpplException.h"

#include "Field/HaloCells.h"

namespace ippl {
namespace detail {

Expand Down
3 changes: 2 additions & 1 deletion src/Field/Field.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#ifndef IPPL_FIELD_H
#define IPPL_FIELD_H

#include "Field/BConds.h"
#include "Field/BareField.h"
#include "Field/BConds.h"

#include "Meshes/UniformCartesian.h"

namespace ippl {
Expand Down
6 changes: 4 additions & 2 deletions src/Field/HaloCells.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
#define IPPL_HALO_CELLS_H

#include <array>

#include "Types/IpplTypes.h"
#include "Types/ViewTypes.h"

#include "Communicate/Archive.h"
#include "FieldLayout/FieldLayout.h"
#include "Index/NDIndex.h"
#include "Types/IpplTypes.h"
#include "Types/ViewTypes.h"

namespace ippl {
namespace detail {
Expand Down
3 changes: 2 additions & 1 deletion src/Field/HaloCells.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
#include <memory>
#include <vector>

#include "Communicate/Communicate.h"
#include "Utility/IpplException.h"

#include "Communicate/Communicate.h"

namespace ippl {
namespace detail {
template <typename T, unsigned Dim>
Expand Down
4 changes: 3 additions & 1 deletion src/FieldLayout/BinaryBalancer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
***************************************************************************/

// include files
#include "Utility/PAssert.h"

#include "Field/BareField.h"

#include "FieldLayout/BinaryBalancer.h"
#include "FieldLayout/FieldLayout.h"
#include "Utility/PAssert.h"

//////////////////////////////////////////////////////////////////////

Expand Down
Loading

0 comments on commit dbfaf74

Please sign in to comment.