20#ifndef DOXYGEN_SHOULD_SKIP_THIS
24#if defined(SPM_WITH_MPI)
29 type(spmatrix_t),
target :: spm
30 type(spmatrix_t),
target :: spml
31 type(spmatrix_t),
target :: spmg
32 integer(c_int) :: info
33 integer(spm_int_t) :: n
37#if defined(SPM_WITH_MPI)
41 call mpi_comm_rank( mpi_comm_world, rank )
42 call mpi_comm_size( mpi_comm_world,
size )
48 call spmreaddriverdist( spmdriverlaplacian,
"d:10:10:10:4.", spm, mpi_comm_world, info )
49 call spmprintinfo( spm )
53 if ( rank .eq. 0 )
then
54 call spmgather( spm, 0, spmg )
55 call spmprintinfo( spmg )
57 call spmgather( spm, 0 )
62 if ( rank .eq. 0 )
then
63 n = n + mod( spm%gN,
size )
64 call spmscatter( spml, 0, spmg )
67 call spmscatter( spml, 0 )
70 call spmprintinfo( spml )
73#if defined(SPM_WITH_MPI)
74 call mpi_finalize( info )
77end program spmf_rebalance