MONC
Data Types | Functions/Subroutines | Variables
inter_io_specifics_mod Module Reference

Inter IO server communication specific functionality. This manages all of the communication that might happen between different IO servers. More...

Data Types

interface  handle_completion
 

Functions/Subroutines

subroutine, public register_inter_io_communication (io_configuration, message_tag, handling_procedure, name)
 Registers an inter IO communication operation. More...
 
integer function, public find_inter_io_from_name (io_configuration, name)
 Locates a the index of an inter IO entry from the operator name or returns 0 if none is found. More...
 
character function, dimension(:), allocatable, public package_inter_io_communication_message (field_name, timestep, field_values, other_int)
 Packages up fields into an io binary message (allocated here) which is used for sending. More...
 
subroutine, public unpackage_inter_io_communication_message (data_buffer, field_name, timestep, field_values, other_int)
 Unpackages some binary data into its individual fields. The field values are allocated here and the size is the remaining message size after everything else has been accounted for. More...
 

Variables

integer starting_tag =20
 

Detailed Description

Inter IO server communication specific functionality. This manages all of the communication that might happen between different IO servers.

Function/Subroutine Documentation

◆ find_inter_io_from_name()

integer function, public inter_io_specifics_mod::find_inter_io_from_name ( type(io_configuration_type), intent(inout)  io_configuration,
character(len=*), intent(in)  name 
)

Locates a the index of an inter IO entry from the operator name or returns 0 if none is found.

Parameters
io_configurationThe configuration of the IO server
nameName of the inter IO communication operation
Returns
The index of the inter IO descriptor or 0 if none is found

Definition at line 62 of file inter-io-specifics.F90.

63  type(io_configuration_type), intent(inout) :: io_configuration
64  character(len=*), intent(in) :: name
65 
66  integer :: i
67 
68  do i=1, io_configuration%number_inter_io_communications
69  if (io_configuration%inter_io_communications(i)%name .eq. name) then
70  find_inter_io_from_name=i
71  return
72  end if
73  end do
74  find_inter_io_from_name=0
Here is the caller graph for this function:

◆ package_inter_io_communication_message()

character function, dimension(:), allocatable, public inter_io_specifics_mod::package_inter_io_communication_message ( character(len=string_length), intent(in)  field_name,
integer, intent(in)  timestep,
real(kind=default_precision), dimension(:), intent(in)  field_values,
integer, intent(in), optional  other_int 
)

Packages up fields into an io binary message (allocated here) which is used for sending.

Parameters
field_nameThe field name to package
timestepThe timestep to package
field_valuesThe field values to package
other_intOptional other integer to package
Returns
The binary data ready for communication

Definition at line 83 of file inter-io-specifics.F90.

84  character(len=STRING_LENGTH), intent(in) :: field_name
85  integer, intent(in) :: timestep
86  integer, intent(in), optional :: other_int
87  real(kind=default_precision), dimension(:), intent(in) :: field_values
88  character, dimension(:), allocatable :: package_inter_io_communication_message
89 
90  integer :: current_location
91 
92  allocate(package_inter_io_communication_message(string_length+8+(8*size(field_values))))
93 
94  current_location=pack_scalar_field(package_inter_io_communication_message, 1, string_value=field_name)
95  current_location=pack_scalar_field(package_inter_io_communication_message, current_location, int_value=timestep)
96  if (present(other_int)) then
97  current_location=pack_scalar_field(package_inter_io_communication_message, current_location, int_value=other_int)
98  end if
99  current_location=pack_array_field(package_inter_io_communication_message, current_location, real_array_1d=field_values)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_inter_io_communication()

subroutine, public inter_io_specifics_mod::register_inter_io_communication ( type(io_configuration_type), intent(inout)  io_configuration,
integer, intent(in)  message_tag,
procedure(handle_recv_data_from_io_server)  handling_procedure,
character(len=*), intent(in)  name 
)

Registers an inter IO communication operation.

Parameters
io_configurationIO server configuration state
message_tagThe inter IO message tag
handling_procedureCallback procedure back to the inter IO functionality when a message arrives
nameThe name of the inter IO operation

Definition at line 38 of file inter-io-specifics.F90.

39  type(io_configuration_type), intent(inout) :: io_configuration
40  integer, intent(in) :: message_tag
41  procedure(handle_recv_data_from_io_server) :: handling_procedure
42  character(len=*), intent(in) :: name
43 
44  integer :: new_index
45 
46  io_configuration%number_inter_io_communications=io_configuration%number_inter_io_communications+1
47 
48  if (io_configuration%number_inter_io_communications .gt. size(io_configuration%inter_io_communications)) then
49  call extend_inter_io_comm_array(io_configuration)
50  end if
51 
52  new_index=io_configuration%number_inter_io_communications
53  io_configuration%inter_io_communications(new_index)%message_tag=message_tag+starting_tag
54  io_configuration%inter_io_communications(new_index)%handling_procedure=>handling_procedure
55  io_configuration%inter_io_communications(new_index)%name=name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unpackage_inter_io_communication_message()

subroutine, public inter_io_specifics_mod::unpackage_inter_io_communication_message ( character, dimension(:), intent(in)  data_buffer,
character(len=string_length), intent(out)  field_name,
integer, intent(out)  timestep,
real(kind=default_precision), dimension(:), intent(out), allocatable  field_values,
integer, intent(out), optional  other_int 
)

Unpackages some binary data into its individual fields. The field values are allocated here and the size is the remaining message size after everything else has been accounted for.

Parameters
data_bufferThe data buffer to unpackage
field_nameWritten into from the buffer
timestepWritten into from the buffer
field_valuesRemaining message size, allocated here
other_intOptional other integer written in from the buffer

Definition at line 109 of file inter-io-specifics.F90.

110  character, dimension(:), intent(in) :: data_buffer
111  character(len=STRING_LENGTH), intent(out) :: field_name
112  integer, intent(out) :: timestep
113  integer, intent(out), optional :: other_int
114  real(kind=default_precision), dimension(:), allocatable, intent(out) :: field_values
115 
116  integer :: values_entries
117 
118  values_entries=(size(data_buffer) - (string_length+8))/8
119 
120  allocate(field_values(values_entries))
121  field_name=transfer(data_buffer(1:string_length), field_name)
122  timestep=transfer(data_buffer(string_length+1:string_length+4), timestep)
123  if (present(other_int)) other_int=transfer(data_buffer(string_length+5:string_length+8), other_int)
124  field_values=transfer(data_buffer(string_length+9:), field_values)
Here is the caller graph for this function:

Variable Documentation

◆ starting_tag

integer inter_io_specifics_mod::starting_tag =20
private

Definition at line 27 of file inter-io-specifics.F90.

27  integer :: starting_tag=20
datadefn_mod::default_precision
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
Definition: datadefn.F90:17