![]() |
Octopus
|
Class defining batches of mesh functions. More...

Public Attributes | |
| integer, public | nst |
| number of functions in the batch More... | |
| integer, public | dim |
| Spinor dimension of the state (one, or two for spinors) More... | |
| integer, dimension(:), allocatable, public | ist |
| map from an global to local index More... | |
| integer, public | nst_linear |
| nst_linear = nst * stddim More... | |
| real(real64), dimension(:, :, :), pointer, public, contiguous | dff |
| pointer to real mesh functions: More... | |
| complex(real64), dimension(:, :, :), pointer, public, contiguous | zff |
| pointer to complex mesh functions: More... | |
| real(real64), dimension(:, :), pointer, public, contiguous | dff_linear |
| pointer to real mesh functions: More... | |
| complex(real64), dimension(:, :), pointer, public, contiguous | zff_linear |
| pointer to complex mesh functions: More... | |
| real(real64), dimension(:, :), pointer, public, contiguous | dff_pack |
| pointer to real mesh functions: More... | |
| complex(real64), dimension(:, :), pointer, public, contiguous | zff_pack |
| pointer to complex mesh functions: More... | |
| real(real32), dimension(:, :, :), pointer, public, contiguous | sff |
| real32 counterpart of dff More... | |
| complex(real32), dimension(:, :, :), pointer, public, contiguous | cff |
| complex32 counterpart of zff More... | |
| real(real32), dimension(:, :), pointer, public, contiguous | sff_linear |
| real32 counterpart of dff_linear More... | |
| complex(real32), dimension(:, :), pointer, public, contiguous | cff_linear |
| complex32 counterpart of zff_linear More... | |
| real(real32), dimension(:, :), pointer, public, contiguous | sff_pack |
| real32 counterpart of dff_pack More... | |
| complex(real32), dimension(:, :), pointer, public, contiguous | cff_pack |
| complex32 counterpart of zff_pack More... | |
| integer(int64), dimension(1:2), public | pack_size |
| pack_size = [pad_pow2(nst_linear), np] (see math_oct_m::pad_pow2) More... | |
| integer(int64), dimension(1:2), public | pack_size_real |
| pack_size_real = pack_size; if batch type is complex, then pack_size_real(1) = 2*pack_size(1) More... | |
| type(accel_mem_t), public | ff_device |
| pointer to device memory More... | |
Private Member Functions | |
| procedure | check_compatibility_with => batch_check_compatibility_with |
| check whether two batches have compatible dimensions (and type) More... | |
| procedure | clone_to => batch_clone_to |
| clone a batch to a new batch More... | |
| procedure | clone_to_array => batch_clone_to_array |
| procedure | copy_to => batch_copy_to |
| make a copy of a batch More... | |
| procedure | copy_data_to => batch_copy_data_to |
| copy data to another batch. More... | |
| procedure | do_pack_generic => batch_do_pack_generic |
| procedure | do_pack_target => batch_do_pack_target |
| generic | do_pack => do_pack_generic, do_pack_target |
| pack the data in a batch More... | |
| procedure | do_unpack => batch_do_unpack |
| unpack a batch More... | |
| procedure | finish_unpack => batch_finish_unpack |
| finish the unpacking if do_unpack() was called with async=.true. More... | |
| procedure | end => batch_end |
| finalize a batch and release allocated memory, if necessary More... | |
| procedure | inv_index => batch_inv_index |
| inverse index lookup More... | |
| procedure | is_packed => batch_is_packed |
| procedure | ist_idim_to_linear => batch_ist_idim_to_linear |
| direct index lookup More... | |
| procedure | linear_to_idim => batch_linear_to_idim |
| extract idim from linear index More... | |
| procedure | linear_to_ist => batch_linear_to_ist |
| get state index ist from linear (combined dim and nst) index More... | |
| procedure | pack_total_size => batch_pack_total_size |
| procedure | remote_access_start => batch_remote_access_start |
| start remote access to a batch on another node More... | |
| procedure | remote_access_stop => batch_remote_access_stop |
| stop the remote access to the batch More... | |
| procedure | status => batch_status |
| return the status of a batch More... | |
| procedure | type => batch_type |
| return the type of a batch More... | |
| procedure | type_as_int => batch_type_as_integer |
| For debuging purpose only. More... | |
| procedure, private | dallocate_unpacked_host => dbatch_allocate_unpacked_host |
| allocate host (CPU) memory for unpacked data of type TYPE_FLOAT More... | |
| procedure, private | zallocate_unpacked_host => zbatch_allocate_unpacked_host |
| allocate host (CPU) memory for unpacked data of type TYPE_CMPLX More... | |
| procedure, private | sallocate_unpacked_host => sbatch_allocate_unpacked_host |
| allocate host (CPU) memory for unpacked data of type TYPE_FLOAT_SINGLE More... | |
| procedure, private | callocate_unpacked_host => cbatch_allocate_unpacked_host |
| allocate host (CPU) memory for unpacked data of type TYPE_CMPLX_SINGLE More... | |
| procedure, private | allocate_unpacked_host => batch_allocate_unpacked_host |
| allocate host (CPU) memory for unpacked data More... | |
| procedure, private | dallocate_packed_host => dbatch_allocate_packed_host |
| allocate host (CPU) memory for packed data of type TYPE_FLOAT More... | |
| procedure, private | zallocate_packed_host => zbatch_allocate_packed_host |
| allocate host (CPU) memory for packed data of type TYPE_CMPLX More... | |
| procedure, private | sallocate_packed_host => sbatch_allocate_packed_host |
| allocate host (CPU) memory for packed data of type TYPE_FLOAT_SINGLE More... | |
| procedure, private | callocate_packed_host => cbatch_allocate_packed_host |
| allocate host (CPU) memory for packed data of type TYPE_CMPLX_SINGLE More... | |
| procedure, private | allocate_packed_host => batch_allocate_packed_host |
| allocate host (CPU) memory for packed data More... | |
| procedure, private | allocate_packed_device => batch_allocate_packed_device |
| allocate device (GPU) memory for packed data More... | |
| procedure, private | deallocate_unpacked_host => batch_deallocate_unpacked_host |
| release unpacked host memory More... | |
| procedure, private | deallocate_packed_host => batch_deallocate_packed_host |
| release packed host memory More... | |
| procedure, private | deallocate_packed_device => batch_deallocate_packed_device |
| release packed device memory More... | |
Private Attributes | |
| integer | np |
| number of points in each function (this can be np or np_part) More... | |
| integer | ndims |
| The second dimension of ist_idim_index(:,:). Currently always set to 2. More... | |
| integer, dimension(:, :), allocatable | ist_idim_index |
| index mapping fom global (ist,idim) to local ist. More... | |
| logical | is_allocated |
| indicate allocation status More... | |
| logical | own_memory |
| does the batch own the memory or is it foreign memory? More... | |
| integer | status_of |
| packing status of the batch More... | |
| integer | status_host |
| packing status in CPU memory More... | |
| type(type_t) | type_of |
| either TYPE_FLOAT or TYPE_CMPLX More... | |
| integer | device_buffer_count |
| keep track of pack operations performed on the device More... | |
| integer | host_buffer_count |
| keep track of pack operations performed on the host More... | |
| logical | special_memory |
| are we using hardware-aware memory? More... | |
| logical | needs_finish_unpack |
| if .true., async unpacking has started and needs be finished More... | |
|
private |
|
private |
clone a batch to a new batch
This routine clones the metadata of a batch and, if requested copies the data.
| [in] | this | source batch |
| [out] | dest | destination batch |
| [in] | pack | If .false. the new batch will not be packed. Default: batch_is_packed(this) |
| [in] | copy_data | If .true. the batch data will be copied to the destination batch. Default: .false. |
| [in] | new_np | If present, this replaces thisnp in the initialization |
| [in] | special | If present, this replace special in the logic below, i.e., we try to allocate on the GPU |
| [in] | dest_type | If present, this replaces the type of dest |
|
private |
| [in] | pack | If .false. the new batch will not be packed. Default: batch_is_packed(this) |
| [in] | copy_data | If .true. the batch data will be copied to the destination batch. Default: .false. |
| [in] | new_np | If present, this replaces thisnp in the initialization |
| [in] | special | If present, this replace special in the logic below, i.e., we try to allocate on the GPU |
| [in] | dest_type | If present, this replaces the type of dest |
|
private |
make a copy of a batch
This routine can perform a deep or a shallow copy of a batch
| [in] | this | The source batch |
| [out] | dest | The destination batch |
| [in] | pack | If .false. the new batch will not be packed. Default: batch_is_packed(this) |
| [in] | copy_data | If .true. the batch data will be copied to the destination batch. Default: .false. |
| [in] | new_np | If present, this replaces thisnp in the initialization |
| [in] | special | If present, this replace special in the locic below, i.e., we try to allocate on the GPU |
| [in] | dest_type | If present, this replaces the type of dest |
|
private |
|
private |
pack the data in a batch
If accelerators are enabled, the packed data is moved to the device memory. If the batch is already packed, a counter is increased to keep track when to unpack.
| [in,out] | this | The current batch |
| [in] | copy | Do we copy the data to the packed memory? (default .true.) |
| [in] | async | We can do an asynchronous operation. (default .false.) The program flow can continue while data is being transferred to the device. |
|
private |
unpack a batch
We unpack the batch if the 'packing counter' is one, or the force flag is given.
| [in] | copy | indicate whether to copy the data (default .true.) |
| [in] | force | if force = .true., unpack independently of the counter (default .false.) |
| [in] | async | indicate whether the operation can by asynchronous (default .false.). In this case the operation has to be completed by calling batch_finish_unpack() |
|
private |
finish the unpacking if do_unpack() was called with async=.true.
|
private |
finalize a batch and release allocated memory, if necessary
If the batch was initialized with 'external' memory, this routine ensures that this memory is up-to-date, when the batch is finalized. This means, that the data is copied from the device (If requested) and unpacked.
| [in] | copy | do we need to copy data from the device? Default = .true. (from batch_oct_m::batch_do_uppack) |
|
private |
|
private |
|
private |
|
private |
|
private |
start remote access to a batch on another node
This routine creates a remote access window for a given batch and returns a handle to that window. A handle of -1 indicates that no window was created.
| [in,out] | this | the current batch |
| [in] | mpi_grp | the MPI group |
| [out] | rma_win | handle of rma window |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
allocate host (CPU) memory for unpacked data of type TYPE_FLOAT_SINGLE
This routine takes care of the allocating the memory on the host. If requested (special_memory), pinned memory can be allocated, which optimizes the transfer to GPUs under certain conditions.
|
private |
allocate host (CPU) memory for unpacked data of type TYPE_CMPLX_SINGLE
This routine takes care of the allocating the memory on the host. If requested (special_memory), pinned memory can be allocated, which optimizes the transfer to GPUs under certain conditions.
|
private |
|
private |
|
private |
|
private |
allocate host (CPU) memory for packed data of type TYPE_FLOAT_SINGLE
This routine takes care of the allocating the memory on the host. If requested (special_memory), pinned memory can be allocated, which optimizes the transfer to GPUs under certain conditions.
|
private |
allocate host (CPU) memory for packed data of type TYPE_CMPLX_SINGLE
This routine takes care of the allocating the memory on the host. If requested (special_memory), pinned memory can be allocated, which optimizes the transfer to GPUs under certain conditions.
|
private |
|
private |
|
private |
|
private |
|
private |
| integer, public batch_oct_m::batch_t::nst |
| integer, public batch_oct_m::batch_t::dim |
|
private |
|
private |
|
private |
index mapping fom global (ist,idim) to local ist.
This maps ist and idim into one linear array. This index is constructed in batch_oct_m::batch_build_indices
| integer, dimension(:), allocatable, public batch_oct_m::batch_t::ist |
map from an global to local index
The global index does not need to start at 1, while the local index is always in the range 1:nst.
This index is constructed in batch_oct_m::batch_build_indices
|
private |
|
private |
| integer, public batch_oct_m::batch_t::nst_linear |
|
private |
|
private |
packing status in CPU memory
If Octopus runs on GPU, this indicates the status on the CPU. It can only be BATCH_NOT_PACKED and BATCH_PACKED. This makes transfers more efficient: usually we allocate a batch as packed on the CPU, then call do_pack to copy it to the GPU. In this case, it is really a copy. If the batch is unpacked on the CPU, we need to transpose in addition which makes it much slower.
|
private |
|
private |
|
private |
|
private |
| real(real64), dimension(:, :, :), pointer, public, contiguous batch_oct_m::batch_t::dff |
| complex(real64), dimension(:, :, :), pointer, public, contiguous batch_oct_m::batch_t::zff |
| real(real64), dimension(:, :), pointer, public, contiguous batch_oct_m::batch_t::dff_linear |
| complex(real64), dimension(:, :), pointer, public, contiguous batch_oct_m::batch_t::zff_linear |
| real(real64), dimension(:, :), pointer, public, contiguous batch_oct_m::batch_t::dff_pack |
| complex(real64), dimension(:, :), pointer, public, contiguous batch_oct_m::batch_t::zff_pack |
| real(real32), dimension(:, :, :), pointer, public, contiguous batch_oct_m::batch_t::sff |
| complex(real32), dimension(:, :, :), pointer, public, contiguous batch_oct_m::batch_t::cff |
| real(real32), dimension(:, :), pointer, public, contiguous batch_oct_m::batch_t::sff_linear |
| complex(real32), dimension(:, :), pointer, public, contiguous batch_oct_m::batch_t::cff_linear |
| real(real32), dimension(:, :), pointer, public, contiguous batch_oct_m::batch_t::sff_pack |
| complex(real32), dimension(:, :), pointer, public, contiguous batch_oct_m::batch_t::cff_pack |
| integer(int64), dimension(1:2), public batch_oct_m::batch_t::pack_size |
pack_size = [pad_pow2(nst_linear), np] (see math_oct_m::pad_pow2)
| integer(int64), dimension(1:2), public batch_oct_m::batch_t::pack_size_real |
| type(accel_mem_t), public batch_oct_m::batch_t::ff_device |