Esempio n. 1
0
        public static void Main(string[] arguments)
        {
            string debug = Environment.GetEnvironmentVariable("MimicGeneratorDebugOnStart");

            if (debug != null && debug != "0")
            {
                Debugger.Launch();
            }

            Stopwatch sw   = Stopwatch.StartNew();
            Args      args = new Args(arguments);

            if (args.HelpDisplayed)
            {
                return;
            }

            try
            {
                GraphReader reader = new GraphReader(args.JsonGraph, args.ObservedInputs);
                BuildGraph  graph  = reader.ReadGraph();

                if (args.DuplicateGraph > 1)
                {
                    GraphMultiplier.DuplicateAsParallelGraphs(graph, args.DuplicateGraph, args.MaxPipsPerSpec);
                }

                BuildWriter writer = new BuildWriter(args.Dest, args.WriteInputs, args.InputScaleFactor, graph, args.IgnoreResponseFiles, args.Language);
                if (!writer.WriteBuildFiles())
                {
                    ExitError(sw);
                }

                Console.WriteLine("MimicGenerator completed successfully in {0} seconds.", sw.Elapsed.TotalSeconds);
                Environment.Exit(0);
            }
            catch (Exception ex)
            {
                ExitError(sw, ex);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Mutates the graph by duplicating the graph into n additional parallelizable graphs.
        /// </summary>
        public static void DuplicateAsParallelGraphs(BuildGraph graph, int duplicationFactor, int maxPipsPerSpec)
        {
            GraphMultiplier multiplier = new GraphMultiplier(graph);

            multiplier.Duplicate(duplicationFactor, maxPipsPerSpec);
        }