Example #1
0
        public void Cancel(Exception e)
        {
            Logging.Error("Cancelling execution of graph {0}, due to exception:\n{1}", this.Index, e);

            lock (this)
            {
                if (this.currentState == InternalComputationState.Failed)
                {
                    return;
                }

                this.currentState = InternalComputationState.Failed;
                this.Exception    = e;


                if (this.Controller.NetworkChannel != null)
                {
                    MessageHeader  header  = MessageHeader.GraphFailure(this.index);
                    SendBufferPage page    = SendBufferPage.CreateSpecialPage(header, 0);
                    BufferSegment  segment = page.Consume();

                    Logging.Error("Broadcasting graph failure message");

                    this.Controller.NetworkChannel.BroadcastBufferSegment(header, segment);
                }

                this.ProgressTracker.Cancel();
            }
        }
Example #2
0
        private void AnnounceStartup(int barrierId)
        {
            int seqno = this.GetSequenceNumber(-1);
            SendBufferPage startupPage = SendBufferPage.CreateSpecialPage(MessageHeader.GenerateBarrierMessageHeader(barrierId), seqno, this.HeaderSerializer);
            BufferSegment startupSegment = startupPage.Consume();

            for (int i = 0; i < this.connections.Count - 2; ++i)
                startupSegment.Copy();

            for (int i = 0; i < this.connections.Count; ++i)
            {
                if (i != this.localProcessID)
                {
                    Logging.Info("Sending startup message to process {0}", i);
                    this.SendBufferSegment(startupPage.CurrentMessageHeader, i, startupSegment);
                }
            }
        }
Example #3
0
        public void AnnounceCheckpoint()
        {
            int seqno = this.GetSequenceNumber(-1);
            SendBufferPage checkpointPage = SendBufferPage.CreateSpecialPage(MessageHeader.Checkpoint, seqno, this.Controller.SerializationFormat.GetSerializer<MessageHeader>());
            BufferSegment checkpointSegment = checkpointPage.Consume();

            for (int i = 0; i < this.connections.Count - 2; ++i)
                checkpointSegment.Copy();

            for (int i = 0; i < this.connections.Count; ++i)
            {
                if (i != this.localProcessID)
                {
                    Logging.Info("Sending checkpoint message to process {0}", i);
                    this.SendBufferSegment(checkpointPage.CurrentMessageHeader, i, checkpointSegment);
                }
            }
        }