MONC
Data Types | Modules | Functions/Subroutines
halocommunication.F90 File Reference

Go to the source code of this file.

Data Types

interface  halo_communication_mod::get_fields_per_halo_cell_proc_interface
 Procedure interfaces used to determine the policy (i.e. the fields) of halo swapping and. More...
 
interface  halo_communication_mod::copy_fields_to_halo_buffer_proc_interface
 
interface  halo_communication_mod::copy_corners_to_halo_buffer_proc_interface
 
interface  halo_communication_mod::copy_halo_buffer_to_field_proc_interface
 
interface  halo_communication_mod::copy_halo_buffer_to_corner_proc_interface
 
interface  halo_communication_mod::perform_local_data_copy_proc_interface
 

Modules

module  halo_communication_mod
 Provides the mechanism for halo swapping. This module contains the functionality required to determine what messages get sent where, pack data up en mass, send and receive from neighbouring processes and unpack into the appropriate data locations. There is also some functionality to help local copying of data to corresponding locations. The idea is that the caller will determine the policy (i.e. exactly what fields are to be communicated) through procedure arguments and this mechanism can be used again and again. It implements bulk sending of all field data in one large message to reduce communication overhead.
 

Functions/Subroutines

subroutine, public halo_communication_mod::blocking_halo_swap (current_state, halo_swap_state, copy_to_halo_buffer, perform_local_data_copy, copy_from_halo_buffer, copy_corners_to_halo_buffer, copy_from_halo_buffer_to_corner, source_data)
 Performs the entire halo swap operation, this is simply a wrapper around the nonblocking initiate and complete procedures and saves the programmer from calling these directly if they do not wish to interleave any computation. More...
 
subroutine, public halo_communication_mod::complete_nonblocking_halo_swap (current_state, halo_swap_state, perform_local_data_copy, copy_from_halo_buffer, copy_from_halo_buffer_to_corner, source_data)
 This completes a nonblocking halo swap and it is only during this call that the data fields themselves are modified. This will perform local data copying, wait for all outstanding receives to complete, copy the received buffer data into the data and then wait for all outstanding sends to complete. More...
 
subroutine, public halo_communication_mod::initiate_nonblocking_halo_swap (current_state, halo_swap_state, copy_to_halo_buffer, copy_corners_to_halo_buffer, source_data)
 Initiates a non blocking halo swap, this registers the receive requests, copies data into the send buffer and then registers send requests for these. As far as this call is concerned, the data is immutable - no modifications will take place to it until the matching completion call is made. More...
 
subroutine, public halo_communication_mod::init_halo_communication (current_state, get_fields_per_halo_cell, halo_state, halo_depth, involve_corners)
 Initialises a halo swapping state, by determining the neighbours, size of data in each swap and allocating the required memory - which are communication buffers and request handles. All this information is placed into the returned state. More...
 
subroutine, public halo_communication_mod::finalise_halo_communication (halo_swap_state)
 Finalises the halo swap represented by the state by freeing up all the allocated memory. More...
 
subroutine, public halo_communication_mod::copy_buffer_to_corner (local_grid, halo_buffer, field_data, corner_loc, x_target_index, y_target_index, halo_page)
 Copies the received buffer for a specific field to the corresponding corner of that field. More...
 
subroutine, public halo_communication_mod::copy_buffer_to_field (local_grid, halo_buffer, field_data, dim, target_index, halo_page)
 Copies the received buffer for a specific field to the corresponding halo data of that prognostic field. More...
 
subroutine, public halo_communication_mod::copy_field_to_buffer (local_grid, halo_buffer, field_data, dim, source_index, halo_page)
 Copies prognostic field data to send buffer for specific field, dimension, halo cell. More...
 
subroutine, public halo_communication_mod::copy_corner_to_buffer (local_grid, halo_buffer, field_data, corner_loc, x_source_index, y_source_index, halo_page)
 Copies prognostic field corner data to send buffer for specific field. More...
 
subroutine, public halo_communication_mod::perform_local_data_copy_for_field (field_data, local_grid, my_rank, halo_depth, involve_corners)
 Will perform a a local copy for the halo data of a field. More...
 
integer function halo_communication_mod::get_number_communication_requests (halo_swap_neighbours, number_distinct_neighbours)
 Determines the overall number of communication requests, which is made up of normal halo swaps and potentially corner swaps too if that is enabled. More...
 
subroutine halo_communication_mod::determine_recv_and_send_sizes (local_grid, halo_swap_neighbours, number_distinct_neighbours, involve_corners)
 Determines the amount (in elements) of data that each neighbour will be sent and I will receive from in a halo swap. More...
 
integer function halo_communication_mod::determine_halo_corner_size (local_grid)
 Determine the halo corner size in elements. More...
 
integer function halo_communication_mod::determine_halo_corner_element_sizes (local_grid, pid)
 For a specific process id this determines the number of halo swap corner elements to involve in a communication. More...
 
integer function halo_communication_mod::get_number_of_processes_involved_in_communication (local_grid, my_rank, include_corners)
 Deduces the number of distinct neighbours that will be involved in a halo swap. This information is used to then allocate the appropriate amount of memory to store the neighbour halo swapping data structure. More...
 
type(neighbour_description_type) function, dimension(number_distinct_neighbours) halo_communication_mod::populate_halo_swap_neighbours (local_grid, my_rank, number_distinct_neighbours, involve_corners)
 Will populate the halo swap neighbour data strutures with appropriate neighbour pid and dimension numbers. More...
 
subroutine halo_communication_mod::deduce_halo_pages_per_neighbour (current_state, halo_swap_neighbours, number_distinct_neighbours, get_fields_per_halo_cell, fields_per_cell, halo_depth)
 Deduces the number of halo pages per neighbour halo swap and places this information in the appropriate data structures. We call a "page" of data the contiguous data of a field that we are going to send, such as halo 1 of w, halo 1 of zw and halo 2 of w (assuming these go to the same neighbour as 1) More...
 
subroutine halo_communication_mod::deduce_halo_corners_per_neighbour (current_state, halo_swap_neighbours, number_distinct_neighbours, fields_per_cell)
 Determines the number of halo corners to swap between specific neighours, this is similar to deducing the number of halo pages per neighbour, only it is for corners. More...
 
subroutine halo_communication_mod::allocate_halo_buffers_for_each_neighbour (local_grid, number_distinct_neighbours, halo_swap_neighbours)
 Allocates the locally stored halo buffers (send and receive) for each neighbouring process. More...
 
subroutine halo_communication_mod::generate_recv_field_buffer_matches (current_state, halo_depth, cell_match)
 Precalculates the received buffer to field halo cell matches for each dimension and called from the initialisation stage. More...
 
subroutine halo_communication_mod::recv_all_halos (current_state, halo_swap_state)
 Registers receive requests for all prognostic fields from the appropriate neighbouring processes (that we have already deduced in the initialisation stage.) More...
 
subroutine halo_communication_mod::send_all_halos (current_state, halo_swap_state, copy_fields_to_halo_buffer, copy_corner_fields_to_halo_buffer, source_data)
 Copies all applicable bits of the prognostics into a send buffer for each neighbour and then issues asynchronous sends of this data. More...
 
subroutine halo_communication_mod::copy_buffer_data_for_prognostics (current_state, halo_swap_state, copy_halo_buffer_to_field, copy_halo_buffer_to_corner, source_data)
 Copies the received data (held in buffers) from neighbours into the correct halo location in the prognostic fields. More...
 
subroutine halo_communication_mod::perform_local_data_copy_for_corners (my_rank, local_grid, field_data)
 Performs a local data copy for corners when the neighbour is local (me) More...
 
subroutine halo_communication_mod::perform_local_data_copy_for_dimension (dim, my_rank, halo_depth, local_grid, field_data)
 Performs a local data copy for a specific dimension of a prognostic field. More...
 
logical function, dimension(3) halo_communication_mod::retrieve_same_neighbour_information (local_grid)
 Retrieves whether we have the same neighbours for L and R halo swaps in each dimension. More...
 
logical function halo_communication_mod::has_pid_already_been_seen (temp_neighbour_pids, pid)
 Returns whether or not a specific process id has already been "seen" by searching a list of already seen process ids. More...
 
integer function halo_communication_mod::get_pid_neighbour_location (halo_swap_neighbours, pid, number_distinct_neighbours)
 Given the process id of a neighbour this determines the location in the data structure of corresponding data for that. Note that this is an O(n) operation so ideally call once and reuse the results. If no process id is found then returns -1. More...
 
integer function, public halo_communication_mod::get_single_field_per_halo_cell (current_state)
 A very common function, which returns a single field per halo cell which is used to halo swap just one field. More...