private static AzureBenchmarkResult PrepareBenchmarkResult(CSVRow r, AzureExperimentStorage storage, ConcurrentDictionary <string, string> uploadedOutputs, int expId, DateTime submittedTime) { var properties = new Dictionary <string, string>() { { "SAT", r.SAT.ToString() }, { "UNSAT", r.UNSAT.ToString() }, { "UNKNOWN", r.UNKNOWN.ToString() }, { "TargetSAT", r.TargetSAT.ToString() }, { "TargetUNSAT", r.TargetUNSAT.ToString() }, { "TargetUNKNOWN", r.TargetUNKNOWN.ToString() }, }; var b = new AzureBenchmarkResult { AcquireTime = submittedTime, BenchmarkFileName = r.Filename.Replace('\\', '/'), ExitCode = r.ReturnValue, ExperimentID = expId, NormalizedRuntime = r.Runtime, PeakMemorySizeMB = 0, Properties = properties, Status = ResultCodeToStatus(r.ResultCode), StdErr = r.StdErr, StdOut = r.StdOut, StdErrExtStorageIdx = "", StdOutExtStorageIdx = "", TotalProcessorTime = TimeSpan.FromSeconds(r.Runtime), WallClockTime = TimeSpan.FromSeconds(r.Runtime), }; return(b); }
private static void MonitorTasksUntilCompletion(int experimentId, string jobId, Task collectionTask, BatchClient batchClient, Domain domain) { // Monitoring tasks ODATADetailLevel fLvl = new ODATADetailLevel(domain.FailureFilter(), "id,displayName,executionInfo"); do { Console.WriteLine("Fetching failed tasks..."); var ts = batchClient.JobOperations.ListTasks(jobId, fLvl); foreach (CloudTask t in ts) { if (t == null) { Console.Error.WriteLine("improbable task == null condition."); } if (t == null) { Console.Error.WriteLine("improbable badRresults == null condition."); } else { AzureBenchmarkResult r = new AzureBenchmarkResult(); r.AcquireTime = t.ExecutionInformation.StartTime ?? DateTime.MinValue; r.BenchmarkFileName = t.DisplayName; r.ExitCode = t.ExecutionInformation.ExitCode; r.ExperimentID = experimentId; r.StdErr = InfrastructureErrorPrefix + t.ExecutionInformation.FailureInformation.Message; r.StdErrExtStorageIdx = ""; r.StdOut = ""; r.StdOutExtStorageIdx = ""; r.NormalizedCPUTime = 0; r.PeakMemorySizeMB = 0; r.Properties = new Dictionary <string, string>(); r.Status = ResultStatus.InfrastructureError; r.CPUTime = TimeSpan.Zero; r.WallClockTime = TimeSpan.Zero; badResults.Add(r);; } } Console.WriteLine("Done fetching failed tasks. Got {0}.", badResults.Count); Console.WriteLine("Fetching completed tasks..."); completedTasksCount = batchClient.JobOperations.GetJobTaskCounts(jobId).Completed; Console.WriteLine("Done fetching completed tasks. Got {0}.", completedTasksCount); }while (!collectionTask.Wait(30000)); }