Пример #1
0
        /// <summary>
        ///   Compare two MPI groups.
        /// </summary>
        /// <list>
        ///   <listheader>
        ///     <term>Value</term>
        ///     <description>Description</description>
        ///   </listheader>
        /// <item>
        ///   <term><see cref="Comparison.Identical"/></term>
        ///   <description>The two <c>Group</c> objects represent the same group.</description>
        /// </item>
        /// <item>
        ///   <term><see cref="Comparison.Congruent"/></term>
        ///   <description>
        ///     The two <c>Group</c> objects contain the same processes with the same ranks,
        ///     but represent different groups.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term><see cref="Comparison.Similar"/></term>
        ///   <description>
        ///     The two <c>Group</c> objects contain the same processes, but with different ranks.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term><see cref="Comparison.Unequal"/></term>
        ///   <descsription>The two <c>Group</c> objects are different.</descsription>
        /// </item>
        /// </list>
        public Comparison Compare(Group other)
        {
            int result;

            unsafe
            {
                int errorCode = Unsafe.MPI_Group_compare(group, other.group, out result);
                if (errorCode != Unsafe.MPI_SUCCESS)
                {
                    throw Environment.TranslateErrorIntoException(errorCode);
                }
            }
            return(Unsafe.ComparisonFromInt(result));
        }