1 #ifndef FIELD_DECOMPOSITION_HPP
2 #define FIELD_DECOMPOSITION_HPP
11 template<
class Device>
88 exit_XGC(
"\nError in field_decomposition: n_ranks must be divisible by n_phi_domains");
93 exit_XGC(
"\nError in field_decomposition: n_phi_domains must divide evenly into nplanes");
96 exit_XGC(
"\nError in field_decomposition: total XGC ranks must be divisible by field_decomp_param n_ranks");
105 int first_owned_node_r = nodes_per_pol_domain*i_pol;
106 int n_owned_nodes_r = (i_pol==
n_pol_domains-1 ? (nnodes - first_owned_node_r) : nodes_per_pol_domain);
108 int first_owned_plane_r = nodes_per_phi_domain*i_phi;
109 int n_owned_planes_r = (i_phi==
n_phi_domains-1 ? (nplanes - first_owned_plane_r) : nodes_per_phi_domain);
147 KOKKOS_INLINE_FUNCTION
int find_domain_owner(
int global_plane_index,
int nplanes_total,
int global_node_index,
int nnodes_total)
const{
150 int intpl_pid = global_plane_index/planes_per_phi_domain;
154 int plane_pid = global_node_index/n_vertices_per_pol_domain;
Definition: field_decomposition.hpp:12
FieldDecomposition()
Definition: field_decomposition.hpp:48
int n_pol_domains
Number of domains in the poloidal plane.
Definition: field_decomposition.hpp:23
int first_owned_plane
First plane belonging to this rank, NOT including ghost planes.
Definition: field_decomposition.hpp:29
int n_ghost_planes
Number of ghost planes on each side of domain.
Definition: field_decomposition.hpp:24
View< int *, CLayout, HostType > all_last_node
Last node of each rank.
Definition: field_decomposition.hpp:44
int n_ranks
Number of ranks the field will be divided between.
Definition: field_decomposition.hpp:21
int last_node
Last node belonging to this rank, including ghost nodes.
Definition: field_decomposition.hpp:33
int n_planes
Number of planes belonging to this rank, including ghost planes.
Definition: field_decomposition.hpp:37
View< int *, CLayout, HostType > all_last_plane
Last plane of each rank.
Definition: field_decomposition.hpp:46
int n_ghost_vertices
Number of ghost vertices on each side of domain.
Definition: field_decomposition.hpp:25
int nplanes_owned
Number of planes belonging to this rank, NOT including ghost planes.
Definition: field_decomposition.hpp:30
int first_plane
First plane belonging to this rank, including ghost planes.
Definition: field_decomposition.hpp:35
View< int *, CLayout, HostType > all_first_node
First node of each rank.
Definition: field_decomposition.hpp:43
int n_nodes
Number of nodes belonging to this rank, including ghost nodes.
Definition: field_decomposition.hpp:34
int first_node
First mesh node belonging to this rank, including ghost nodes.
Definition: field_decomposition.hpp:32
View< int *, CLayout, HostType > all_first_plane
First plane of each rank.
Definition: field_decomposition.hpp:45
int n_phi_domains
Number of domains in the phi direction.
Definition: field_decomposition.hpp:22
int last_plane
Last plane belonging to this rank, including ghost planes.
Definition: field_decomposition.hpp:36
int first_owned_node
First mesh node belonging to this rank, NOT including ghost nodes.
Definition: field_decomposition.hpp:27
FieldDecomposition(NLReader::NamelistReader &nlr, int nplanes, int nnodes)
Definition: field_decomposition.hpp:51
View< int *, CLayout, HostType > map_from_global_intpl
Rank in this communicator for each rank global intpl.
Definition: field_decomposition.hpp:42
bool use_near_field
For better load balancing, have each rank retain the field near its global domain decomposition in ad...
Definition: field_decomposition.hpp:39
int nnodes_owned
Number of nodes belonging to this rank, NOT including ghost nodes.
Definition: field_decomposition.hpp:28
KOKKOS_INLINE_FUNCTION int find_domain_owner(int global_plane_index, int nplanes_total, int global_node_index, int nnodes_total) const
Definition: field_decomposition.hpp:147
int all_n_nodes(int local_pid) const
Definition: field_decomposition.hpp:160
int all_n_planes(int local_pid, int nplanes) const
Definition: field_decomposition.hpp:164
Definition: NamelistReader.hpp:199
T get(const string ¶m, const T default_val, int val_ind=0)
Definition: NamelistReader.hpp:392
void use_namelist(const string &namelist, Options required=Required)
Definition: NamelistReader.hpp:366
void exit_XGC(std::string msg)
Definition: globals.hpp:38
KOKKOS_INLINE_FUNCTION unsigned positive_modulo(int value, unsigned m)
Definition: globals.hpp:258
int SML_COMM_RANK
Definition: my_mpi.cpp:5
MPI_Comm SML_COMM_WORLD
Definition: my_mpi.cpp:4
Definition: my_mpi.hpp:19
int nranks
Definition: my_mpi.hpp:23
int my_rank
Definition: my_mpi.hpp:24