コード例 #1
0
        /// <summary>
        /// Serializes pip graph fragment.
        /// </summary>
        public void Serialize(AbsolutePath filePath, IPipScheduleTraversal pipGraph, string fragmentDescription = null, bool useTopSortSerialization = false)
        {
            if (useTopSortSerialization)
            {
                var topSorter  = new PipGraphFragmentTopSort(pipGraph);
                var sortedPips = topSorter.Sort();

                SerializeTopSort(filePath, sortedPips, fragmentDescription);
            }
            else
            {
                SerializeSerially(filePath, pipGraph.RetrieveScheduledPips().ToList(), fragmentDescription);
            }
        }
コード例 #2
0
        /// <summary>
        /// Serializes pip graph fragment.
        /// </summary>
        public void Serialize(AbsolutePath filePath, IPipGraph pipGraph, string fragmentDescription = null, bool useTopSortSerialization = false)
        {
            if (useTopSortSerialization)
            {
                var topSorter  = new PipGraphFragmentTopSort(pipGraph);
                var sortedPips = topSorter.Sort();
                int pipCount   = sortedPips.Aggregate(0, (n, layer) => n + layer.Count);

                SerializeTopSort(filePath, sortedPips, pipCount, fragmentDescription);
            }
            else
            {
                SerializeSerially(filePath, pipGraph.RetrieveScheduledPips().ToList(), fragmentDescription);
            }
        }