PartMC 2.1.1
|
Parallel aerosol particle coagulation with MPI. More...
Data Types | |
type | request_t |
A single outstanding request for a remote particle. More... | |
Functions/Subroutines | |
subroutine | request_allocate (request) |
subroutine | request_deallocate (request) |
Deallocate a request object and set it to be invalid. | |
logical | request_is_active (request) |
Whether the given reqest object is currectly active. | |
subroutine | mc_coag_dist (coag_kernel_type, bin_grid, env_state, aero_data, aero_weight, aero_state, del_t, k_max, tot_n_samp, tot_n_coag) |
Do coagulation for time del_t. | |
subroutine | coag_dist_recv (requests, bin_grid, env_state, aero_data, aero_weight, aero_state, accept_factors, coag_kernel_type, tot_n_coag, comp_vols, procs_done) |
subroutine | add_coagulation_requests (bin_grid, aero_state, requests, n_parts, local_bin, remote_bin, n_samps, samps_remaining) |
logical | any_requests_active (requests) |
Returns .true. if any of the requests are active, otherwise returns .false. | |
subroutine | find_rand_remote_proc (bin_grid, n_parts, remote_bin, remote_proc) |
subroutine | update_n_samps (bin_grid, n_samps, local_bin, remote_bin, samps_remaining) |
subroutine | send_request_particle (remote_proc, remote_bin) |
subroutine | recv_request_particle (aero_state) |
subroutine | send_return_no_particle (dest_proc, i_bin) |
subroutine | recv_return_no_particle (requests, bin_grid, aero_data, aero_state) |
subroutine | send_return_req_particle (aero_particle, i_bin, dest_proc) |
subroutine | recv_return_req_particle (requests, bin_grid, env_state, aero_data, aero_weight, aero_state, accept_factors, coag_kernel_type, tot_n_coag, comp_vols) |
subroutine | send_return_unreq_particle (aero_particle, dest_proc) |
subroutine | recv_return_unreq_particle (aero_state, bin_grid) |
subroutine | send_done (dest_proc) |
Send a message saying that this process is finished with its coagulation. | |
subroutine | recv_done (procs_done) |
Receive a done message. | |
subroutine | sync_info (local_n_parts, local_comp_vol, global_n_parts, global_comp_vols) |
Do an allgather to exchange number of particles and computational volume information between all processes. | |
subroutine | generate_n_samps (bin_grid, n_parts, comp_vols, del_t, k_max, n_samps, accept_factors) |
generate the number of samples to do per bin pair. | |
subroutine | coagulate_dist (bin_grid, aero_data, aero_weight, aero_state, aero_particle_1, aero_particle_2, remote_proc, comp_vols, remove_1, remove_2) |
Variables | |
integer, parameter | COAG_DIST_OUTGOING_BUFFER_SIZE = 1000000 |
Size of the outgoing buffer for bsend (bytes). | |
integer, parameter | COAG_DIST_MAX_BUFFER_SIZE = 10000 |
Size of send and receive buffer for each message (bytes). | |
integer, parameter | COAG_DIST_MAX_REQUESTS = 1 |
integer, parameter | COAG_DIST_TAG_REQUEST_PARTICLE = 5321 |
integer, parameter | COAG_DIST_TAG_RETURN_REQ_PARTICLE = 5322 |
integer, parameter | COAG_DIST_TAG_RETURN_UNREQ_PARTICLE = 5323 |
integer, parameter | COAG_DIST_TAG_RETURN_NO_PARTICLE = 5324 |
integer, parameter | COAG_DIST_TAG_DONE = 5325 |
Parallel aerosol particle coagulation with MPI.
subroutine pmc_coagulation_dist::add_coagulation_requests | ( | type(bin_grid_t),intent(in) | bin_grid, |
type(aero_state_t),intent(inout) | aero_state, | ||
type(request_t),dimension(coag_dist_max_requests),intent(inout) | requests, | ||
integer,dimension(:,:),intent(in) | n_parts, | ||
integer,intent(inout) | local_bin, | ||
integer,intent(inout) | remote_bin, | ||
integer,dimension(bin_grid%n_bin,bin_grid%n_bin),intent(inout) | n_samps, | ||
logical,intent(inout) | samps_remaining | ||
) |
bin_grid | Bin grid. |
aero_state | Aerosol state. |
requests | Array of outstanding requests. |
n_parts | Number of particles per bin per process. |
local_bin | Bin index of first particle we need to coagulate. |
remote_bin | Bin index of second particle we need to coagulate. |
n_samps | Number of samples remaining per bin pair |
samps_remaining | Whether there are still coagulation samples that need to be done. |
logical pmc_coagulation_dist::any_requests_active | ( | type(request_t),dimension(coag_dist_max_requests),intent(inout) | requests | ) |
Returns .true. if any of the requests are active, otherwise returns
.false.
requests | Array of outstanding requests. |
subroutine pmc_coagulation_dist::coag_dist_recv | ( | type(request_t),dimension(coag_dist_max_requests),intent(inout) | requests, |
type(bin_grid_t),intent(in) | bin_grid, | ||
type(env_state_t),intent(in) | env_state, | ||
type(aero_data_t),intent(in) | aero_data, | ||
type(aero_weight_t),intent(in) | aero_weight, | ||
type(aero_state_t),intent(inout) | aero_state, | ||
real(kind=dp),dimension(bin_grid%n_bin,bin_grid%n_bin),intent(out) | accept_factors, | ||
integer,intent(in) | coag_kernel_type, | ||
integer,intent(inout) | tot_n_coag, | ||
real(kind=dp),dimension(:),intent(in) | comp_vols, | ||
logical,dimension(:),intent(inout) | procs_done | ||
) |
requests | Array of outstanding requests. |
bin_grid | Bin grid. |
env_state | Environment state. |
aero_data | Aerosol data. |
aero_weight | Aerosol weight. |
aero_state | Aerosol state. |
accept_factors | Accept scale factors per bin pair (1). |
coag_kernel_type | Coagulation kernel type. |
tot_n_coag | Number of coagulation events. |
comp_vols | Computational volumes on all processes. |
procs_done | Which processes are finished with coagulation. |
subroutine pmc_coagulation_dist::coagulate_dist | ( | type(bin_grid_t),intent(in) | bin_grid, |
type(aero_data_t),intent(in) | aero_data, | ||
type(aero_weight_t),intent(in) | aero_weight, | ||
type(aero_state_t),intent(inout) | aero_state, | ||
type(aero_particle_t),intent(in) | aero_particle_1, | ||
type(aero_particle_t),intent(in) | aero_particle_2, | ||
integer,intent(in) | remote_proc, | ||
real(kind=dp),dimension(:),intent(in) | comp_vols, | ||
logical,intent(out) | remove_1, | ||
logical,intent(out) | remove_2 | ||
) |
bin_grid | Bin grid. |
aero_data | Aerosol data. |
aero_weight | Aerosol weight. |
aero_state | Aerosol state. |
aero_particle_1 | First particle to coagulate. |
aero_particle_2 | Second particle to coagulate. |
remote_proc | Remote process that the particle came from. |
comp_vols | Computational volumes on all processes (m^3). |
remove_1 | Whether to remove aero_particle_1 after the coagulation. |
remove_2 | Whether to remove aero_particle_2 after the coagulation. |
subroutine pmc_coagulation_dist::find_rand_remote_proc | ( | type(bin_grid_t),intent(in) | bin_grid, |
integer,dimension(:,:),intent(in) | n_parts, | ||
integer,intent(in) | remote_bin, | ||
integer,intent(out) | remote_proc | ||
) |
bin_grid | Bin grid. |
n_parts | Number of particles per bin per process. |
remote_bin | Remote bin number. |
remote_proc | Remote process number chosen at random. |
subroutine pmc_coagulation_dist::generate_n_samps | ( | type(bin_grid_t),intent(in) | bin_grid, |
integer,dimension(:,:),intent(in) | n_parts, | ||
real(kind=dp),dimension(:),intent(in) | comp_vols, | ||
real(kind=dp),intent(in) | del_t, | ||
real(kind=dp),dimension(bin_grid%n_bin,bin_grid%n_bin),intent(in) | k_max, | ||
integer,dimension(bin_grid%n_bin,bin_grid%n_bin),intent(out) | n_samps, | ||
real(kind=dp),dimension(bin_grid%n_bin,bin_grid%n_bin),intent(out) | accept_factors | ||
) |
generate the number of samples to do per bin pair.
bin_grid | Bin grid. |
n_parts | Number of particles per bin on all processes. |
comp_vols | Computational volumes on all processes.. |
del_t | Timestep. |
k_max | Maximum kernel. |
n_samps | Number of samples to do per bin pair. |
accept_factors | Accept scale factors per bin pair (1). |
subroutine pmc_coagulation_dist::mc_coag_dist | ( | integer,intent(in) | coag_kernel_type, |
type(bin_grid_t),intent(in) | bin_grid, | ||
type(env_state_t),intent(in) | env_state, | ||
type(aero_data_t),intent(in) | aero_data, | ||
type(aero_weight_t),intent(in) | aero_weight, | ||
type(aero_state_t),intent(inout) | aero_state, | ||
real(kind=dp),intent(in) | del_t, | ||
real(kind=dp),dimension(bin_grid%n_bin,bin_grid%n_bin),intent(in) | k_max, | ||
integer,intent(out) | tot_n_samp, | ||
integer,intent(out) | tot_n_coag | ||
) |
Do coagulation for time del_t.
coag_kernel_type | Coagulation kernel type. |
bin_grid | Bin grid. |
env_state | Environment state. |
aero_data | Aerosol data. |
aero_weight | Aerosol weight. |
aero_state | Aerosol state. |
del_t | Timestep. |
k_max | Maximum kernel. |
tot_n_samp | Total number of samples tested. |
tot_n_coag | Number of coagulation events. |
subroutine pmc_coagulation_dist::recv_done | ( | logical,dimension(:),intent(inout) | procs_done | ) |
Receive a done message.
procs_done | Which processes are finished with coagulation. |
subroutine pmc_coagulation_dist::recv_request_particle | ( | type(aero_state_t),intent(inout) | aero_state | ) |
aero_state | Aero state. |
subroutine pmc_coagulation_dist::recv_return_no_particle | ( | type(request_t),dimension(coag_dist_max_requests),intent(inout) | requests, |
type(bin_grid_t),intent(in) | bin_grid, | ||
type(aero_data_t),intent(in) | aero_data, | ||
type(aero_state_t),intent(inout) | aero_state | ||
) |
requests | Array of outstanding requests. |
bin_grid | Bin grid. |
aero_data | Aerosol data. |
aero_state | Aerosol state. |
subroutine pmc_coagulation_dist::recv_return_req_particle | ( | type(request_t),dimension(coag_dist_max_requests),intent(inout) | requests, |
type(bin_grid_t),intent(in) | bin_grid, | ||
type(env_state_t),intent(in) | env_state, | ||
type(aero_data_t),intent(in) | aero_data, | ||
type(aero_weight_t),intent(in) | aero_weight, | ||
type(aero_state_t),intent(inout) | aero_state, | ||
real(kind=dp),dimension(bin_grid%n_bin,bin_grid%n_bin),intent(out) | accept_factors, | ||
integer,intent(in) | coag_kernel_type, | ||
integer,intent(inout) | tot_n_coag, | ||
real(kind=dp),dimension(:),intent(in) | comp_vols | ||
) |
requests | Array of outstanding requests. |
bin_grid | Bin grid. |
env_state | Environment state. |
aero_data | Aerosol data. |
aero_weight | Aerosol weight. |
aero_state | Aerosol state. |
accept_factors | Accept scale factors per bin pair (1). |
coag_kernel_type | Coagulation kernel type. |
tot_n_coag | Number of coagulation events. |
comp_vols | Computational volumes on all processes. |
subroutine pmc_coagulation_dist::recv_return_unreq_particle | ( | type(aero_state_t),intent(inout) | aero_state, |
type(bin_grid_t),intent(in) | bin_grid | ||
) |
aero_state | Aerosol state. |
bin_grid | Bin grid. |
subroutine pmc_coagulation_dist::request_allocate | ( | type(request_t),intent(out) | request | ) |
request | Request object to allocate. |
subroutine pmc_coagulation_dist::request_deallocate | ( | type(request_t),intent(inout) | request | ) |
Deallocate a request object and set it to be invalid.
request | Request object to deallocate |
logical pmc_coagulation_dist::request_is_active | ( | type(request_t),intent(in) | request | ) |
Whether the given reqest object is currectly active.
request | Request object to test for activeness. |
subroutine pmc_coagulation_dist::send_done | ( | integer,intent(in) | dest_proc | ) |
Send a message saying that this process is finished with its coagulation.
dest_proc | Process to send the message to. |
subroutine pmc_coagulation_dist::send_request_particle | ( | integer,intent(in) | remote_proc, |
integer,intent(in) | remote_bin | ||
) |
remote_proc | Remote process number. |
remote_bin | Remote bin number. |
subroutine pmc_coagulation_dist::send_return_no_particle | ( | integer,intent(in) | dest_proc, |
integer,intent(in) | i_bin | ||
) |
dest_proc | Process number to send message to. |
i_bin | Bin number where there was no particle. |
subroutine pmc_coagulation_dist::send_return_req_particle | ( | type(aero_particle_t),intent(in) | aero_particle, |
integer,intent(in) | i_bin, | ||
integer,intent(in) | dest_proc | ||
) |
aero_particle | Aero particle to send. |
i_bin | Bin that the particle is in. |
dest_proc | Process number to send particle to. |
subroutine pmc_coagulation_dist::send_return_unreq_particle | ( | type(aero_particle_t),intent(in) | aero_particle, |
integer,intent(in) | dest_proc | ||
) |
aero_particle | Aero particle to send. |
dest_proc | Process to send the particle to. |
subroutine pmc_coagulation_dist::sync_info | ( | integer,dimension(:),intent(in) | local_n_parts, |
real(kind=dp),intent(in) | local_comp_vol, | ||
integer,dimension(:,:),intent(out) | global_n_parts, | ||
real(kind=dp),dimension(:),intent(out) | global_comp_vols | ||
) |
Do an allgather to exchange number of particles and computational volume information between all processes.
local_n_parts | Number of particles per bin on the local process. |
local_comp_vol | Computational volume on the local process. |
global_n_parts | Number of particles per bin on all processes. |
global_comp_vols | Computational volumes on all processes (m^3). |
subroutine pmc_coagulation_dist::update_n_samps | ( | type(bin_grid_t),intent(in) | bin_grid, |
integer,dimension(bin_grid%n_bin,bin_grid%n_bin),intent(inout) | n_samps, | ||
integer,intent(inout) | local_bin, | ||
integer,intent(inout) | remote_bin, | ||
logical,intent(inout) | samps_remaining | ||
) |
bin_grid | Bin grid. |
n_samps | Number of samples remaining per bin pair |
local_bin | Bin index of first particle we need to coagulate. |
remote_bin | Bin index of second particle we need to coagulate. |
samps_remaining | Whether there are still coagulation samples that need to be done. |
integer,parameter pmc_coagulation_dist::COAG_DIST_MAX_BUFFER_SIZE = 10000 |
Size of send and receive buffer for each message (bytes).
The biggest message type will be one of the particle-sending types, for which we need pmc_mpi_pack_size_aero_particle(), plus a couple of integers or something. At the moment this means something like (10 + n_spec) reals, (3 + 2) integers, which for n_spec = 20 gives a size of 260 bytes.
integer,parameter pmc_coagulation_dist::COAG_DIST_MAX_REQUESTS = 1 |
integer,parameter pmc_coagulation_dist::COAG_DIST_OUTGOING_BUFFER_SIZE = 1000000 |
Size of the outgoing buffer for bsend
(bytes).
FIXME: check that this size is big enough. It must be large enough to handle the required number of messages of the given sizes, plus MPI_BSEND_OVERHEAD per message, plus some extra room because it's only kind of a circular buffer --- the messages themselves aren't allowed to wrap around then end, so we might need extra space up to the size of the largest message type.
integer,parameter pmc_coagulation_dist::COAG_DIST_TAG_DONE = 5325 |
integer,parameter pmc_coagulation_dist::COAG_DIST_TAG_REQUEST_PARTICLE = 5321 |
integer,parameter pmc_coagulation_dist::COAG_DIST_TAG_RETURN_NO_PARTICLE = 5324 |
integer,parameter pmc_coagulation_dist::COAG_DIST_TAG_RETURN_REQ_PARTICLE = 5322 |
integer,parameter pmc_coagulation_dist::COAG_DIST_TAG_RETURN_UNREQ_PARTICLE = 5323 |