Nature Language: setupCommunicators:This creates two new communicators. The first gives a local communicator for processes on the same node. The second uses the local rank to give a communicator across node boundaries. e.g. for 16 nodes each with 2 processors, this routine will give 16 local communicators of size 2 and 2 communicators of size 2 across nodes.
  
CPP: int setupCommunicators(){\n    int procHash;\n\n    procHash = procNameToHash();\n\n    /* local communicator. */\n    MPI_Comm_split(comm, procHash, 0, &localComm);\n    MPI_Comm_rank(localComm, &localCommRank);\n    MPI_Comm_size(localComm, &localCommSize);\n\n    MPI_Comm_split(comm, localCommRank, 0, &crossComm);\n    MPI_Comm_rank(crossComm, &crossCommRank);\n\n    return 0;\n}\\n",
  
Fortran: SUBROUTINE setupCommunicators()\n integer :: procHash\n \n !Get hash based on processor name\n procHash = procNameToHash()\n \n !Comm_split using procHash as colour to get \n !local cmmunicator.\n CALL MPI_Comm_split(comm, procHash, 0, localComm, ierr)\n \n !Find ranks of processes in localComm\n CALL MPI_Comm_rank(localComm, localCommRank, ierr)\n \n !Find the size of localComm (for use in calculating multi datasize)\n CALL MPI_Comm_size(localComm, localCommSize, ierr)\n \n !Use localRank as colour to get communicator across nodes.\n CALL MPI_Comm_split(comm, localCommRank, 0, crossComm, ierr)\n \n !Find ranks of processes in crossComm\n CALL MPI_Comm_rank(crossComm, crossCommRank, ierr)\n \n END SUBROUTINE setupCommunicators
  