Esempio n. 1
0
        internal int[] MergeDataFromWorkers()
        {
            if (IsGlobalManager)
            {
                QSArray result = null;
                for (int process = 0; process < globalGroup.Total; process++)
                {
                    var array = ReceiveGlobalArrayFrom(process, Tags.Collect);

                    if (result == null)
                    {
                        result = array;
                    }
                    else
                    {
                        result = QSArray.Merge(result, array);
                    }
                }

                return(result.GetContent());
            }
            else
            {
                throw new InvalidOperationException($"Not Global Manager");
            }
        }
Esempio n. 2
0
        public static QSArray Merge(QSArray low, QSArray high)
        {
            var array = new List <int>();

            array.AddRange(low.GetContent());
            array.AddRange(high.GetContent());

            return(new QSArray(array));
        }
Esempio n. 3
0
 internal void SendWorkResult()
 {
     var request = globalGroup.Communicator.ImmediateSend <int[]>(currentArray.GetContent(), 0, Tags.Collect);
 }