Esempio n. 1
0
        public static int[] GetMaxRankOnAllNodes(this MPI.Intracommunicator communicator)
        {
            string[] processors = communicator.Allgather <string>(MPI.Environment.ProcessorName).Distinct().ToArray();
            int[]    maxRanks   = new int[processors.Length];

            for (int i = 0; i < processors.Length; i++)
            {
                maxRanks[i] = GetMaxRankOnNode(communicator, processors[i]);
            }

            return(maxRanks);
        }
Esempio n. 2
0
        public static int GetMaxRankOnNode(this MPI.Intracommunicator communicator, string processorName)
        {
            string[] processers = communicator.Allgather <string>(MPI.Environment.ProcessorName);

            for (int i = processers.Length - 1; i >= 0; i--)
            {
                if (processers[i] == processorName)
                {
                    return(i);
                }
            }

            throw new ApplicationException("An error occured finding the max rank on processor");
        }
Esempio n. 3
0
 public static int GetNumberOfNodes(this MPI.Intracommunicator communicator)
 {
     string[] processors = communicator.Allgather <string>(MPI.Environment.ProcessorName).Distinct().ToArray();
     return(processors.Length);
 }