2 c---------------------------------------------------------------------
3 c---------------------------------------------------------------------
7 c---------------------------------------------------------------------
8 c---------------------------------------------------------------------
10 c---------------------------------------------------------------------
12 c---------------------------------------------------------------------
17 integer error, nc, color
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
43 if (node .ge. nc*nc) then
51 call mpi_comm_split(MPI_COMM_WORLD,color,node,comm_setup,error)
52 if (.not. active) return
54 call mpi_comm_size(comm_setup, no_nodes, error)
55 call mpi_comm_dup(comm_setup, comm_solve, error)
56 call mpi_comm_dup(comm_setup, comm_rhs, error)
58 c---------------------------------------------------------------------
59 c let node 0 be the root for the group (there is only one)
60 c---------------------------------------------------------------------