2 c---------------------------------------------------------------------
3 c---------------------------------------------------------------------
7 c---------------------------------------------------------------------
8 c---------------------------------------------------------------------
10 c---------------------------------------------------------------------
12 c---------------------------------------------------------------------
17 integer error, color, nc
21 call mpi_comm_size(MPI_COMM_WORLD, total_nodes, error)
22 call mpi_comm_rank(MPI_COMM_WORLD, node, error)
24 if (.not. convertdouble) then
25 dp_type = MPI_DOUBLE_PRECISION
30 c---------------------------------------------------------------------
31 c compute square root; add small number to allow for roundoff
32 c---------------------------------------------------------------------
33 nc = dint(dsqrt(dble(total_nodes) + 0.00001d0))
35 c---------------------------------------------------------------------
36 c We handle a non-square number of nodes by making the excess nodes
37 c inactive. However, we can never handle more cells than were compiled
39 c---------------------------------------------------------------------
41 if (nc .gt. maxcells) nc = maxcells
42 if (node .ge. nc*nc) then
50 call mpi_comm_split(MPI_COMM_WORLD,color,node,comm_setup,error)
51 if (.not. active) return
53 call mpi_comm_size(comm_setup, no_nodes, error)
54 call mpi_comm_dup(comm_setup, comm_solve, error)
55 call mpi_comm_dup(comm_setup, comm_rhs, error)
57 c---------------------------------------------------------------------
58 c let node 0 be the root for the group (there is only one)
59 c---------------------------------------------------------------------