コード例 #1
0
ファイル: FahLogParser.cs プロジェクト: mekinney/FAHLogInfo
        public void EndProject(int workUnitSlot, int foldingSlot, string credit)
        {
            // Add the WU to folding slot.
            FoldingSlot fs = FoldingSlots.Find(x => x.FoldingSlotNumber == foldingSlot);

            if (fs != null)
            {
                WorkUnitInfo wui = fs.EndWU(this, workUnitSlot, int.Parse(credit));

                if (wui != null)
                {
                    // Update the folding slot information
                    wui.FoldingSlot    = foldingSlot;
                    wui.GpuDescription = fs.GpuDescription;
                    wui.CudaSlot       = fs.CudaSlot;

                    WorkUnits.Add(wui);  // Save the completed wu.
                }
            }
            else
            {
                Console.WriteLine("LN:{0}:EndProject(): Can't find folding slot {1} - wu = {2} credit = {3}", LineNumber, workUnitSlot, foldingSlot, credit);
                Console.WriteLine("LN:{0}:EndProject(): This can happen early in the log file if FAH is trying to send a WU that wasn't processed at all in the log file.", LineNumber);
            }
        }
コード例 #2
0
ファイル: FahLogParser.cs プロジェクト: mekinney/FAHLogInfo
        public void NewSlot(int foldingSlot, string desc, string cudaSlot)
        {
            Console.WriteLine("LN:{2}:NewSlot(): f_slot = {0} cuda_slot {3} desc ={1}", foldingSlot, desc, LineNumber, cudaSlot);

            FoldingSlot fs = FoldingSlots.Find(x => x.FoldingSlotNumber == foldingSlot);

            // If work unit slot exists, remove it and log an error.
            if (fs != null)
            {
                if (fs.GpuDescription.Equals(desc))  // if the descriptions are equal, then don't remove the slot, assuming we're continuing.
                {
                    return;
                }

                Console.WriteLine("LN:{0}:NewSlot(): Folding Slot exists-Removing f_slot = {1} new_desc = {2} old_desc = {3}", LineNumber, foldingSlot, desc, fs.GpuDescription);
                FoldingSlots.Remove(FoldingSlots.Find(x => x.FoldingSlotNumber == foldingSlot));
            }

            FoldingSlots.Add(new FoldingSlot()
            {
                FoldingSlotNumber = foldingSlot, GpuDescription = desc, CudaSlot = cudaSlot
            });
        }