示例#1
0
            private int[] takeResults(IList <MPI.Request> reqList_complete)
            {
                int[] result_values = new int[channel.RemoteSize];

                foreach (MPI.Request req in reqList_complete)
                {
                    if (req is MPI.ReceiveRequest)
                    {
                        MPI.ReceiveRequest  recv_req = (MPI.ReceiveRequest)req;
                        MPI.CompletedStatus status   = recv_req.Wait();
                        int value = (int)recv_req.GetValue();
                        result_values [status.Source] = value;
                    }
                }

                return(result_values);
            }
示例#2
0
        void handleOperation7(IList <MPI.Request> reqList_complete)
        {
            int[] arg1_values = new int[channel.RemoteSize];
            int[] arg2_values = new int[channel.RemoteSize];
            int[] arg3_values = new int[channel.RemoteSize];
            int[] arg4_values = new int[channel.RemoteSize];
            int[] arg5_values = new int[channel.RemoteSize];
            int[] arg6_values = new int[channel.RemoteSize];

            foreach (MPI.Request req in reqList_complete)
            {
                MPI.ReceiveRequest  recv_req = (MPI.ReceiveRequest)req;
                MPI.CompletedStatus status   = recv_req.Test();
                Tuple <int, int, int, int, int, int> value = (Tuple <int, int, int, int, int, int>)recv_req.GetValue();
                arg1_values [status.Source] = value.Item1;
                arg2_values [status.Source] = value.Item2;
                arg3_values [status.Source] = value.Item3;
                arg4_values [status.Source] = value.Item4;
                arg5_values [status.Source] = value.Item5;
                arg6_values [status.Source] = value.Item6;
            }

            IGather <int> arg1 = Gather <int> .create(channel, arg1_values);

            IReduce <int> arg2 = Reduce <int> .create(channel, arg2_values, sum, 0);

            IScan <int> arg3 = Scan <int> .create(channel, arg3_values, sum, 0);

            IGather <int> arg4 = Gather <int> .create(channel, arg4_values);

            IReduce <int> arg5 = Reduce <int> .create(channel, arg5_values, sum, 0);

            IScan <int> arg6 = Scan <int> .create(channel, arg6_values, sum, 0);

            IScatter <int> result = service.some_method_7(arg1, arg2, arg3, arg4, arg5, arg6);

            returnResult(result.Value, OPERATION_7);
        }