41 REAL(8) :: vertices(3,2)
43 INTEGER :: rank, n_ranks
45 REAL(8),
DIMENSION(:,:),
ALLOCATABLE :: new_vertices
47 CHARACTER(LEN=ALL_ERROR_LENGTH) :: all_error_desc
53 CALL mpi_comm_rank(mpi_comm_world,rank,error)
54 CALL mpi_comm_size(mpi_comm_world,n_ranks,error)
59 CALL mpi_dims_create(n_ranks,3,dims, error)
60 CALL mpi_cart_create(mpi_comm_world, 3, dims, period, .true., cart_comm, error)
63 length = 1.0d0 / real(dims,8)
66 CALL mpi_cart_coords(cart_comm, rank, 3, coords, error)
67 vertices(:,1) = real(coords,8) * length
68 vertices(:,2) = real(coords+1,8) * length
72 WRITE(*,
"(a,i7,2(a,3es14.7))")
"rank: ", rank,
" old vertices: ", vertices(:,1),
", ", vertices(:,2)
73 call mpi_barrier(cart_comm, error)
75 call mpi_barrier(cart_comm, error)
84 print*,
"Message: ", all_error_desc
85 call mpi_abort(mpi_comm_world, 1, error)
99 ALLOCATE(new_vertices(3,n_vertices))
104 WRITE(*,
"(2(a,i7),2(a,3es14.7))")
"rank: ", rank,
" ", n_vertices,
" new vertices: ", new_vertices(:,1), &
105 ", ", new_vertices(:,2)
106 call mpi_barrier(cart_comm, error)
108 call mpi_barrier(cart_comm, error)
111 DEALLOCATE(new_vertices)
113 CALL mpi_finalize(error);
The function API for ALL.
integer(c_int), parameter, public all_staggered
integer function, public all_error()
subroutine, public all_reset_error()
subroutine, public all_init(this, method, dim, gamma)
Initialises the loadbalancer.
subroutine, public all_setup(this)
Set up the loadbalancer.
subroutine, public all_set_proc_tag(this, tag)
Set process identifying tag for output.
subroutine, public all_set_vertices(this, vertices)
Set new vertices.
subroutine, public all_get_number_of_vertices(this, n)
Retrieve number of vertices for current vertices.
subroutine, public all_finalize(this)
Delete the loadbalance object.
subroutine, public all_set_work(this, work)
Set the work of this process.
subroutine, public all_balance(this)
Run loadbalancer and calculate new vertices.
subroutine, public all_get_vertices(this, vertices)
Retrieve current vertices.
character(len=all_error_length) function, public all_error_description()
The object oriented API is this object. It contains all relevant functions.