예제 #1
0
        public Mpi Separate(int color)
        {
            IntPtr comm;

            UNM.CommSplit(Communicator, color, Rank, &comm);
            return(new Mpi(comm));
        }
예제 #2
0
 public void Gather(Complex[] dst, Complex src)
 {
     if (_mpiexists)
     {
         fixed(Complex *dstPtr = &dst[0])
         UNM.Gather(&src, 1, dstPtr, 1, Master, Communicator);
     }
     else
     {
         dst [0] = src;
     }
 }
예제 #3
0
        public string GetProcessorName()
        {
            var name   = new byte[GetMaxProcessorName()];
            int length = 0;

            fixed(byte *namePtr = &name[0])
            {
                int err = UNM.GetProcessorName(namePtr, ref length);
            }

            return(Encoding.ASCII.GetString(name, 0, length));
        }
예제 #4
0
        public Mpi Dup()
        {
            IntPtr comm;

            if (_mpiexists)
            {
                UNM.CommDup(this.Communicator, &comm);
                return(new Mpi(comm));
            }
            else
            {
                return(new Mpi());
            }
        }
예제 #5
0
 public void Gather(Complex *dst, Complex *src, int dstSize, int srcSize)
 {
     if (_mpiexists)
     {
         UNM.Gather(src, srcSize, dst, dstSize, Master, Communicator);
     }
     else
     {
         if (src != dst)
         {
             for (int i = 0; i < srcSize; i++)
             {
                 dst [i] = src [i];
             }
         }
     }
 }
예제 #6
0
 public static string GetErrorString(int error)
 => UNM.GetErrorString(error);
예제 #7
0
 public int Recv(void *data, int count, IntPtr datatype, int source, int tag, out int actualSource)
 => UNM.Recv(data, count, datatype, source, tag, Communicator, out actualSource);
예제 #8
0
 public int Send(void *data, int count, IntPtr datatype, int dest, int tag)
 => UNM.Send(data, count, datatype, dest, tag, Communicator);