| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(resources_t), | intent(in) | :: | resources | |||
| type(calculation_result_t), | intent(inout) | :: | results(:) | |||
| integer(kind=int64), | intent(inout) | :: | results_received | |||
| type(timer_type), | intent(in) | :: | coord_timer | |||
| integer(kind=int64), | intent(in) | :: | n_pie_terms |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | private | :: | has_pending | ||||
| type(request_t), | private | :: | req | ||||
| type(MPI_Status), | private | :: | status | ||||
| integer(kind=int64), | private | :: | term_idx |
subroutine handle_node_results(resources, results, results_received, coord_timer, n_pie_terms) use mqc_resources, only: resources_t type(resources_t), intent(in) :: resources type(calculation_result_t), intent(inout) :: results(:) integer(int64), intent(inout) :: results_received type(timer_type), intent(in) :: coord_timer integer(int64), intent(in) :: n_pie_terms integer(int64) :: term_idx type(MPI_Status) :: status logical :: has_pending type(request_t) :: req do call iprobe(resources%mpi_comms%world_comm, MPI_ANY_SOURCE, TAG_NODE_SCALAR_RESULT, has_pending, status) if (.not. has_pending) exit call irecv(resources%mpi_comms%world_comm, term_idx, status%MPI_SOURCE, TAG_NODE_SCALAR_RESULT, req) call wait(req) call result_irecv(results(term_idx), resources%mpi_comms%world_comm, status%MPI_SOURCE, TAG_NODE_SCALAR_RESULT, req) call wait(req) if (results(term_idx)%has_error) then call logger%error("PIE term "//to_char(term_idx)//" calculation failed: "// & results(term_idx)%error%get_message()) call abort_comm(resources%mpi_comms%world_comm, 1) end if results_received = results_received + 1 if (mod(results_received, max(1_int64, n_pie_terms/10_int64)) == 0 .or. & results_received == n_pie_terms) then call logger%info(" Processed "//to_char(results_received)//"/"// & to_char(n_pie_terms)//" PIE terms ["// & to_char(coord_timer%get_elapsed_time())//" s]") end if end do end subroutine handle_node_results