(git:6a2e663)
qs_fb_com_tasks_types Module Reference

Functions/Subroutines

subroutine, public fb_com_tasks_release (com_tasks)
 Releases an fb_com_tasks object. More...
 
subroutine, public fb_com_atom_pairs_release (atom_pairs)
 Releases an fb_com_atom_pairs object. More...
 
subroutine, public fb_com_tasks_nullify (com_tasks)
 Nullifies a fb_com_tasks object, note that it does not release the original object. This procedure is used to nullify the pointer contained in the object which is used to associate to the actual object content. More...
 
subroutine, public fb_com_atom_pairs_nullify (atom_pairs)
 Nullifies a fb_com_atom_pairs object, note that it does not release the original object. This procedure is used to nullify the pointer contained in the object which is used to associate to the actual object content. More...
 
logical function, public fb_com_atom_pairs_has_data (atom_pairs)
 Checks if a fb_com_atom_pairs object is associated with an actual data content or not. More...
 
subroutine, public fb_com_tasks_create (com_tasks)
 Creates and initialises an empty fb_com_tasks object. More...
 
subroutine, public fb_com_atom_pairs_create (atom_pairs)
 Creates and initialises an empty fb_com_atom_pairs object. More...
 
subroutine, public fb_com_atom_pairs_init (atom_pairs)
 Initialises an fb_com_atom_pairs object, and makes it empty. More...
 
subroutine, public fb_com_tasks_get (com_tasks, task_dim, ntasks, nencode, tasks)
 Gets attributes from a fb_com_tasks object, one should only access the data content in a fb_com_tasks object outside this module via this procedure. More...
 
subroutine, public fb_com_atom_pairs_get (atom_pairs, npairs, natoms_encode, pairs)
 Gets attributes from a fb_com_atom_pairs object, one should only access the data content in a fb_com_atom_pairs object outside this module via this procedure. More...
 
subroutine, public fb_com_tasks_set (com_tasks, task_dim, ntasks, nencode, tasks)
 Sets attributes in a fb_com_tasks object, one should only access the data content in a fb_com_tasks object outside this module via this procedure. More...
 
subroutine, public fb_com_tasks_transpose_dest_src (tasks_dest_is_me, direction, tasks_src_is_me, para_env)
 Start from a local set of tasks that has desc/src process equal to the local MPI rank, communicate with other processes so that a new local set of tasks is constructed with src/desc process equal to the local MPI rank. More...
 
subroutine, public fb_com_tasks_build_atom_pairs (com_tasks, atom_pairs, natoms_encode, send_or_recv)
 Generate send or receive atom_pair lists from a com_tasks object. atom_pair list is used as a condensed index for the local/remote matrix blocks to be sent/received. More...
 
subroutine, public fb_com_tasks_encode_pair (ind, iatom, jatom, natoms)
 Encodes (iatom, jatom) pair index of a block into a single integer. More...
 
subroutine, public fb_com_tasks_decode_pair (ind, iatom, jatom, natoms)
 Dncodes a single integer into (iatom, jatom) pair index of a block into a single. More...
 
subroutine, public fb_com_atom_pairs_decode (ind, pe, iatom, jatom, natoms)
 Decodes a single integer into the (rank, iatom, jatom) index of a communication task to send/receive a block to/from a process. More...
 
subroutine, public fb_com_atom_pairs_calc_buffer_sizes (atom_pairs, nprocs, row_blk_sizes, col_blk_sizes, sendrecv_sizes, sendrecv_disps, sendrecv_pair_counts, sendrecv_pair_disps)
 Calculate the MPI send or recv buffer sizes according to the communication pairs (atom_pairs) and DBCSR matrix data. Each atom_pair corresponds to one DBCSR matrix block that needs to be sent or recerived. More...
 
subroutine, public fb_com_atom_pairs_gather_blks (dbcsr_mat, atom_pairs_send, atom_pairs_recv, para_env, matrix_storage)
 Given send and recv fb_com_atom_pair object, gather all the relevant DBCSR matrix blocks together, and add them to a fb_matrix_data object for storage. More...
 
subroutine, public fb_com_atom_pairs_distribute_blks (matrix_storage, atom_pairs_send, atom_pairs_recv, para_env, dbcsr_mat)
 Given send and recv fb_com_atom_pair object, distribute the matrix blocks stored in a fb_matrix_data object to a computable DBCSR matrix. It is assumed in this subroutine that the sizes of each block stored in fb_matrix_data object is consistent with the pre-defined block sizes in the DBCSR matrix. More...
 

Variables

integer, parameter, public task_n_records = 4
 
integer, parameter, public task_dest = 1
 
integer, parameter, public task_src = 2
 
integer, parameter, public task_pair = 3
 
integer, parameter, public task_cost = 4
 

Function/Subroutine Documentation

◆ fb_com_tasks_release()

subroutine, public qs_fb_com_tasks_types::fb_com_tasks_release ( type(fb_com_tasks_obj), intent(inout)  com_tasks)

Releases an fb_com_tasks object.

Parameters
com_tasksthe fb_com_tasks object, its content must not be UNDEFINED, and the subroutine does nothing if the content points to NULL
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 151 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_atom_pairs_release()

subroutine, public qs_fb_com_tasks_types::fb_com_atom_pairs_release ( type(fb_com_atom_pairs_obj), intent(inout)  atom_pairs)

Releases an fb_com_atom_pairs object.

Parameters
atom_pairsthe fb_com_atom_pairs object, its content must not be UNDEFINED, and the subroutine does nothing if the content points to NULL
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 171 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_tasks_nullify()

subroutine, public qs_fb_com_tasks_types::fb_com_tasks_nullify ( type(fb_com_tasks_obj), intent(inout)  com_tasks)

Nullifies a fb_com_tasks object, note that it does not release the original object. This procedure is used to nullify the pointer contained in the object which is used to associate to the actual object content.

Parameters
com_tasksthe com_tasks object
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 192 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_atom_pairs_nullify()

subroutine, public qs_fb_com_tasks_types::fb_com_atom_pairs_nullify ( type(fb_com_atom_pairs_obj), intent(inout)  atom_pairs)

Nullifies a fb_com_atom_pairs object, note that it does not release the original object. This procedure is used to nullify the pointer contained in the object which is used to associate to the actual object content.

Parameters
atom_pairsthe fb_com_atom_pairs object
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 206 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_atom_pairs_has_data()

logical function, public qs_fb_com_tasks_types::fb_com_atom_pairs_has_data ( type(fb_com_atom_pairs_obj), intent(in)  atom_pairs)

Checks if a fb_com_atom_pairs object is associated with an actual data content or not.

Parameters
atom_pairsthe fb_com_atom_pairs object
Returns
...
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 259 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_tasks_create()

subroutine, public qs_fb_com_tasks_types::fb_com_tasks_create ( type(fb_com_tasks_obj), intent(inout)  com_tasks)

Creates and initialises an empty fb_com_tasks object.

Parameters
com_tasksthe fb_com_tasks object, its content must be NULL and cannot be UNDEFINED
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 272 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_atom_pairs_create()

subroutine, public qs_fb_com_tasks_types::fb_com_atom_pairs_create ( type(fb_com_atom_pairs_obj), intent(inout)  atom_pairs)

Creates and initialises an empty fb_com_atom_pairs object.

Parameters
atom_pairsthe fb_com_atom_pairs object, its content must be NULL and cannot be UNDEFINED
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 289 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_atom_pairs_init()

subroutine, public qs_fb_com_tasks_types::fb_com_atom_pairs_init ( type(fb_com_atom_pairs_obj), intent(inout)  atom_pairs)

Initialises an fb_com_atom_pairs object, and makes it empty.

Parameters
atom_pairsthe fb_com_atom_pairs object, its content must not be NULL or UNDEFINED
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 323 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_tasks_get()

subroutine, public qs_fb_com_tasks_types::fb_com_tasks_get ( type(fb_com_tasks_obj), intent(in)  com_tasks,
integer, intent(out), optional  task_dim,
integer, intent(out), optional  ntasks,
integer, intent(out), optional  nencode,
integer(kind=int_8), dimension(:, :), optional, pointer  tasks 
)

Gets attributes from a fb_com_tasks object, one should only access the data content in a fb_com_tasks object outside this module via this procedure.

Parameters
com_tasksthe fb_com_tasks object, its content must not be NULL or UNDEFINED
task_dim[OPTIONAL]: if present, outputs com_tasksobjtask_dim
ntasks[OPTIONAL]: if present, outputs com_tasksobjntasks
nencode[OPTIONAL]: if present, outputs com_tasksobjnencode
tasks[OPTIONAL]: if present, outputs pointer com_tasksobjtasks
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 346 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_atom_pairs_get()

subroutine, public qs_fb_com_tasks_types::fb_com_atom_pairs_get ( type(fb_com_atom_pairs_obj), intent(in)  atom_pairs,
integer, intent(out), optional  npairs,
integer, intent(out), optional  natoms_encode,
integer(kind=int_8), dimension(:), optional, pointer  pairs 
)

Gets attributes from a fb_com_atom_pairs object, one should only access the data content in a fb_com_atom_pairs object outside this module via this procedure.

Parameters
atom_pairsthe fb_com_atom_pairs object, its content must not be NULL or UNDEFINED
npairs[OPTIONAL]: if present, outputs atom_pairsobjnpairs
natoms_encode[OPTIONAL]: if present, outputs atom_pairsobjnatoms_encode
pairs[OPTIONAL]: if present, outputs pointer atom_pairsobjpairs
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 374 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_tasks_set()

subroutine, public qs_fb_com_tasks_types::fb_com_tasks_set ( type(fb_com_tasks_obj), intent(inout)  com_tasks,
integer, intent(in), optional  task_dim,
integer, intent(in), optional  ntasks,
integer, intent(in), optional  nencode,
integer(kind=int_8), dimension(:, :), optional, pointer  tasks 
)

Sets attributes in a fb_com_tasks object, one should only access the data content in a fb_com_tasks object outside this module via this procedure.

Parameters
com_tasksthe fb_com_tasks object, its content must not be NULL or UNDEFINED
task_dim[OPTIONAL]: if present, sets com_tasksobjtask_dim
ntasks[OPTIONAL]: if present, sets com_tasksobjntasks
nencode[OPTIONAL]: if present, sets com_tasksobjnencode
tasks[OPTIONAL]: if present, associates pointer com_tasksobjtasks
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 401 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_tasks_transpose_dest_src()

subroutine, public qs_fb_com_tasks_types::fb_com_tasks_transpose_dest_src ( type(fb_com_tasks_obj), intent(inout)  tasks_dest_is_me,
character, intent(in)  direction,
type(fb_com_tasks_obj), intent(inout)  tasks_src_is_me,
type(mp_para_env_type), pointer  para_env 
)

Start from a local set of tasks that has desc/src process equal to the local MPI rank, communicate with other processes so that a new local set of tasks is constructed with src/desc process equal to the local MPI rank.

Parameters
tasks_dest_is_methe local com_task object with all tasks having the desc process id equal to my_id
directiondirection of operation: ">" means from tasks_dest_is_me construct tasks_src_is_me "<" means from tasks_src_is_me construct tasks_dest_is_me
tasks_src_is_methe local com_task object with all tasks having the src process id equal to my_id
para_envCP2K parallel environment object that stores MPI related information of the current run
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 470 of file qs_fb_com_tasks_types.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_com_tasks_build_atom_pairs()

subroutine, public qs_fb_com_tasks_types::fb_com_tasks_build_atom_pairs ( type(fb_com_tasks_obj), intent(in)  com_tasks,
type(fb_com_atom_pairs_obj), intent(inout)  atom_pairs,
integer, intent(in)  natoms_encode,
character(len=*), intent(in)  send_or_recv 
)

Generate send or receive atom_pair lists from a com_tasks object. atom_pair list is used as a condensed index for the local/remote matrix blocks to be sent/received.

Parameters
com_tasksthe com_tasks object
atom_pairsfb_com_atom_pairs_obj containing list of encoded atomic pair indices and the dest/src proc id for the matrix block to be sent/received.
natoms_encodethe total number of atoms the atomic pair indices corresponds to, and it is used for encode the atom_pairs values
send_or_recvwhether the atom_pair to be generated is for the local matrix blocks to be sent or the remote matrix blocks to be received for this MPI process
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 637 of file qs_fb_com_tasks_types.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_com_tasks_encode_pair()

subroutine, public qs_fb_com_tasks_types::fb_com_tasks_encode_pair ( integer(kind=int_8), intent(out)  ind,
integer, intent(in)  iatom,
integer, intent(in)  jatom,
integer, intent(in)  natoms 
)

Encodes (iatom, jatom) pair index of a block into a single integer.

Parameters
indencoded integer
iatomthe first index of the (iatom, jatom) block index
jatomthe second index of the (iatom, jatom) block index
natomsthe total number of atoms iatom and jatom indexes
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 732 of file qs_fb_com_tasks_types.F.

Here is the caller graph for this function:

◆ fb_com_tasks_decode_pair()

subroutine, public qs_fb_com_tasks_types::fb_com_tasks_decode_pair ( integer(kind=int_8), intent(in)  ind,
integer, intent(out)  iatom,
integer, intent(out)  jatom,
integer, intent(in)  natoms 
)

Dncodes a single integer into (iatom, jatom) pair index of a block into a single.

Parameters
indencoded integer
iatomthe first index of the (iatom, jatom) block index
jatomthe second index of the (iatom, jatom) block index
natomsthe total number of atoms iatom and jatom indexes
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 754 of file qs_fb_com_tasks_types.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_com_atom_pairs_decode()

subroutine, public qs_fb_com_tasks_types::fb_com_atom_pairs_decode ( integer(kind=int_8), intent(in)  ind,
integer, intent(out)  pe,
integer, intent(out)  iatom,
integer, intent(out)  jatom,
integer, intent(in)  natoms 
)

Decodes a single integer into the (rank, iatom, jatom) index of a communication task to send/receive a block to/from a process.

Parameters
ind: encoded integer
pe: the rank of the process the block to be send to or receive from
iatom: the first index of the (iatom, jatom) block index
jatom: the second index of the (iatom, jatom) block index
natoms: the total number of atoms iatom and jatom indexes
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 804 of file qs_fb_com_tasks_types.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_com_atom_pairs_calc_buffer_sizes()

subroutine, public qs_fb_com_tasks_types::fb_com_atom_pairs_calc_buffer_sizes ( type(fb_com_atom_pairs_obj), intent(in)  atom_pairs,
integer, intent(in)  nprocs,
integer, dimension(:), intent(in)  row_blk_sizes,
integer, dimension(:), intent(in)  col_blk_sizes,
integer, dimension(:), intent(out)  sendrecv_sizes,
integer, dimension(:), intent(out)  sendrecv_disps,
integer, dimension(:), intent(out)  sendrecv_pair_counts,
integer, dimension(:), intent(out)  sendrecv_pair_disps 
)

Calculate the MPI send or recv buffer sizes according to the communication pairs (atom_pairs) and DBCSR matrix data. Each atom_pair corresponds to one DBCSR matrix block that needs to be sent or recerived.

Parameters
atom_pairs: the communication pair object for either sending or receiving
nprocs: total number of MPI processes in communicator
row_blk_sizes: row_blk_sizes(iblkrow) = number of element rows in each block in the iblkrow-th block row of the DBCSR matrix
col_blk_sizes: col_blk_sizes(iblkcol) = number of element cols in each block in the iblkcol-th block col of the DBCSR matrix
sendrecv_sizes: size required for the send of recv buffer for each dest/src process
sendrecv_disps: sendrecv_disps(ipe) + 1 = starting location in send/recv buffer for data destined for process ipe
sendrecv_pair_counts: sendrecv_pair_counts(ipe) = number of pairs (blocks) to be sent to or recv from process ipe
sendrecv_pair_dispssend_recv_pair_disps(ipe) + 1 = start location in atom_pairs array for all the pairs to be sent to or recv from process ipe
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 847 of file qs_fb_com_tasks_types.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_com_atom_pairs_gather_blks()

subroutine, public qs_fb_com_tasks_types::fb_com_atom_pairs_gather_blks ( type(dbcsr_type), pointer  dbcsr_mat,
type(fb_com_atom_pairs_obj), intent(in)  atom_pairs_send,
type(fb_com_atom_pairs_obj), intent(in)  atom_pairs_recv,
type(mp_para_env_type), pointer  para_env,
type(fb_matrix_data_obj), intent(inout)  matrix_storage 
)

Given send and recv fb_com_atom_pair object, gather all the relevant DBCSR matrix blocks together, and add them to a fb_matrix_data object for storage.

Parameters
dbcsr_mat: the DBCSR matrix where the matrix blocks will be obtained from
atom_pairs_send: prescription on exactly which DBCSR blocks are to be sent to where
atom_pairs_recv: prescription on exactly which DBCSR blocks are to be received from where
para_env: CP2K parallel environment
matrix_storage: the fb_matrix_data object to store the received DBCSR matrix blocks
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 921 of file qs_fb_com_tasks_types.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_com_atom_pairs_distribute_blks()

subroutine, public qs_fb_com_tasks_types::fb_com_atom_pairs_distribute_blks ( type(fb_matrix_data_obj), intent(in)  matrix_storage,
type(fb_com_atom_pairs_obj), intent(in)  atom_pairs_send,
type(fb_com_atom_pairs_obj), intent(in)  atom_pairs_recv,
type(mp_para_env_type), pointer  para_env,
type(dbcsr_type), pointer  dbcsr_mat 
)

Given send and recv fb_com_atom_pair object, distribute the matrix blocks stored in a fb_matrix_data object to a computable DBCSR matrix. It is assumed in this subroutine that the sizes of each block stored in fb_matrix_data object is consistent with the pre-defined block sizes in the DBCSR matrix.

Parameters
matrix_storage: the fb_matrix_data object
atom_pairs_send: prescription on exactly which DBCSR blocks are to be sent to where
atom_pairs_recv: prescription on exactly which DBCSR blocks are to be received from where
para_env: CP2K parallel environment
dbcsr_mat: the DBCSR matrix where the matrix blocks will be distributed to
Author
Lianheng Tong (LT) lianh.nosp@m.eng..nosp@m.tong@.nosp@m.kcl..nosp@m.ac.uk

Definition at line 1106 of file qs_fb_com_tasks_types.F.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ task_n_records

integer, parameter, public qs_fb_com_tasks_types::task_n_records = 4

Definition at line 75 of file qs_fb_com_tasks_types.F.

◆ task_dest

integer, parameter, public qs_fb_com_tasks_types::task_dest = 1

Definition at line 77 of file qs_fb_com_tasks_types.F.

◆ task_src

integer, parameter, public qs_fb_com_tasks_types::task_src = 2

Definition at line 77 of file qs_fb_com_tasks_types.F.

◆ task_pair

integer, parameter, public qs_fb_com_tasks_types::task_pair = 3

Definition at line 77 of file qs_fb_com_tasks_types.F.

◆ task_cost

integer, parameter, public qs_fb_com_tasks_types::task_cost = 4

Definition at line 77 of file qs_fb_com_tasks_types.F.