mimic_data_collect Module

provides routines for interaction with client codes: collection and distribution of data



Contents


Variables

TypeVisibilityAttributesNameInitial
character, public, parameter:: delimiter =";"

Derived Types

type, public :: mimic_communicator

communicator type providing routines to handle data interactions

Read more…

Components

TypeVisibilityAttributesNameInitial
integer, public :: num_clients

number of client codes

type(maps_type), public, dimension(:), allocatable:: overlap_maps

mapping of overlapping atoms

Type-Bound Procedures

procedure, public :: init
procedure, public :: handshake
procedure, public :: send_command
procedure, public :: init_overlaps
procedure, public :: finalize
procedure, public :: destroy_comm
procedure, public :: get_atom_species
procedure, public :: send_coords
procedure, public :: gather_coords
procedure, public :: gather_forces
procedure, public :: gather_energies
procedure, public :: gather_atom_fragment_count
procedure, public :: gather_atom_fragment_ids
procedure, public :: get_multipole_order
procedure, public :: gather_multipoles
procedure, public :: gather_masses
procedure, public :: gather_bonds
procedure, public :: gather_angles
procedure, public :: gather_int
procedure, public :: send_int
procedure, public :: gather_elements
procedure, public :: gather_atom_count
procedure, public :: gather_fragment_count
procedure, public :: gather_bond_count
procedure, public :: gather_angle_count
procedure, public :: gather_type_count
procedure, public :: issue_force_comp

Subroutines

public subroutine init(this, comm)

initialize communication

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(inout) :: comm

MPI communicator

public subroutine handshake(this, paths)

identify and connect clients

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
character(len=*), intent(in), dimension(:):: paths

array of paths to working folders of clients

public subroutine send_command(this, command, dest)

send a command via the CommLib

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(in) :: command

integer code of the command

integer, intent(in) :: dest

destination

public subroutine init_overlaps(this, overlap_maps)

initialize overlap mapping

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
type(maps_type), dimension(:):: overlap_maps

list of overlap_maps

public subroutine get_atom_species(this, atoms_pcode, species, num_atoms, num_species, na, sp_map)

Get the number of atoms per atomic species per code (with overlap treatment)

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(in), dimension(:):: atoms_pcode
integer, intent(inout), dimension(:,:), allocatable, target:: species

atom species of each atom in the system (-1 for overlapped)

integer, intent(out) :: num_atoms
integer, intent(out) :: num_species
integer, intent(inout), dimension(:):: na
integer, intent(out), dimension(:,:), allocatable:: sp_map

public subroutine finalize(this)

routine sending an exit code to each client

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this

public subroutine destroy_comm(this)

destructor for the commlib

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this

public subroutine get_fragment_count(this, frag_count)

get the number of fragment per each of the client code

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(inout), dimension(:):: frag_count

number of fragments per code, return value

public subroutine gather_bonds(this, bonds, bonds_number)

get the bond constraints data - atom indices and lengths

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
type(bond_type), intent(out), dimension(:,:), allocatable:: bonds

list of constrained bonds in the simulation, return value

integer, intent(inout), dimension(:):: bonds_number

number of bond constraints in the system. WARNING!!! this routine updates this value

public subroutine gather_angles(this, angles, angle_number)

get the angle constraints data - atom indices and equilibrium values

Read more…

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
type(angle_type), intent(out), dimension(:,:), allocatable:: angles

list of angle constraints, return value

integer, intent(in), dimension(:):: angle_number

number of angle constraints

public subroutine gather_elements(this, elements_pcode, elements, species_map)

gather element number associated to MM atom types

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(in), dimension(:):: elements_pcode

number of elements to expect per code

integer, intent(out), dimension(:):: elements

element numbers per code

integer, intent(in), dimension(:,:):: species_map

public subroutine gather_atom_fragment_count(this, fragment_count, fragment_data)

get the number of atoms per each fragment in the system

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(in), dimension(:):: fragment_count

number of fragments per each code

integer, intent(inout), dimension(:, :):: fragment_data

number of atoms per fragment per code

public subroutine gather_atom_fragment_ids(this, atoms_pcode, fragment_data, fragment_ids)

get IDs of atoms per each fragment in the system

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(in), dimension(:):: atoms_pcode

number of fragments per each code

integer, intent(in), dimension(:, :):: fragment_data

number of atoms per fragment per code

integer, intent(inout), dimension(:, :, :):: fragment_ids

ids of atoms belonging to a fragment

public subroutine gather_masses(this, masses, species_pcode, species_map)

get the data about atoms in the system

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
real(kind=dp), intent(out), dimension(:):: masses

mass of each atom in the system

integer, intent(in), dimension(:):: species_pcode

number of atoms per client code

integer, intent(in), dimension(:,:):: species_map

mapping of MM species to CPMD species

public subroutine gather_multipoles(this, species, multipoles, atoms_pcode, multipoles_patom)

get the data about atoms in the system

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(in), dimension(:,:), target:: species

atom species of each atom in the system (-1 for overlapped)

real(kind=dp), intent(inout), dimension(:,:,:), target:: multipoles

multipoles of each atom in the system (0 charge for overlapped)

integer, intent(in), dimension(:):: atoms_pcode

number of atoms per client code

integer, intent(in), dimension(:):: multipoles_patom

amount of multipoles per atom per code

public subroutine gather_coords(this, frag_code)

gather coordinates of atoms within the system (dealing with overlaps) and store result in the tau matrix through pointers

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
type(subsystem_type), intent(in), dimension(:):: frag_code

subsystem_type belonging to each code

public subroutine gather_forces(this, frag_code)

gather forces acting on atoms within the system and store result in the forces matrix through pointers

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
type(subsystem_type), intent(in), dimension(:):: frag_code

subsystem_type belonging to each code

public subroutine gather_energies(this, energy, frag_code)

gather MM energies from clients

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
real(kind=dp), intent(out) :: energy

resulting total MM energy

type(subsystem_type), intent(in), dimension(:):: frag_code

mapping of fragments per code

public subroutine get_multipole_order(this, multipoles_orders)

get the orders of multipoles used in each client code

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(out), dimension(:), target:: multipoles_orders

multipoles_orders array of orders

public subroutine send_coords(this, subsystems)

send coordinates of atoms to client codes (sends a flattened array)

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
type(subsystem_type), intent(in), dimension(:):: subsystems

subsystem_type belonging to each code

public subroutine gather_int(this, data, command)

gather integer parameter from client codes

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(out), dimension(:), target:: data

Integer data to gather

integer, intent(in) :: command

MCL command to execute

public subroutine issue_force_comp(this)

issue a command to compute forces and energies

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this

public subroutine send_int(this, data, command)

gather integer parameter from client codes

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(in), dimension(:), target:: data

Integer data to gather

integer, intent(in) :: command

MCL command to execute

public subroutine gather_atom_count(this, atoms_pcode)

gather atom count from all clients

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(out), dimension(:), target:: atoms_pcode

Integer data to gather

public subroutine gather_fragment_count(this, frags_pcode)

gather fragment count from all clients

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(out), dimension(:), target:: frags_pcode

Integer data to gather

public subroutine gather_bond_count(this, bonds_pcode)

gather bond count from all clients

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(out), dimension(:), target:: bonds_pcode

Integer data to gather

public subroutine gather_angle_count(this, angles_pcode)

gather angle count from all clients

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(out), dimension(:), target:: angles_pcode

Integer data to gather

public subroutine gather_type_count(this, types_pcode)

gather atom types count from all clients

Arguments

TypeIntentOptionalAttributesName
class(mimic_communicator), intent(inout) :: this
integer, intent(out), dimension(:), target:: types_pcode

Integer data to gather

public subroutine unique_entries(input, output)

search for unique occurences in the array

Arguments

TypeIntentOptionalAttributesName
integer, intent(in), dimension(:,:):: input

original array

integer, intent(out), dimension(:,:), allocatable:: output

resulting array, containing unique entries from the original one

public subroutine move_alloc_str(source, dest)

Arguments

TypeIntentOptionalAttributesName
character(len=:), intent(inout), dimension(:, :), allocatable:: source
character(len=:), intent(inout), dimension(:, :), allocatable:: dest