Beispiel #1
0
        void handle_SEND(Tuple <int, int> operation, MPI.CompletedStatus status)
        {
            Console.WriteLine(status.Source + ": handle_SEND 1");

            Tuple <int, int, int, byte[]> operation_info;
            int conversation_tag = operation.Item2;

            this.RootCommunicator.Receive <Tuple <int, int, int, byte[]> > (status.Source, conversation_tag, out operation_info);

            Console.WriteLine(status.Source + ": handle_SEND 2");

            int operation_type = operation.Item1;
            int facet_src      = this.ThisFacet;
            int facet_dst      = operation_info.Item1;
            int src            = status.Source;
            int dst            = operation_info.Item2;
            int tag            = operation_info.Item3;

            Console.WriteLine(status.Source + ": handle_SEND 3 --- " + facet_src + "," + facet_dst + "," + src + "," + dst + "," + tag);

            EnvelopType envelop = new EnvelopType(operation_type, facet_src, facet_dst, src, dst, tag);

            byte[] message1 = operation_info.Item4;
            Console.WriteLine(status.Source + ": handle_SEND 4");

            synchronizer_monitor.clientSendRequest(envelop, message1);
            Console.WriteLine(status.Source + ": handle_SEND 5");
        }
        void handle_SEND(Tuple <int, int> operation, MPI.CompletedStatus status)
        {
            Trace.WriteLineIf(this.TraceFlag == true, status.Source + ": handle_SEND 1 " + operation);

            Tuple <int, int, int, byte[]> operation_info;
            int conversation_tag = operation.Item2;

            //lock (lock_recv)
            this.RootCommunicator.Receive <Tuple <int, int, int, byte[]> > (status.Source, conversation_tag, out operation_info);

            Trace.WriteLineIf(this.TraceFlag == true, status.Source + ": handle_SEND 2 --- operation = " + operation);

            int operation_type = operation.Item1;
            int facet_src      = this.ThisFacetInstance;
            int facet_dst      = operation_info.Item1;
            int src            = status.Source;
            int dst            = operation_info.Item2;
            int tag            = operation_info.Item3;

            Trace.WriteLineIf(this.TraceFlag == true, status.Source + ": handle_SEND 3 --- " + facet_src + "," + facet_dst + "," + src + "," + dst + "," + tag + ", operation = " + operation);

            EnvelopType envelop = new EnvelopType(operation_type, facet_src, facet_dst, src, dst, tag);

            byte[] message1 = operation_info.Item4;
            Trace.WriteLineIf(this.TraceFlag == true, status.Source + ": handle_SEND 4 --- operation = " + operation);

            if (tag >= 0 /* tag */)
            {
                synchronizer_monitor.clientSendRequest(envelop, message1);
            }
            else
            {
                synchronizer_monitor.clientSendRequestAnyTag(envelop, message1, ref tag);
            }
            Trace.WriteLineIf(this.TraceFlag == true, status.Source + ": handle_SEND 5 --- operation = " + operation);
        }