Pangolin
 All Classes Files Functions Variables Pages
Data Types | Public Member Functions | Public Attributes | List of all members
partitioning_class Module Reference

List of partitions for MPI Contains also the partitioning, which operates on the global grid (defind with some integers, and not with an array of cells. More...

Data Types

type  partitioning
 

Public Member Functions

subroutine new_partitioning (this)
 Constructor. More...
 
subroutine create_global_grid ()
 
subroutine partitioning_root (this)
 Create partitioning on root process. More...
 
subroutine allocate_partitioning (this)
 Allocate the partitioning. More...
 
subroutine new_mpi_borders_partitioning (this)
 Create MPI type for borders cells. More...
 
subroutine single_partition (this)
 Creates a single partition covering all the globe. Everything is done here (easier). More...
 
subroutine three_partitions (this)
 Creates 3 partitions covering all the globe. It is a special case as there are no sectors on the southern hemisphere. Everything is done here (easier). More...
 
subroutine multiple_partitions (this)
 Creates partitions for all sectors. More...
 
subroutine copy_to_other_sector (this, zone, prev)
 Create partitioning in other sector by simple copy. More...
 
integer function nb_cells_partitioning (this)
 Compute the number of cells in all partition. More...
 
subroutine broadcast_partitioning (this, rank)
 Attach a partition to each process The process 0 contains all the partitions. Other process contains only one partition here. More...
 
subroutine broadcast_dimensions (this, rank)
 Send or receive dimensions in order to allocate them (used for creating the grid). More...
 
subroutine broadcast_data (this, rank)
 Send or receive dimensions in order to allocate them (used for creating the grid). More...
 
subroutine partition_data (this)
 Set winds and concentration for each process. More...
 
subroutine check_data_partitioning (this)
 Check interior cells. More...
 
subroutine allocate_data_partitioning (this)
 
integer function nb_cells_prev_lon_partition (this, i, id, j_pos)
 Sum all the cells on the line nb i for all partitions left of the current partition id is the global partition indice. More...
 
subroutine partition_grid (this, zone)
 Partitioning procedure for the grid The grid is filled with the largest "square" partitions (i.e, with the same number of points. More...
 
subroutine split_to_semi_squares (height_corr, this, nb_bands, side, zone, n_left)
 Split global grid to smaller grid with the same number of elements All are "squared", except at the middle, where it is triangular Also, we may extend the partitions by 1 latitude if height_corr is > 0 for a more balanced load the partition on the last band. Finally, they may not be squared if the number of bands does not divides exactly the number of latitudes. This is a pseudo last band as the number of partitions is double precisionly a square number. More...
 
subroutine true_semi_square_splitting (this, k, dk, first_lat, i_pos, side, nb_bands, height_corr, i_corr, di_pos, zone)
 Split a part of the global grid into pseud square partitions. We do not worry about hemispheres, as the indices are computed for that by the caller. More...
 
subroutine set_partition_overlap (cur, i, j, nb_resized, nb_squares, nb_bands, next_first_resize)
 Find the north south neighbours is easy. For a partition, it is the partition on the line before. However, we have also a single cell either to the left or. More...
 
subroutine leftover_band (this, nb_bands, side, n_left, zone, height_corr)
 Compute the last band height. If <= 0, then there is no last band, which contains the rest of the division in theorically equal squares Also allocates the partitioning and create the last band. More...
 
subroutine create_leftover_band (this, nb_bands, height, height_corr, width, n_left, nb_lat, zone)
 Create last band partitions (setting are now done) More...
 
subroutine adapt_height_leftover_band (height_corr, height, load_ratio, side, width, width_left, first_lat, n_left, zone, this)
 Modify the height of the last band according to the load ratio to equilibrate _the load. More...
 
subroutine split_last (width, width_left, i, n_left)
 Small function for splitting a line in the last band and get the quotient and rest. More...
 
subroutine max_load_last (load, width, width_left, height)
 Compute the maximal load (i.e number of cells) for partitions on the last band. More...
 
subroutine get_nb_lon_leftover_band (i, lat_prev, nb_lon, nb_left, side, nb_prev)
 Find the number of longitude for the i-th partition on the last band The aim is to continue the partitioning of the previous band There are at most nb_prev+1 partitions (otherwise a new band is created) More...
 
integer function create_chunk (j_start, j_end, j, nb_lon_mid_prev, side, mid, special_mid)
 This function set the width of a partition on the last band. The idea is to use a width multiple of the previous partition, so either from the square partition or the central one. More...
 
subroutine print_partitioning (this)
 print partitioning to stdout and grid (debug) More...
 
subroutine compute_side_square_parts (side, n_left, rest, nb_bands, nb_parts)
 Compute the side for square partitions (most of the partitioning). Return also the number of leftover partitions and the number of latitude left. More...
 
subroutine free_master_partitioning (this)
 The master process contains all partitions, we remove them except for the first. More...
 
integer function get_nb_parts_partitioning (this)
 Returns all number of partitions. More...
 
subroutine mass_tracer_partitioning (mass, this)
 Total tracer mass (only for master process) More...
 

Public Attributes

character(*), parameter fname_list = "partitioning_class.F90"
 

Detailed Description

List of partitions for MPI Contains also the partitioning, which operates on the global grid (defind with some integers, and not with an array of cells.

Author
Alexis Praga

Member Function/Subroutine Documentation

subroutine partitioning_class::adapt_height_leftover_band ( integer  height_corr,
integer  height,
double precision, intent(in)  load_ratio,
integer  side,
integer  width,
integer  width_left,
integer  first_lat,
integer  n_left,
integer, intent(in)  zone,
type(partitioning this 
)

Modify the height of the last band according to the load ratio to equilibrate _the load.

Here is the call graph for this function:

subroutine partitioning_class::allocate_data_partitioning ( type(partitioning), target  this)

Here is the call graph for this function:

subroutine partitioning_class::allocate_partitioning ( type (partitioning this)

Allocate the partitioning.

Here is the call graph for this function:

subroutine partitioning_class::broadcast_data ( type(partitioning), target  this,
integer  rank 
)

Send or receive dimensions in order to allocate them (used for creating the grid).

Here is the call graph for this function:

subroutine partitioning_class::broadcast_dimensions ( type(partitioning this,
integer  rank 
)

Send or receive dimensions in order to allocate them (used for creating the grid).

Parameters
rank: rank of the current process

Here is the call graph for this function:

subroutine partitioning_class::broadcast_partitioning ( type(partitioning this,
integer  rank 
)

Attach a partition to each process The process 0 contains all the partitions. Other process contains only one partition here.

Here is the call graph for this function:

subroutine partitioning_class::check_data_partitioning ( type(partitioning this)

Check interior cells.

Here is the call graph for this function:

subroutine partitioning_class::compute_side_square_parts ( integer  side,
integer  n_left,
integer  rest,
integer, intent(in)  nb_bands,
integer, intent(in)  nb_parts 
)

Compute the side for square partitions (most of the partitioning). Return also the number of leftover partitions and the number of latitude left.

Here is the call graph for this function:

subroutine partitioning_class::copy_to_other_sector ( type(partitioning), target  this,
integer  zone,
integer  prev 
)

Create partitioning in other sector by simple copy.

Parameters
zone: current zone
prev: previous zone

Here is the call graph for this function:

integer function partitioning_class::create_chunk ( integer, intent(in)  j_start,
integer, intent(in)  j_end,
integer, intent(in)  j,
integer, intent(in)  nb_lon_mid_prev,
integer, intent(in)  side,
integer, intent(in)  mid,
logical, intent(in)  special_mid 
)

This function set the width of a partition on the last band. The idea is to use a width multiple of the previous partition, so either from the square partition or the central one.

subroutine partitioning_class::create_global_grid ( )

Here is the call graph for this function:

subroutine partitioning_class::create_leftover_band ( type(partitioning this,
integer  nb_bands,
integer  height,
integer  height_corr,
integer  width,
integer  n_left,
integer  nb_lat,
integer  zone 
)

Create last band partitions (setting are now done)

Here is the call graph for this function:

subroutine partitioning_class::free_master_partitioning ( type(partitioning this)

The master process contains all partitions, we remove them except for the first.

Here is the call graph for this function:

subroutine partitioning_class::get_nb_lon_leftover_band ( integer, intent(in)  i,
integer, intent(in)  lat_prev,
integer, dimension(:), intent(inout)  nb_lon,
integer, intent(in)  nb_left,
integer, intent(in)  side,
integer, intent(in)  nb_prev 
)

Find the number of longitude for the i-th partition on the last band The aim is to continue the partitioning of the previous band There are at most nb_prev+1 partitions (otherwise a new band is created)

Here is the call graph for this function:

integer function partitioning_class::get_nb_parts_partitioning ( type(partitioning this)

Returns all number of partitions.

subroutine partitioning_class::leftover_band ( type(partitioning), target  this,
integer, intent(in)  nb_bands,
integer, intent(in)  side,
integer, intent(in)  n_left,
integer, intent(in)  zone,
integer  height_corr 
)

Compute the last band height. If <= 0, then there is no last band, which contains the rest of the division in theorically equal squares Also allocates the partitioning and create the last band.

Parameters
side: height of a square partition
zone: zone indice

Here is the call graph for this function:

subroutine partitioning_class::mass_tracer_partitioning ( double precision, dimension(:), allocatable  mass,
type(partitioning this 
)

Total tracer mass (only for master process)

Here is the call graph for this function:

subroutine partitioning_class::max_load_last ( integer  load,
integer, intent(in)  width,
integer, intent(in)  width_left,
integer, intent(in)  height 
)

Compute the maximal load (i.e number of cells) for partitions on the last band.

subroutine partitioning_class::multiple_partitions ( type(partitioning), target  this)

Creates partitions for all sectors.

Here is the call graph for this function:

integer function partitioning_class::nb_cells_partitioning ( type (partitioning this)

Compute the number of cells in all partition.

Here is the call graph for this function:

integer function partitioning_class::nb_cells_prev_lon_partition ( type(partitioning this,
integer, intent(in)  i,
integer, intent(in)  id,
integer, intent(in)  j_pos 
)

Sum all the cells on the line nb i for all partitions left of the current partition id is the global partition indice.

subroutine partitioning_class::new_mpi_borders_partitioning ( type(partitioning this)

Create MPI type for borders cells.

Here is the call graph for this function:

subroutine partitioning_class::new_partitioning ( type(partitioning this)

Constructor.

Here is the call graph for this function:

subroutine partitioning_class::partition_data ( type(partitioning), target  this)

Set winds and concentration for each process.

Here is the call graph for this function:

subroutine partitioning_class::partition_grid ( type(partitioning this,
integer, intent(in)  zone 
)

Partitioning procedure for the grid The grid is filled with the largest "square" partitions (i.e, with the same number of points.

Parameters
zone: zone indice

Here is the call graph for this function:

subroutine partitioning_class::partitioning_root ( type(partitioning this)

Create partitioning on root process.

Here is the call graph for this function:

subroutine partitioning_class::print_partitioning ( type(partitioning this)

print partitioning to stdout and grid (debug)

Here is the call graph for this function:

subroutine partitioning_class::set_partition_overlap ( type (partition)  cur,
integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  nb_resized,
integer, intent(in)  nb_squares,
integer, intent(in)  nb_bands,
logical, intent(in)  next_first_resize 
)

Find the north south neighbours is easy. For a partition, it is the partition on the line before. However, we have also a single cell either to the left or.

other side. This is what this function sets : an overlap which tells us if the single cell is inverted. For a partition j on a band, we set if its (north-south) overlap is inverted. 1 for the left overlap and 2 for the right (both being 3) There can be 2 inversions if we are after the number of resized

Parameters
i: band number (always on northern hemisphere)
subroutine partitioning_class::single_partition ( type(partitioning), target  this)

Creates a single partition covering all the globe. Everything is done here (easier).

Here is the call graph for this function:

subroutine partitioning_class::split_last ( integer  width,
integer  width_left,
integer, intent(in)  i,
integer  n_left 
)

Small function for splitting a line in the last band and get the quotient and rest.

Here is the call graph for this function:

subroutine partitioning_class::split_to_semi_squares ( integer  height_corr,
type(partitioning), target  this,
integer, intent(in)  nb_bands,
integer, intent(in)  side,
integer, intent(in)  zone,
integer  n_left 
)

Split global grid to smaller grid with the same number of elements All are "squared", except at the middle, where it is triangular Also, we may extend the partitions by 1 latitude if height_corr is > 0 for a more balanced load the partition on the last band. Finally, they may not be squared if the number of bands does not divides exactly the number of latitudes. This is a pseudo last band as the number of partitions is double precisionly a square number.

Parameters
k_start: first position in the partition array
nb_bands: number of bands with square partitions
side: height for square partitions
zone: zone indice
n_left: number of partitions on an eventual leftover band

With a grid gaining 2 cells at each latitude, we have the following result : If we split the grid in bands of equal height k, there are (2i+1) rectangular grid with k^2 cells in each, i being the band indice (from 0)

Here is the call graph for this function:

subroutine partitioning_class::three_partitions ( type(partitioning), target  this)

Creates 3 partitions covering all the globe. It is a special case as there are no sectors on the southern hemisphere. Everything is done here (easier).

Here is the call graph for this function:

subroutine partitioning_class::true_semi_square_splitting ( type(partitioning), target  this,
integer  k,
integer, intent(in)  dk,
integer  first_lat,
integer  i_pos,
integer, intent(in)  side,
integer, intent(in)  nb_bands,
integer, intent(in)  height_corr,
integer, intent(in)  i_corr,
integer, intent(in)  di_pos,
integer, intent(in)  zone 
)

Split a part of the global grid into pseud square partitions. We do not worry about hemispheres, as the indices are computed for that by the caller.

Here is the call graph for this function:

Member Data Documentation

character(*), parameter partitioning_class::fname_list = "partitioning_class.F90"

The documentation for this module was generated from the following file: