Example #1
0
#pragma warning restore 649

        /// <summary>
        ///
        /// </summary>
        unsafe public void Allreduce(IntPtr sndbuf, IntPtr rcvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
        {
            int ierr;

            MPI_ALLREDUCE(sndbuf, rcvbuf, ref count, ref datatype, ref op, ref comm, out ierr);
            MPIException.CheckReturnCode(ierr);
        }
Example #2
0
#pragma warning restore 649

        /// <summary>
        ///
        /// </summary>
        public void Send(IntPtr buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm)
        {
            int ierr;

            MPI_SEND(buf, ref count, ref datatype, ref dest, ref tag, ref comm, out ierr);
            MPIException.CheckReturnCode(ierr);
        }
Example #3
0
#pragma warning restore 649

        /// <summary>
        ///
        /// </summary>
        public void Gather(IntPtr sendbuf, int sendcount, MPI_Datatype sendtype, IntPtr recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
        {
            int ierr;

            MPI_GATHER(sendbuf, ref sendcount, ref sendtype, recvbuf, ref recvcount, ref recvtype, ref root, ref comm, out ierr);
            MPIException.CheckReturnCode(ierr);
        }
Example #4
0
#pragma warning restore 649

        /// <summary>
        ///
        /// </summary>
        public void Bcast(IntPtr buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
        {
            int ierr;

            MPI_BCAST(buf, ref count, ref datatype, ref root, ref comm, out ierr);
            MPIException.CheckReturnCode(ierr);
        }
Example #5
0
#pragma warning restore 649

        public void Scatterv(IntPtr sendbuf, IntPtr sendcounts, IntPtr displs, MPI_Datatype sendtype,
                             IntPtr recvbuf, int recvcount, MPI_Datatype recvtype,
                             int root, MPI_Comm comm)
        {
            MPI_SCATTERV(sendbuf, sendcounts, displs, ref sendtype, recvbuf, ref recvcount, ref recvtype, ref root, ref comm, out int ierr);
            MPIException.CheckReturnCode(ierr);
        }
Example #6
0
#pragma warning restore 649

        /// <summary>
        ///
        /// </summary>
        public void Recv(IntPtr buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, out MPI_Status status)
        {
            int ierr;

            MPI_RECV(buf, ref count, ref datatype, ref source, ref tag, ref comm, out status, out ierr);
            FixMPIStatus(ref status);
            MPIException.CheckReturnCode(ierr);
        }
Example #7
0
#pragma warning restore 649

        /// <summary>
        /// probably gets the count, who knows ...
        /// </summary>
        /// <param name="status"></param>
        /// <param name="datatype"></param>
        /// <returns></returns>
        public int GetCount(MPI_Status status, MPI_Datatype datatype)
        {
            int cnt, ierr;

            MPI_GET_COUNT(ref status, ref datatype, out cnt, out ierr);
            MPIException.CheckReturnCode(ierr);
            return(cnt);
        }
Example #8
0
#pragma warning restore 649

        /// <summary>
        ///
        /// </summary>
        public void Reduce(IntPtr sndbuf, IntPtr rcvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
        {
            using (new MPITracer()) {
                int ierr;
                MPI_REDUCE(sndbuf, rcvbuf, ref count, ref datatype, ref op, ref root, ref comm, out ierr);
                MPIException.CheckReturnCode(ierr);
            }
        }
Example #9
0
#pragma warning restore 649

        /// <summary>
        ///
        /// </summary>
        public void Allgatherv(IntPtr sendbuf, int sendcount, MPI_Datatype sendtype,
                               IntPtr recvbuf, IntPtr recvcounts, IntPtr displs, MPI_Datatype recvtype,
                               MPI_Comm comm)
        {
            int ierr;

            MPI_ALLGATHERV(sendbuf, ref sendcount, ref sendtype, recvbuf, recvcounts, displs, ref recvtype, ref comm, out ierr);
            MPIException.CheckReturnCode(ierr);
        }
Example #10
0
#pragma warning restore 649

        public void Gatherv(IntPtr sendbuf, int sendcount, MPI_Datatype sendtype,
                            IntPtr recvbuf, IntPtr recvcounts, IntPtr displs, MPI_Datatype recvtype,
                            int root, MPI_Comm comm)
        {
            using (new MPITracer()) {
                MPI_GATHERV(sendbuf, ref sendcount, ref sendtype, recvbuf, recvcounts, displs, ref recvtype, ref root, ref comm, out int ierr);
                MPIException.CheckReturnCode(ierr);
            }
        }
Example #11
0
#pragma warning restore 649

        /// <summary>
        ///
        /// </summary>
        public void Irecv(IntPtr buf, int count, MPI_Datatype datatype,
                          int source, int tag,
                          MPI_Comm comm,
                          out MPI_Request request)
        {
            int ierr;

            MPI_IRECV(buf, ref count, ref datatype, ref source, ref tag, ref comm, out request, out ierr);
            MPIException.CheckReturnCode(ierr);
        }
Example #12
0
        /// <summary>
        /// bitwise equivalence;
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (obj.GetType() != typeof(MPI_Datatype))
            {
                return(false);
            }
            MPI_Datatype other = (MPI_Datatype)obj;

            return(other.m1 == this.m1);
        }
Example #13
0
#pragma warning restore 649

        /// <summary>
        ///
        /// </summary>
        public void Allgather(IntPtr sendbuf, int sendcount, MPI_Datatype sendtype,
                              IntPtr recvbuf, int recvcount, MPI_Datatype recvtype,
                              MPI_Comm comm)
        {
            using (new MPITracer()) {
                int ierr;
                MPI_ALLGATHER(sendbuf, ref sendcount, ref sendtype, recvbuf, ref recvcount, ref recvtype, ref comm, out ierr);
                MPIException.CheckReturnCode(ierr);
            }
        }
Example #14
0
        private void LoadSymb(string name, ref MPI_Datatype sym)
        {
            string errstr;
            IntPtr addr = Utils.DynamicLibraries.LoadSymbol(m_conv.LibHandle, name, out errstr);

            if (addr == IntPtr.Zero)
            {
                throw new ApplicationException("OpenMPI error: unable to load symbol '" + name + "' from library '" + m_conv.CurrentLibraryName + "', Error string: >" + errstr + "<;");
            }
            //Console.WriteLine("val of '" + name + "' is: " + addr);
            sym.m1 = m_conv.MPI_Type_c2f(addr);
        }