Example #1
0
        public static JobHandle ScheduleParallel
        <JOB>(this JOB job, uint iterations, JobHandle inputDeps) where JOB : struct, IJobParallelFor
        {
            var innerloopBatchCount = ProcessorCount.BatchSize(iterations);

            return(job.Schedule((int)iterations, innerloopBatchCount, inputDeps));
        }
Example #2
0
        public IEnumerable <string> GetCommandLineArgs()
        {
            Validate();

            if (MaxChessTime.HasValue)
            {
                yield return("/maxchesstime:" + MaxChessTime.ToString());
            }

            if (MaxPreemptions.HasValue)
            {
                yield return("/maxpreemptions:" + MaxPreemptions.ToString());
            }

            if (MaxExecs.HasValue)
            {
                yield return("/maxexecs:" + MaxExecs.ToString());
            }

            if (MaxExecSteps.HasValue)
            {
                yield return("/maxexecsteps:" + MaxExecSteps.ToString());
            }

            if (MaxExecTime.HasValue)
            {
                yield return("/maxexectime:" + MaxExecTime.ToString());
            }

            if (ProcessorCount.HasValue)
            {
                yield return("/processorcount:" + ProcessorCount.ToString());
            }


            //
            if (EnableRaceDetection == true)
            {
                yield return("/detectraces");
            }
            if (EnableAtomicityChecking == true)
            {
                yield return("/checkatomicity");
            }
            if (EnableDeterminismChecking == true)
            {
                yield return("/checkdeterminism");
            }
            if (PreemptVolatiles.HasValue)
            {
                if (PreemptVolatiles.Value)
                {
                    yield return("/volatile");
                }
                else
                {
                    yield return("/volatile-");
                }
            }
            if (PreemptAllAccesses == true)
            {
                yield return("/preemptaccesses");
            }


            if (Break.HasValue && Break.Value != MChessBreak.NoBreak)
            {
                yield return("/break:" + Break.Value.ToCommandLineOptionValue());
            }
            if (EnableRepro == true)
            {
                yield return("/repro");
            }
            if (EnableTracing == true)
            {
                if (TraceAllSchedules == true)
                {
                    yield return("/alltraces");
                }
                else
                {
                    yield return("/trace");
                }
            }
            if (TargetRace.HasValue)
            {
                yield return("/targetrace:" + TargetRace.Value);
            }
            //if (XSchedule != null) ;  // Doesn't get to the cmd line
            if (!String.IsNullOrEmpty(ScheduleFilePath))
            {
                yield return("/schedulefile:" + ScheduleFilePath);
            }

            if ((EnumerateObservations == true || CheckObservations == true) && !String.IsNullOrWhiteSpace(ObservationFile))
            {
                if (EnumerateObservations == true)
                {
                    yield return("/enumerateobservations:" + ObservationFile);
                }
                else
                {
                    yield return("/checkobservations:" + ObservationFile);
                }

                if (ObservationMode.HasValue)
                {
                    yield return("/observationmode:" + ObservationMode.Value.ToCommandLineOptionValue());
                }
            }

            if (ContinueFromLastSchedule == true)
            {
                yield return("/continue");
            }

            if (IncludedAssemblies != null && IncludedAssemblies.Length != 0)
            {
                foreach (var val in IncludedAssemblies)
                {
                    yield return("/ia:" + val);
                }
            }

            if (FlipPreemptionSense == true)
            {
                yield return("/flippreempt");
            }
            if (DontPreemptAssemblies != null)
            {
                foreach (var val in DontPreemptAssemblies)
                {
                    yield return("/dpa:" + val);
                }
            }
            if (DontPreemptNamespaces != null)
            {
                foreach (var val in DontPreemptNamespaces)
                {
                    yield return("/dpn:" + val);
                }
            }
            if (DontPreemptTypes != null)
            {
                foreach (var val in DontPreemptTypes)
                {
                    yield return("/dpt:" + val);
                }
            }
            if (DontPreemptMethods != null)
            {
                foreach (var val in DontPreemptMethods)
                {
                    yield return("/dpm:" + val);
                }
            }

            if (EnableLogging == true)
            {
                yield return("/logging");
            }
            if (PrintDiagnosticInformation == true)
            {
                yield return("/diagnose");
            }

            if (ShowHBExecs.HasValue)
            {
                yield return("/p:show_hbexecs=" + ShowHBExecs);
            }
            if (NoPopups.HasValue)
            {
                yield return("/p:nopopups=" + NoPopups);
            }
            if (NoTime.HasValue)
            {
                yield return("/p:notime=" + NoTime);
            }

            if (ExtraCommandLineArgs != null && ExtraCommandLineArgs.Length != 0)
            {
                foreach (var arg in ExtraCommandLineArgs)
                {
                    yield return(arg);
                }
            }
        }