Exemplo n.º 1
0
        public static void SetupParallelism(ref string[] args)
        {
            //  Set up MPI
            PWCUtility.MPI_Environment  = new MPI.Environment(ref args);
            PWCUtility.MPI_communicator = Communicator.world;               //initializing MPI world communicator
            PWCUtility.MPI_Rank         = PWCUtility.MPI_communicator.Rank; // Rank of this process
            PWCUtility.MPI_Size         = PWCUtility.MPI_communicator.Size; // Number of MPI Processes

            // Set up MPI
            PWCUtility.MPIperNodeCount = PWCUtility.MPI_Size / PWCUtility.NodeCount;

            if ((PWCUtility.MPIperNodeCount * PWCUtility.NodeCount) != PWCUtility.MPI_Size)
            {
                Exception e = PWCUtility.SALSAError("Inconsistent MPI counts Nodes "
                                                    + PWCUtility.NodeCount.ToString() + " Size " + PWCUtility.MPI_Size.ToString());

                throw (e);
            }

            PWCUtility.ParallelPattern = "Machine:" + MPI.Environment.ProcessorName.ToString() + " " + PWCUtility.ThreadCount.ToString() + "x" + PWCUtility.MPIperNodeCount.ToString() + "x" + PWCUtility.NodeCount.ToString();
            if (PWCUtility.MPI_Rank == 0)
            {
                PWCUtility.SALSAPrint(0, " Distance Data Type: " + typeof(TDistance));
                PWCUtility.SALSAPrint(0, PWCUtility.ParallelPattern);
            }
        }   // End SetupParallelism