XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
domain_decomposition.hpp
Go to the documentation of this file.
1 #ifndef DOMAIN_DECOMPOSITION_HPP
2 #define DOMAIN_DECOMPOSITION_HPP
3 #include "space_settings.hpp"
4 #include "NamelistReader.hpp"
5 #ifdef USE_MPI
6 # include "my_mpi.hpp"
7 #endif
9 #include "grid_weights.hpp"
10 
11 // Decomposition class
12 template<class Device>
14  public:
15 
16  // Constructor
18 
19  DomainDecomposition(NLReader::NamelistReader& nlr, int nnodes_in);
20 
21  DomainDecomposition(int nranks_in);
22 
23  void setup_gvid0_pid(NLReader::NamelistReader& nlr, int nnodes_in);
24 
25  int nplanes;
26 
27 #ifdef USE_MPI
28  // MPI communicators etc
29  const MyMPI mpi;
30 #endif
31 
32  // Updater
33  void update(int new_f0_inode1);
34 
35  void update_pol_decomp();
36 
37  void update_flux_surf(const View<int**, CLayout, HostType>& surf_idx, const View<int*, CLayout, HostType>& nnodes_on_surface);
38 
39  KOKKOS_INLINE_FUNCTION int node_to_plane_rank(int node) const;
40 
41  KOKKOS_INLINE_FUNCTION void node_to_rank(const SimdGridWeights<Order::Zero, PIT_GLOBAL>& grid_wts0, const Simd<int>& iphi, bool plane_sort_only, Simd<int>& pid) const;
42 
43  inline int node_to_plane_rank_h(int node, int initial_guess) const;
44 
45  // Constants
46  bool pol_decomp;
49  int n_pids;
50  int my_pid;
54 
57 
58  // Variables
60  int nnodes;
61 
62  // Views
63  Kokkos::View<int*,Kokkos::LayoutRight,HostType> gvid0_pid_h;
64  Kokkos::View<int*,Kokkos::LayoutRight,Device> gvid0_pid;
65 
66  View<int*,CLayout,HostType> surfs;
67  View<int*,CLayout,HostType> ranks_sharing_flux_surf;
68 
69 };
70 
71 #include "domain_decomposition.tpp"
72 #endif
bool decompose_fields
Whether to decompose fields.
Definition: domain_decomposition.hpp:55
View< int *, CLayout, HostType > ranks_sharing_flux_surf
Which processors share a flux surface with this one.
Definition: domain_decomposition.hpp:67
int plane_totalpe
Processors per plane?
Definition: domain_decomposition.hpp:48
int plane_index
Offset of local plane.
Definition: domain_decomposition.hpp:52
Definition: grid_weights.hpp:47
Definition: NamelistReader.hpp:193
int node_offset
Offset of first mesh node belonging to this MPI rank.
Definition: domain_decomposition.hpp:59
void update_pol_decomp()
Definition: domain_decomposition.tpp:209
int nnodes
Number of nodes belonging to this MPI rank.
Definition: domain_decomposition.hpp:60
int my_pid
ID of this processor.
Definition: domain_decomposition.hpp:50
int pe_per_plane
Processors per plane.
Definition: domain_decomposition.hpp:47
Definition: my_mpi.hpp:19
int n_pids
Processors per plane?
Definition: domain_decomposition.hpp:49
int nnodes_on_plane
Number of nodes on local plane.
Definition: domain_decomposition.hpp:53
void setup_gvid0_pid(NLReader::NamelistReader &nlr, int nnodes_in)
Definition: domain_decomposition.tpp:75
void update(int new_f0_inode1)
Definition: domain_decomposition.tpp:186
Definition: field_decomposition.hpp:12
int nplanes
Definition: domain_decomposition.hpp:25
View< int *, CLayout, HostType > surfs
Which surfaces are at least partially on this rank.
Definition: domain_decomposition.hpp:66
Kokkos::View< int *, Kokkos::LayoutRight, Device > gvid0_pid
Which processors get which vertices.
Definition: domain_decomposition.hpp:64
int my_plane_pid
Poloidal ID of this processor.
Definition: domain_decomposition.hpp:51
KOKKOS_INLINE_FUNCTION void node_to_rank(const SimdGridWeights< Order::Zero, PIT_GLOBAL > &grid_wts0, const Simd< int > &iphi, bool plane_sort_only, Simd< int > &pid) const
Definition: domain_decomposition.tpp:249
DomainDecomposition(NLReader::NamelistReader &nlr)
Definition: domain_decomposition.tpp:28
Definition: domain_decomposition.hpp:13
FieldDecomposition< Device > field_decomp
Definition: domain_decomposition.hpp:56
int node_to_plane_rank_h(int node, int initial_guess) const
Definition: domain_decomposition.tpp:274
void update_flux_surf(const View< int **, CLayout, HostType > &surf_idx, const View< int *, CLayout, HostType > &nnodes_on_surface)
Definition: domain_decomposition.tpp:120
bool pol_decomp
Use poloidal decomposition.
Definition: domain_decomposition.hpp:46
KOKKOS_INLINE_FUNCTION int node_to_plane_rank(int node) const
Definition: domain_decomposition.tpp:231
Kokkos::View< int *, Kokkos::LayoutRight, HostType > gvid0_pid_h
Which processors get which vertices (host)
Definition: domain_decomposition.hpp:63