public void OnBenchmarkComplete(bool success, string status) { if (!_benchmarkForm.InBenchmark) { return; } var rebenchSame = false; var power = _powerHelper.Stop(); var dualAlgo = _currentAlgorithm as DualAlgorithm; if (dualAlgo != null && dualAlgo.TuningEnabled) { dualAlgo.SetPowerForCurrent(power); if (dualAlgo.IncrementToNextEmptyIntensity()) { rebenchSame = true; } } else { _currentAlgorithm.PowerUsage = power; } if (!rebenchSame) { _benchmarkForm.RemoveFromStatusCheck(Device, _currentAlgorithm); } if (!success && !rebenchSame) { // add new failed list _benchmarkFailedAlgo.Add(_currentAlgorithm.AlgorithmName); _benchmarkForm.SetCurrentStatus(Device, _currentAlgorithm, status); } else if (!rebenchSame) { // set status to empty string it will return speed _currentAlgorithm.ClearBenchmarkPending(); _benchmarkForm.SetCurrentStatus(Device, _currentAlgorithm, ""); } if (rebenchSame) { _powerHelper.Start(); if (dualAlgo != null && dualAlgo.TuningEnabled) { var time = ConfigManager.GeneralConfig.BenchmarkTimeLimits .GetBenchamrktime(_performanceType, Device.DeviceGroupType); _currentMiner.BenchmarkStart(time, this); } } else { NextBenchmark(); } }
public void OnBenchmarkComplete(bool success, string status) { if (!_benchmarkForm.InBenchmark) { return; } var rebenchSame = false; if (success && _cpuBenchmarkStatus != null && _cpuAlgos.Contains(_currentAlgorithm.NiceHashID) && _currentAlgorithm.MinerBaseType == MinerBaseType.XmrStak) { _cpuBenchmarkStatus.SetNextSpeed(_currentAlgorithm.BenchmarkSpeed); rebenchSame = _cpuBenchmarkStatus.HasTest(); _currentAlgorithm.LessThreads = _cpuBenchmarkStatus.LessTreads; if (rebenchSame == false) { _cpuBenchmarkStatus.FindFastest(); _currentAlgorithm.BenchmarkSpeed = _cpuBenchmarkStatus.GetBestSpeed(); _currentAlgorithm.LessThreads = _cpuBenchmarkStatus.GetLessThreads(); } } if (_claymoreZcashStatus != null && _currentAlgorithm.MinerBaseType == MinerBaseType.Claymore && _currentAlgorithm.NiceHashID == AlgorithmType.Equihash) { if (_claymoreZcashStatus.HasTest()) { _currentMiner = MinerFactory.CreateMiner(Device, _currentAlgorithm); rebenchSame = true; //System.Threading.Thread.Sleep(1000*60*5); _claymoreZcashStatus.SetSpeed(_currentAlgorithm.BenchmarkSpeed); _claymoreZcashStatus.SetNext(); _currentAlgorithm.ExtraLaunchParameters = _claymoreZcashStatus.GetTestExtraParams(); Helpers.ConsolePrint("ClaymoreAMD_Equihash", _currentAlgorithm.ExtraLaunchParameters); _currentMiner.InitBenchmarkSetup(new MiningPair(Device, _currentAlgorithm)); } if (_claymoreZcashStatus.HasTest() == false) { rebenchSame = false; // set fastest mode _currentAlgorithm.BenchmarkSpeed = _claymoreZcashStatus.GetFastestTime(); _currentAlgorithm.ExtraLaunchParameters = _claymoreZcashStatus.GetFastestExtraParams(); } } var power = _powerHelper.Stop(); var dualAlgo = _currentAlgorithm as DualAlgorithm; if (dualAlgo != null && dualAlgo.TuningEnabled) { dualAlgo.SetPowerForCurrent(power); if (dualAlgo.IncrementToNextEmptyIntensity()) { rebenchSame = true; } } else { _currentAlgorithm.PowerUsage = power; } if (!rebenchSame) { _benchmarkForm.RemoveFromStatusCheck(Device, _currentAlgorithm); } if (!success && !rebenchSame) { // add new failed list _benchmarkFailedAlgo.Add(_currentAlgorithm.AlgorithmName); _benchmarkForm.SetCurrentStatus(Device, _currentAlgorithm, status); } else if (!rebenchSame) { // set status to empty string it will return speed _currentAlgorithm.ClearBenchmarkPending(); _benchmarkForm.SetCurrentStatus(Device, _currentAlgorithm, ""); } if (rebenchSame) { _powerHelper.Start(); if (_cpuBenchmarkStatus != null) { _currentMiner.BenchmarkStart(_cpuBenchmarkStatus.Time, this); } else if (_claymoreZcashStatus != null) { _currentMiner.BenchmarkStart(_claymoreZcashStatus.Time, this); } else if (dualAlgo != null && dualAlgo.TuningEnabled) { var time = ConfigManager.GeneralConfig.BenchmarkTimeLimits .GetBenchamrktime(_performanceType, Device.DeviceGroupType); _currentMiner.BenchmarkStart(time, this); } } else { NextBenchmark(); } }
void NextBenchmark() { if (_bechmarkCurrentIndex > -1) { StepUpBenchmarkStepProgress(); } ++_bechmarkCurrentIndex; if (_bechmarkCurrentIndex >= _benchmarkAlgorithmsCount) { EndBenchmark(); return; } Tuple <ComputeDevice, Queue <Algorithm> > currentDeviceAlgosTuple; Queue <Algorithm> algorithmBenchmarkQueue; while (_benchmarkDevicesAlgorithmQueue.Count > 0) { currentDeviceAlgosTuple = _benchmarkDevicesAlgorithmQueue[0]; _currentDevice = currentDeviceAlgosTuple.Item1; algorithmBenchmarkQueue = currentDeviceAlgosTuple.Item2; if (algorithmBenchmarkQueue.Count != 0) { _currentAlgorithm = algorithmBenchmarkQueue.Dequeue(); break; } else { _benchmarkDevicesAlgorithmQueue.RemoveAt(0); } } if (_currentDevice != null && _currentAlgorithm != null) { _currentMiner = MinersManager.CreateMiner(_currentDevice, _currentAlgorithm); if (_currentDevice.DeviceType == DeviceType.CPU && string.IsNullOrEmpty(_currentAlgorithm.ExtraLaunchParameters)) { __CPUBenchmarkStatus = new CPUBenchmarkStatus(); _currentAlgorithm.LessThreads = __CPUBenchmarkStatus.LessTreads; } else { __CPUBenchmarkStatus = null; } } if (_currentMiner != null && _currentAlgorithm != null) { _benchmarkMiners.Add(_currentMiner); CurrentAlgoName = AlgorithmNiceHashNames.GetName(_currentAlgorithm.NiceHashID); _currentMiner.InitBenchmarkSetup(new MiningPair(_currentDevice, _currentAlgorithm)); var time = ConfigManager.GeneralConfig.BenchmarkTimeLimits .GetBenchamrktime(benchmarkOptions1.PerformanceType, _currentDevice.DeviceGroupType); //currentConfig.TimeLimit = time; if (__CPUBenchmarkStatus != null) { __CPUBenchmarkStatus.Time = time; } // dagger about 4 minutes var showWaitTime = _currentAlgorithm.NiceHashID == AlgorithmType.DaggerHashimoto ? 4 * 60 : time; dotCount = 0; _benchmarkingTimer.Start(); _currentMiner.BenchmarkStart(time, this); algorithmsListView1.SetSpeedStatus(_currentDevice, _currentAlgorithm.NiceHashID, getDotsWaitString()); } else { NextBenchmark(); } }
void NextBenchmark() { if (_bechmarkCurrentIndex > -1) { StepUpBenchmarkStepProgress(); } ++_bechmarkCurrentIndex; if (_bechmarkCurrentIndex >= _benchmarkAlgorithmsCount) { EndBenchmark(); return; } Tuple <ComputeDevice, Queue <Algorithm> > currentDeviceAlgosTuple; Queue <Algorithm> algorithmBenchmarkQueue; while (_benchmarkDevicesAlgorithmQueue.Count > 0) { currentDeviceAlgosTuple = _benchmarkDevicesAlgorithmQueue[0]; _currentDevice = currentDeviceAlgosTuple.Item1; algorithmBenchmarkQueue = currentDeviceAlgosTuple.Item2; if (algorithmBenchmarkQueue.Count != 0) { _currentAlgorithm = algorithmBenchmarkQueue.Dequeue(); break; } else { _benchmarkDevicesAlgorithmQueue.RemoveAt(0); } } var currentConfig = _currentDevice.DeviceBenchmarkConfig; if (_currentDevice.DeviceGroupType == DeviceGroupType.CPU) { _currentMiner = MinersManager.GetCpuMiner(_currentDevice.Group); } else { _currentMiner = MinersManager.CreateMiner(currentConfig.DeviceGroupType, _currentAlgorithm.NiceHashID); } if (_currentMiner != null && _currentAlgorithm != null) { _benchmarkMiners.Add(_currentMiner); CurrentAlgoName = AlgorithmNiceHashNames.GetName(_currentAlgorithm.NiceHashID); // this has no effect for CPU miners _currentMiner.SetCDevs(new string[] { _currentDevice.UUID }); var time = ConfigManager.Instance.GeneralConfig.BenchmarkTimeLimits .GetBenchamrktime(benchmarkOptions1.PerformanceType, _currentDevice.DeviceGroupType); //currentConfig.TimeLimit = time; // dagger about 4 minutes var showWaitTime = _currentAlgorithm.NiceHashID == AlgorithmType.DaggerHashimoto ? 4 * 60 : time; dotCount = 0; _benchmarkingTimer.Start(); _currentMiner.BenchmarkStart(_currentDevice, _currentAlgorithm, time, this); algorithmsListView1.SetSpeedStatus(_currentDevice, _currentAlgorithm.NiceHashID, getDotsWaitString()); } else { NextBenchmark(); } }
private void NextBenchmark() { if (_bechmarkCurrentIndex > -1) { StepUpBenchmarkStepProgress(); } ++_bechmarkCurrentIndex; if (_bechmarkCurrentIndex >= _benchmarkAlgorithmsCount) { EndBenchmark(); return; } while (_benchmarkDevicesAlgorithmQueue.Count > 0) { var currentDeviceAlgosTuple = _benchmarkDevicesAlgorithmQueue[0]; _currentDevice = currentDeviceAlgosTuple.Item1; var algorithmBenchmarkQueue = currentDeviceAlgosTuple.Item2; if (algorithmBenchmarkQueue.Count != 0) { _currentAlgorithm = algorithmBenchmarkQueue.Dequeue(); break; } _benchmarkDevicesAlgorithmQueue.RemoveAt(0); } if (_currentDevice != null && _currentAlgorithm != null) { _currentMiner = MinerFactory.CreateMiner(_currentDevice, _currentAlgorithm); if (_currentAlgorithm.MinerBaseType == MinerBaseType.XmrStackCPU && _currentAlgorithm.NiceHashID == AlgorithmType.CryptoNight && string.IsNullOrEmpty(_currentAlgorithm.ExtraLaunchParameters) && _currentAlgorithm.ExtraLaunchParameters.Contains("enable_ht=true") == false) { _cpuBenchmarkStatus = new CpuBenchmarkStatus(Globals.ThreadsPerCpu); _currentAlgorithm.LessThreads = _cpuBenchmarkStatus.LessTreads; } else { _cpuBenchmarkStatus = null; } if (_currentAlgorithm.MinerBaseType == MinerBaseType.Claymore && _currentAlgorithm.NiceHashID == AlgorithmType.Equihash && _currentAlgorithm.ExtraLaunchParameters != null && !_currentAlgorithm.ExtraLaunchParameters.Contains("-asm")) { _claymoreZcashStatus = new ClaymoreZcashStatus(_currentAlgorithm.ExtraLaunchParameters); _currentAlgorithm.ExtraLaunchParameters = _claymoreZcashStatus.GetTestExtraParams(); } else { _claymoreZcashStatus = null; } } if (_currentMiner != null && _currentAlgorithm != null) { _benchmarkMiners.Add(_currentMiner); _currentAlgoName = AlgorithmNiceHashNames.GetName(_currentAlgorithm.NiceHashID); _currentMiner.InitBenchmarkSetup(new MiningPair(_currentDevice, _currentAlgorithm)); if (_currentDevice != null) { var time = ConfigManager.GeneralConfig.BenchmarkTimeLimits .GetBenchamrktime(benchmarkOptions1.PerformanceType, _currentDevice.DeviceGroupType); //currentConfig.TimeLimit = time; if (_cpuBenchmarkStatus != null) { _cpuBenchmarkStatus.Time = time; } if (_claymoreZcashStatus != null) { _claymoreZcashStatus.Time = time; } // dagger about 4 minutes var showWaitTime = _currentAlgorithm.NiceHashID == AlgorithmType.DaggerHashimoto ? 4 * 60 : time; _dotCount = 0; _benchmarkingTimer.Start(); _currentMiner.BenchmarkStart(time, this); } algorithmsListView1.SetSpeedStatus(_currentDevice, _currentAlgorithm, GetDotsWaitString()); } else { NextBenchmark(); } }
void NextBenchmark() { ++_bechmarkCurrentIndex; if (_bechmarkCurrentIndex >= _benchmarkAlgorithmsCount) { EndBenchmark(); return; } Tuple <ComputeDevice, Queue <Algorithm> > currentDeviceAlgosTuple; Queue <Algorithm> algorithmBenchmarkQueue; while (_benchmarkDevicesAlgorithmQueue.Count > 0) { currentDeviceAlgosTuple = _benchmarkDevicesAlgorithmQueue[0]; _currentDevice = currentDeviceAlgosTuple.Item1; algorithmBenchmarkQueue = currentDeviceAlgosTuple.Item2; if (algorithmBenchmarkQueue.Count != 0) { _currentAlgorithm = algorithmBenchmarkQueue.Dequeue(); break; } else { _benchmarkDevicesAlgorithmQueue.RemoveAt(0); } } if (_currentDevice != null && _currentAlgorithm != null) { _currentMiner = MinerFactory.CreateMiner(_currentDevice, _currentAlgorithm); if (_currentAlgorithm.MinerBaseType == MinerBaseType.XmrStackCPU && _currentAlgorithm.NiceHashID == AlgorithmType.CryptoNight && string.IsNullOrEmpty(_currentAlgorithm.ExtraLaunchParameters) && _currentAlgorithm.ExtraLaunchParameters.Contains("enable_ht=true") == false) { __CPUBenchmarkStatus = new CPUBenchmarkStatus(Globals.ThreadsPerCPU); _currentAlgorithm.LessThreads = __CPUBenchmarkStatus.LessTreads; } else { __CPUBenchmarkStatus = null; } if (_currentAlgorithm.MinerBaseType == MinerBaseType.ClaymoreAMD && _currentAlgorithm.NiceHashID == AlgorithmType.Equihash && _currentAlgorithm.ExtraLaunchParameters != null && !_currentAlgorithm.ExtraLaunchParameters.Contains("-asm")) { __ClaymoreZcashStatus = new ClaymoreZcashStatus(_currentAlgorithm.ExtraLaunchParameters); _currentAlgorithm.ExtraLaunchParameters = __ClaymoreZcashStatus.GetTestExtraParams(); } else { __ClaymoreZcashStatus = null; } } if (_currentMiner != null && _currentAlgorithm != null) { _benchmarkMiners.Add(_currentMiner); CurrentAlgoName = AlgorithmNiceHashNames.GetName(_currentAlgorithm.NiceHashID); _currentMiner.InitBenchmarkSetup(new MiningPair(_currentDevice, _currentAlgorithm)); var time = ConfigManager.GeneralConfig.BenchmarkTimeLimits .GetBenchamrktime(BenchmarkPerformanceType.Quick, _currentDevice.DeviceGroupType); //currentConfig.TimeLimit = time; if (__CPUBenchmarkStatus != null) { __CPUBenchmarkStatus.Time = time; } if (__ClaymoreZcashStatus != null) { __ClaymoreZcashStatus.Time = time; } // dagger about 4 minutes var showWaitTime = _currentAlgorithm.NiceHashID == AlgorithmType.DaggerHashimoto ? 4 * 60 : time; // dotCount = 0; //_benchmarkingTimer.Start(); _currentMiner.BenchmarkStart(time, this); } else { NextBenchmark(); } }