/// <summary> /// Write instruction operands into bytecode stream. /// </summary> /// <param name="writer">Bytecode writer.</param> public override void WriteOperands(WordWriter writer) { ExecutionModel.Write(writer); Value.Write(writer); Name.Write(writer); Interface.Write(writer); }
public EntryPoint(ExecutionModel executionModel, int entryPoint, string name, params int[] interfaces) { ExecutionModel = executionModel; EntryPointId = entryPoint; Name = name; Interface = interfaces; }
internal PathView(ToolView toolView, ExecutionModel executionModel) { this.ToolView = toolView; this.ExecutionModel = executionModel; this.Name = this.ComputeName(); }
public void Generate(ExecutionModel executionModel) { CoroutineHandle defaultCoroutine = _context.CoroutineManager.GetNextCoroutine(); _context.TimingManager.RegisterStopWatch(defaultCoroutine.Id); _setUp.Generate(defaultCoroutine.Id); _tearDown.Generate(defaultCoroutine.Id); switch (executionModel) { case ExecutionModel.SequentialExecution: foreach (SequenceTaskEntity sequenceModel in _sequenceEntities) { sequenceModel.Generate(defaultCoroutine.Id); } break; case ExecutionModel.ParallelExecution: CoroutineHandle coroutine = _context.CoroutineManager.GetNextCoroutine(); foreach (SequenceTaskEntity sequenceModel in _sequenceEntities) { _context.TimingManager.RegisterStopWatch(coroutine.Id); sequenceModel.Generate(coroutine.Id); } break; default: throw new ArgumentOutOfRangeException(nameof(executionModel), executionModel, null); } }
public ShanqQueryExecutor(ExecutionModel model, Stream outputStream, IVectorTypeLibrary vectorLibrary, string entryPointName) { this.model = model; this.outputStream = outputStream; this.vectorLibrary = vectorLibrary; this.entryPointName = entryPointName; }
private void OnExecutionModelFound(ExecutionModel executionModel) { if (this.foundModels.Add(executionModel)) { var pathView = new PathView(this, executionModel); this.Paths.Add(pathView); } }
private static int AdvanceHeapVersion(int heapVersion, ExecutionModel executionModel, int nodeIndex) { int nodeMaxHeapVersion = executionModel.HeapLocations[nodeIndex] .Select(l => l.HeapVersion) .DefaultIfEmpty() .Max(); return(Math.Max(heapVersion, nodeMaxHeapVersion)); }
/// <summary>Creates the commandline representation from argv</summary> public CommandLine(string[] argv) { var offset = 0; for (var i = 0; i < argv.Length; i++) { if (aliases.ContainsKey(argv[i])) { command = Activator.CreateInstance(aliases[argv[i]]) as Command; offset = ++i; break; } else if ("-cp" == argv[i]) { options["classpath"].Add(argv[++i]); offset = i + 1; } else if ("-cp?" == argv[i] || "-cp!" == argv[i]) { options["classpath"].Add(argv[i].Substring("-cp".Length) + argv[++i]); offset = i + 1; } else if ("-m" == argv[i]) { options["modules"].Add(argv[++i]); offset = i + 1; } else if ("-watch".Equals(argv[i])) { executionModel = new RunWatching(argv[++i]); offset = i + 1; } else if ("-supervise".Equals(argv[i])) { executionModel = new Supervise(); offset = i + 1; } else if (IsOption(argv[i])) { throw new ArgumentException("Unknown option `" + argv[i] + "`"); } else if (IsCommand(argv[i])) { command = AsCommand(argv[i]); offset = ++i; break; } else { command = new Commands.Run(); offset = i; break; } } arguments = new ArraySegment <string>(argv, offset, argv.Length - offset); }
public void Start(ExecutionModel execution) { ThreadPool.QueueUserWorkItem(s => { while (true) { Cycle(); } }); }
/// <summary> /// Calculate number of words to fit complete instruction bytecode. /// </summary> /// <returns>Number of words in instruction bytecode.</returns> public override uint GetWordCount() { uint wordCount = 0; wordCount += ExecutionModel.GetWordCount(); wordCount += Value.GetWordCount(); wordCount += Name.GetWordCount(); wordCount += Interface.GetWordCount(); return(wordCount); }
/// <summary> /// Construct a RenderKernelService. /// </summary> /// <param name="name"> /// A <see cref="String"/> specifying the service name. This name is used to getting service instances; since /// this information is controlled by use application too, it's better to choose well formed names, such as /// <i>Domain.ServiceName</i>. Services defined by Derm have the domain name part equals to "Derm". /// </param> /// <param name="execution"> /// A <see cref="ExecutionModel"/> which specify how to schedule execution of this RenderKernelService. /// </param> /// <exception cref="ArgumentNullException"> /// Exception thrown if <paramref name="name"/> is null. /// </exception> protected GraphicsKernelService(string name, ExecutionModel execution) { if (name == null) throw new ArgumentNullException("name"); // Store service name mServiceName = name; // Store execution model mExecutionModel = execution; }
internal unsafe ShaderModule(SpirvReflectNative.SpvReflectShaderModule module) { NativeShaderModule = module; // Convert to managed Generator = (ReflectGenerator)module.generator; EntryPointName = new string(module.entry_point_name); EntryPointId = module.entry_point_id; SourceLanguage = (SourceLanguage)module.source_language; SourceLanguageVersion = module.source_language_version; SPIRVExecutionModel = (ExecutionModel)module.spirv_execution_model; ShaderStage = (ReflectShaderStage)module.shader_stage; SourceFile = new string(module.source_file); SourceSource = new string(module.source_source); // Entry point extraction EntryPoints = new ReflectEntryPoint[module.entry_point_count]; for (int i = 0; i < module.entry_point_count; i++) { EntryPoints[i] = new ReflectEntryPoint() { Id = module.entry_points[i].id, Name = new string(module.entry_points[i].name), ShaderStage = (ReflectShaderStage)module.entry_points[i].shader_stage, SpirvExecutionModel = (ExecutionModel)module.entry_points[i].spirv_execution_model, UsedPushConstants = new uint[module.entry_points[i].used_push_constant_count], UsedUniforms = new uint[module.entry_points[i].used_uniform_count], DescriptorSets = new ReflectDescriptorSet[module.entry_points[i].descriptor_set_count] }; // Enumerate used push constants for (int j = 0; j < module.entry_points[i].used_push_constant_count; j++) { EntryPoints[i].UsedPushConstants[j] = module.entry_points[i].used_push_constants[j]; } // Enumerate used uniforms for (int j = 0; j < module.entry_points[i].used_uniform_count; j++) { EntryPoints[i].UsedUniforms[j] = module.entry_points[i].used_uniforms[j]; } // Enumerate descriptor sets for (int j = 0; j < module.entry_points[i].descriptor_set_count; j++) { var desc = module.entry_points[i].descriptor_sets[j]; EntryPoints[i].DescriptorSets[j].Set = desc.set; EntryPoints[i].DescriptorSets[j].Bindings = new ReflectDescriptorBinding[desc.binding_count]; for (int k = 0; k < desc.binding_count; k++) { EntryPoints[i].DescriptorSets[j].Bindings[k] = new ReflectDescriptorBinding(*desc.bindings[k]); } } } }
/// <summary> /// Construct a RenderKernelService. /// </summary> /// <param name="name"> /// A <see cref="String"/> specifying the service name. This name is used to getting service instances; since /// this information is controlled by use application too, it's better to choose well formed names, such as /// <i>Domain.ServiceName</i>. Services defined by Derm have the domain name part equals to "Derm". /// </param> /// <param name="execution"> /// A <see cref="ExecutionModel"/> which specify how to schedule execution of this RenderKernelService. /// </param> /// <exception cref="ArgumentNullException"> /// Exception thrown if <paramref name="name"/> is null. /// </exception> protected GraphicsKernelService(string name, ExecutionModel execution) { if (name == null) { throw new ArgumentNullException("name"); } // Store service name mServiceName = name; // Store execution model mExecutionModel = execution; }
public void AddEntryPoint(ExecutionModel executionModel, Instruction function, string name, params Instruction[] interfaces) { Debug.Assert(function.Opcode == Op.OpFunction); Instruction entryPoint = new Instruction(Op.OpEntryPoint); entryPoint.AddOperand(executionModel); entryPoint.AddOperand(function); entryPoint.AddOperand(name); entryPoint.AddOperand(interfaces); _entrypoints.Add(entryPoint); }
public void EmptyShaderReflectionTest() { byte[] vertexByteCode; byte[] framentByteCode; { var vertexShaderMain = new Function(Spv.FunctionControl.CreateNone(), new TypeFunction() { ReturnType = SpirvTypeBase.Void }, "main") .SetUp(_ => _ .ThenLabel() .ThenReturn() ); var shader = new ShaderReflection() .WithCapability(Capability.Shader()) .WithExtInstImport("GLSL.std.450") .WithMemoryModel(AddressingModel.Logical(), MemoryModel.GLSL450()) .WithEntryPoint(ExecutionModel.Vertex(), vertexShaderMain) .BuildShader(); vertexByteCode = shader.Build(); } { var fragmentShaderMain = new Function(Spv.FunctionControl.CreateNone(), new TypeFunction() { ReturnType = SpirvTypeBase.Void }, "main") .SetUp(_ => _ .ThenLabel() .ThenReturn() ); var shader = new ShaderReflection() .WithCapability(Capability.Shader()) .WithExtInstImport("GLSL.std.450") .WithMemoryModel(AddressingModel.Logical(), MemoryModel.GLSL450()) .WithEntryPoint(ExecutionModel.Fragment(), fragmentShaderMain) .BuildShader(); framentByteCode = shader .Build(); } var shaders = ResourceFactory.CreateFromSpirv( new ShaderDescription(ShaderStages.Vertex, vertexByteCode, "main"), new ShaderDescription(ShaderStages.Fragment, framentByteCode, "main")); var readRenderTargetPixel = RenderQuad(shaders); Assert.AreEqual(new RgbaByte(0, 0, 0, 255), readRenderTargetPixel); }
private void fillEventsPriorityList() { eventsPriorityListBox.Items.Clear(); if (_executionModels == null) { return; } ExecutionModel em = _executionModels.FirstOrDefault(model => model.FBTypeName == _selectedFbType); foreach (PriorityEvent pe in em.InputEventsPriorities) { eventsPriorityListBox.Items.Add(pe); } }
public EntryPoint(ExecutionModel executionModel, int id, string name, List <int> interfaceIDs = null) { ExecutionModel = executionModel; ID = id; Name = name; if (interfaceIDs == null) { InterfaceIDs = new List <int>(); } else { InterfaceIDs = interfaceIDs; } }
private static ShaderModule CreateModule <TOutput>(Device device, ExecutionModel model, Func <IShanqFactory, IQueryable <TOutput> > shaderFunction) { var shaderStream = new MemoryStream(); Create(model, shaderStream, shaderFunction); int shaderLength = (int)shaderStream.Length; var shaderBytes = shaderStream.GetBuffer(); var shaderData = LoadShaderData(shaderBytes, shaderLength); return(device.CreateShaderModule(shaderLength, shaderData)); }
/// <summary> /// Methode die beim Drücken der Enter-Taste ausgeführt wird /// </summary> /// <param name="obj"></param> private void EnterCommandExecute(object obj) { //Parser aufrufen execModel = _parser.ExecuteInput(Eingabe); //Prüfen ob während der Verarbeitung Fehler aufgetreten sind if (execModel.HasError) { //Ändern-Button nicht auswählbar EditButtonIsEnabled = false; //Text anhand der ErrorId aus der Datenbank lesen var text = DatabaseHelper.GetNotificationText(execModel.ErrorId); //Fehler in einer MessageBox anzeigen MessageBox.Show(text, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error); } else { //Während der Verabeitung sind keine Fehler aufgetreten //Prüfen ob eine Benachrichtigung angezeigt werden muss if (execModel.NotificationId != 0) { //Text anhand der NotificationId aus der Datenbank lesen var text = DatabaseHelper.GetNotificationText(execModel.NotificationId); //Benachrichtigung in einer MessageBox anzeigen MessageBox.Show(text, "Warnung", MessageBoxButton.OK, MessageBoxImage.Warning); } //Formatierer aufrufen var formattedContact = Formatter.DoFormat(execModel.Contact); //Ändern-Button auswählbar machen EditButtonIsEnabled = true; } //Prüfen ob die Eingabe nicht zuordenbare Bestandteile enthält if (execModel.SplittedInput.Count > 0) { //Nicht zuordenbare Inhalt vorhanden //Weiteres Fenster für die manuelle Zuordnung öffnen var editList = _openManuelleZuordnung(false, Visibility.Hidden); //Manuell zugeordnete Inhalte in das Model mappen _mapZurodnungToModel(editList); } else { //Alle Inhalte konnten zugeordnet werden //Anzeigen des Ergebnisses auf der Benutzeroberfläche Contact = execModel.Contact; } }
private void eventPriorityDown_Click(object sender, EventArgs e) { ExecutionModel em = _executionModels.FirstOrDefault(model => model.FBTypeName == _selectedFbType); IPriorityContainer selectedEvent = (IPriorityContainer)eventsPriorityListBox.SelectedItem; if (selectedEvent != null && selectedEvent.Priority < em.InputEventsPriorities.Max(ev => ev.Priority)) { IPriorityContainer lowerPriorityEvent = em.InputEventsPriorities.FirstOrDefault(ep => ep.Priority == selectedEvent.Priority + 1); selectedEvent.Priority++; lowerPriorityEvent.Priority--; em.SortInputEvents(); fillEventsPriorityList(); eventsPriorityListBox.SetSelected(selectedEvent.Priority, true); } }
/// <summary> /// Methode zum Erstellen der Liste für die manuelle Zuordnung /// </summary> /// <param name="execModel">Ergebnis des Parse-Vorgangs</param> /// <param name="changeContact">Wert der angibt, ob der Kontakt geändert wird (true)</param> /// <returns></returns> private List <ZuordnungModel> _createZuordnungList(ExecutionModel execModel, bool changeContact = false) { var list = new List <ZuordnungModel>(); if (changeContact) { //Kontakt wird geändert //Alle Bestandteile der Anrede in Liste speichern, um diese auf der Benutzeroberfläche anzuzeigen list.Add(new ZuordnungModel { EntryText = execModel.Contact.AnredeText, SelectedDropDownEntry = StaticHelper.Anrede }); list.Add(new ZuordnungModel { EntryText = execModel.Contact.BriefanredeText, SelectedDropDownEntry = StaticHelper.Briefanrede }); foreach (var entry in execModel.Contact.TitelList) { list.Add(new ZuordnungModel { EntryText = entry.Title, SelectedDropDownEntry = StaticHelper.Titel }); } //list.Add(new ZuordnungModel { LabelText = StaticHelper.Titel, EntryText = execModel.Contact.TitelText }); list.Add(new ZuordnungModel { EntryText = execModel.Contact.GeschlechtText, SelectedDropDownEntry = StaticHelper.Geschlecht }); list.Add(new ZuordnungModel { EntryText = execModel.Contact.Vorname, SelectedDropDownEntry = StaticHelper.Vorname }); list.Add(new ZuordnungModel { EntryText = execModel.Contact.Nachname, SelectedDropDownEntry = StaticHelper.Nachname }); } else { //Kontakt wird nicht bearbeitet //Es liegen nicht zuordenbare Inhalte vor //Lediglich diese in die Liste speichern foreach (var entry in execModel.SplittedInput) { list.Add(new ZuordnungModel { EntryText = entry }); } } return(list); }
public string TranslateCompositeFB(FBType fbType) { string smvModule = ""; ExecutionModel executionModel = _executionModels.FirstOrDefault(em => em.FBTypeName == fbType.Name); var events = _storage.Events.Where(ev => ev.FBType == fbType.Name); var variables = _storage.Variables.Where(ev => ev.FBType == fbType.Name); var instances = _storage.Instances.Where(inst => inst.FBType == fbType.Name); var withConnections = _storage.WithConnections.Where(conn => conn.FBType == fbType.Name); var connections = _storage.Connections.Where(conn => conn.FBType == fbType.Name); var instanceParameters = _storage.InstanceParameters.Where(p => p.FBType == fbType.Name); IDispatcher dispatcher = executionModel.Dispatcher; //smvModule += _moduleHeader(events, variables, fbType.Name) + "\n"; smvModule += FbSmvCommon.SmvModuleDeclaration(events, variables, fbType.Name); smvModule += CompositeFbSmv.FbInstances(instances, _storage.Events, _storage.Variables, connections, _settings) + "\n"; smvModule += CompositeFbSmv.InternalBuffersDeclaration(instances, connections, _storage.Events, _storage.Variables) + "\n"; smvModule += Smv.Assign; smvModule += CompositeFbSmv.InternalBuffersInitialization(instances, connections, _storage.Events, _storage.Variables, instanceParameters) + "\n"; if (_settings.UseProcesses) { smvModule += CompositeFbSmv.NonConnectedInstanceOutputEvents(_storage.Events, instances, connections); smvModule += CompositeFbSmv.ComponentDataOutputNextStatements(_storage.Variables, instances); } //smvModule += _moduleVariablesInitBlock(variables) + "\n"; //smvModule += _inputVariablesSampleComposite(variables, withConnections) + "\n"; smvModule += CompositeFbSmv.NonConnectedEventInputs(connections, _storage.Events, instances, _showMessage); smvModule += CompositeFbSmv.NonConnectedInputs(connections, _storage.Variables, instances); smvModule += CompositeFbSmv.InternalDataConnections(connections, withConnections, _storage.Variables, instances) + "\n"; smvModule += CompositeFbSmv.ComponentEventOutputs(connections, _settings.UseProcesses) + "\n"; //smvModule += _eventInputsResetRules(events) + "\n"; smvModule += "\n-- ---DISPATCHER--- --\n"; smvModule += "-- *************** --\n"; smvModule += dispatcher.GetSmvCode(_settings.UseProcesses) + "\n"; smvModule += CompositeFbSmv.InternalEventConnections(connections, _settings.UseProcesses) + "\n"; smvModule += CompositeFbSmv.InputEventsResetRules(events, _settings.UseProcesses); smvModule += FbSmvCommon.DefineExistsInputEvent(events) + "\n"; smvModule += CompositeFbSmv.DefineOmega(connections) + "\n"; smvModule += CompositeFbSmv.DefinePhi(instances, _storage.Events) + "\n"; //phi variable for timed models smvModule += FbSmvCommon.ModuleFooter(_settings) + "\n"; //smvModule += Smv.AlphaBetaRules; return(smvModule); }
public string TranslateBasicFB(FBType fbType, bool eventSignalResetSolve = true, bool showUnconditionalTransitions = false) { string smvModule = ""; ExecutionModel executionModel = _executionModels.FirstOrDefault(em => em.FBTypeName == fbType.Name); var events = _storage.Events.Where(ev => ev.FBType == fbType.Name); var variables = _storage.Variables.Where(ev => ev.FBType == fbType.Name); var states = _storage.EcStates.Where(ev => ev.FBType == fbType.Name); var algorithms = _storage.Algorithms.Where(alg => alg.FBType == fbType.Name && alg.Language == AlgorithmLanguages.ST); var smvAlgs = _translateAlgorithms(algorithms); var actions = _storage.EcActions.Where(act => act.FBType == fbType.Name); var withConnections = _storage.WithConnections.Where(conn => conn.FBType == fbType.Name); var transitions = _storage.EcTransitions.Where(tr => tr.FBType == fbType.Name); smvModule += BasicFbSmv.ModuleHeader(events, variables, fbType.Name); smvModule += BasicFbSmv.OsmStatesDeclaration(); smvModule += BasicFbSmv.EccStatesDeclaration(states) + "\n"; smvModule += BasicFbSmv.EcActionsCounterDeclaration(states); smvModule += BasicFbSmv.AlgStepsCounterDeclaration(smvAlgs); smvModule += Smv.Assign; smvModule += String.Format(Smv.VarInitializationBlock, Smv.EccStateVar, Smv.EccState(states.First(s => true).Name)); smvModule += String.Format(Smv.VarInitializationBlock, Smv.OsmStateVar, Smv.Osm.S0); smvModule += BasicFbSmv.ModuleVariablesInitBlock(variables) + "\n"; smvModule += String.Format(Smv.VarInitializationBlock, Smv.EcActionsCounterVar, "0"); smvModule += String.Format(Smv.VarInitializationBlock, Smv.AlgStepsCounterVar, "0"); smvModule += BasicFbSmv.EcStateChangeBlock(transitions, events); smvModule += Smv.OsmStateChangeBlock + "\n"; smvModule += BasicFbSmv.EcActionsCounterChangeBlock(states) + "\n"; smvModule += BasicFbSmv.AlgStepsCounterChangeBlock(states, actions, smvAlgs) + "\n"; smvModule += BasicFbSmv.InputVariablesSampleBasic(variables, withConnections) + "\n"; smvModule += BasicFbSmv.OutputVariablesChangingRules(variables, actions, _storage.AlgorithmLines.Where(line => line.FBType == fbType.Name), _settings) + "\n"; smvModule += BasicFbSmv.SetOutputVarBuffers(variables, events, actions, withConnections, _showMessage) + "\n"; smvModule += BasicFbSmv.SetServiceSignals(_settings.UseProcesses) + "\n"; smvModule += BasicFbSmv.EventInputsResetRules(events, executionModel, eventSignalResetSolve, _settings.UseProcesses) + "\n"; smvModule += BasicFbSmv.OutputEventsSettingRules(events, actions, _settings.UseProcesses) + "\n"; smvModule += BasicFbSmv.BasicModuleDefines(states, events, transitions, showUnconditionalTransitions) + "\n"; smvModule += FbSmvCommon.ModuleFooter(_settings) + "\n"; return(smvModule); }
private async Task ExecuteSubmission(SubmisionDto submision, string _executionApi) { var client = new HttpClient(); var executionModel = new ExecutionModel { MemoryLimit = submision.MemoryLimit, ProblemName = submision.ProblemName, UserName = submision.UserName, TimeLimit = submision.TimeLimit, Compilator = submision.Compilator, FileName = submision.FileName, NumberOfTests = submision.NumberOfTests }; var serializedExecutionData = JsonConvert.SerializeObject(executionModel); var httpContentExecution = new StringContent(serializedExecutionData, Encoding.UTF8, "application/json"); var responseExecution = await client.PostAsync(_executionApi, httpContentExecution); if (responseExecution.StatusCode == System.Net.HttpStatusCode.OK) { var resultExecution = await responseExecution.Content.ReadAsStringAsync(); var responseExecutionModels = DeserializeExecutionResponse(resultExecution); var serializedData = _serializeTests.SerializeReponseTest(responseExecutionModels); //save in db the serializedData var evaluationModel = new Evaluation { EvaluationId = Guid.NewGuid(), EvaluationResult = serializedData.Item1, Score = serializedData.Item2, SubmisionId = submision.SubmissionId }; await _evaluationRepository.AddAsync(evaluationModel); UpdateSubmissionStatus(submision.SubmissionId, SubmissionStatus.Executed, string.Empty, serializedData.Item2); //notify with signalR await NotifyResponse(MessageType.ExecutionMessage, SubmissionStatus.Executed.ToString(), submision.SubmissionId.ToString(), serializedData.Item2.ToString()); var x = 2; } else { //server error UpdateSubmissionStatus(submision.SubmissionId, SubmissionStatus.ServerError, responseExecution.ReasonPhrase, 0); } }
protected virtual string ReplaceMacro(string value, ExecutionModel exmodel) { try { return(Regex.Replace(value, @"{(?<exp>[^}]+)}", match => { var p = Expression.Parameter(typeof(ExecutionModel), "exmodel"); var e = DynamicExpressionParser.ParseLambda(new[] { p }, null, match.Groups["exp"].Value); // var e = DynamicExpression.ParseLambda(new[] { p }, null, match.Groups["exp"].Value); return (e.Compile().DynamicInvoke(exmodel) ?? "").ToString(); })); } catch (Exception ex) { return(value); } }
public static string EventInputsResetRules(IEnumerable <Event> events, ExecutionModel executionModel, bool eventSignalResetSolve, bool useProcesses) { string rules = ""; string commonResetRule = Smv.OsmStateVar + "=" + Smv.Osm.S1; if (!eventSignalResetSolve) { commonResetRule += " & " + Smv.ExistsEnabledEcTran; } string priorityResetRule = ""; const string setValue = " : {0};\n"; foreach (PriorityEvent ev in executionModel.InputEventsPriorities /*events.Where(ev => ev.Direction == Direction.Input)*/) { if (priorityResetRule == "") { string rule = "\t" + commonResetRule; if (useProcesses) { rules += String.Format(Smv.NextCaseBlock, Smv.ModuleParameters.Event(ev.Value.Name), rule + String.Format(setValue, Smv.False)); } else { rules += String.Format(Smv.DefineBlock, Smv.ModuleParameters.Event(ev.Value.Name) + "_reset", rule); } } else { string rule = String.Format("\t({0} & ({1})) | ({2})", Smv.Alpha, priorityResetRule.Trim(Smv.OrTrimChars), commonResetRule); if (useProcesses) { rules += String.Format(Smv.NextCaseBlock, Smv.ModuleParameters.Event(ev.Value.Name), rule + String.Format(setValue, Smv.False)); } else { rules += String.Format(Smv.DefineBlock, Smv.ModuleParameters.Event(ev.Value.Name) + "_reset", rule); } } priorityResetRule += Smv.ModuleParameters.Event(ev.Value.Name) + " | "; } return(rules); }
private MethodFlowView ProcessCallee(ExecutionModel executionModel, int callNodeIndex, int heapVersion) { int nestedLevel = 0; int startIndex = callNodeIndex + 1; int endIndex; int startHeapVersion = heapVersion; for (int j = startIndex; j <= this.endIndex; j++) { heapVersion = AdvanceHeapVersion(heapVersion, executionModel, j); var calleeflowNode = executionModel.PathNodes[j]; if (calleeflowNode is EnterFlowNode) { // Method call; notice that this must happen on the first iteration (when j == calleeStart) nestedLevel++; } else if (calleeflowNode is ReturnFlowNode) { // Returning from a method nestedLevel--; if (nestedLevel == 0) { // Produce method called from the original call node endIndex = j; var callee = this.AddCallee(startIndex, endIndex, startHeapVersion, heapVersion); // Update i to correspond to the second part of the call node (stored in flowNode) callNodeIndex = endIndex + 1; return(callee); } } } Contract.Assert(nestedLevel != 0); // The execution model ends in the called function, so just display the call in this method endIndex = this.endIndex; return(this.AddCallee(startIndex, endIndex, startHeapVersion, heapVersion)); }
// POST api/<controller> public JsonResult Post([FromBody] ExecutionModel item) { if (ModelState.IsValid) { var lstExecutionResponse = _executeFile.Execute(item.ProblemName, item.UserName, item.Compilator, item.TimeLimit, item.MemoryLimit, item.FileName, item.NumberOfTests); var lst = new List <ResponseExecutionModel>(); foreach (var itemRsp in lstExecutionResponse) { lst.Add(new ResponseExecutionModel { ExecutionResults = itemRsp.Item1, ExecutionStatus = itemRsp.Item2 }); } return(Json(lst)); } return(Json("Failed response")); }
public static List <ExecutionModel> Generate(FBClassParcer parcer, bool solveDispatchingProblem) { List <ExecutionModel> outList = new List <ExecutionModel>(); foreach (FBType fbType in parcer.Storage.Types) { ExecutionModel em = new ExecutionModel(fbType.Name); int basicPriority = 0; foreach (Event ev in parcer.Storage.Events.Where(ev => ev.FBType == fbType.Name && ev.Direction == Direction.Input)) { em.AddInputPriorityEvent(new PriorityEvent(basicPriority++, ev)); } if (fbType.Type == FBClass.Composite) { //create dispatcher IEnumerable <FBInstance> curFbInstances = parcer.Storage.Instances.Where((inst) => inst.FBType == fbType.Name); em.Dispatcher = new CyclicDispatcher(fbType.Name, curFbInstances, solveDispatchingProblem); } outList.Add(em); } return(outList); }
public ShanqQueryExecutor(ExecutionModel model, Stream outputStream) { this.model = model; this.outputStream = outputStream; }
/// <summary> /// Determine whether a specific execution model is supported. /// </summary> /// <param name="model"> /// A <see cref="ExecutionModel"/> to test for support. /// </param> /// <returns> /// It returns a boolean value indicating whether this GraphicsContextService can change its execution model to the one /// specified by <paramref name="model"/>. The current implementation returns true only if <paramref name="model"/> /// equals to the one specified at construction time (this is done to follow method semantic, instead of returning /// always false or throwing NotImplementedException). /// </returns> /// <remarks> /// <para> /// Normally, an execution model is dependent on the service task. If a service doesn't requires a current OpenGL context /// sharing with the main OpenGL context (created by <see cref="RenderKernel"/>), there's no problem about the execution /// of the service. But if a service really requires a current OpenGL context sharing with the main OpenGL context (i.e. /// a Texture generation service), normally it requires the execution model <see cref="ExecutionModel.MultithreadContext"/>. /// </para> /// <para> /// Setting the execution model to <see cref="ExecutionModel.MultithreadContext"/> could lead to exceptions (caused by /// not sufficient system resources, incompatibility between OpenGL contextes or missing platform support). In the case /// an exception is caught, there are possibilities for the service to accomplish its task even if it is not possible /// to have a current OpenGL context. /// </para> /// <para> /// The first option would be the service execution change into <see cref="ExecutionModel.MultithreadMixed"/>. This would /// imply additional synchronization between the separated thread and the main thread executing this service. This option /// shall be selected by those services which can execute long-time tasks without requiring a current context, and apply /// task result reasonably fast. /// </para> /// <para> /// The second option would be the service execution change into <see cref="ExecutionModel.Context"/>. This would imply /// the loose of all advantages offered by multithreading, but it is a secure fallback execution model. /// </para> /// </remarks> protected virtual bool IsExecutionModelSupported(ExecutionModel model) { return(model == mExecutionModel); }
/// <summary> /// Determine whether a specific execution model is supported. /// </summary> /// <param name="model"> /// A <see cref="ExecutionModel"/> to test for support. /// </param> /// <returns> /// It returns a boolean value indicating whether this GraphicsContextService can change its execution model to the one /// specified by <paramref name="model"/>. The current implementation returns true only if <paramref name="model"/> /// equals to the one specified at construction time (this is done to follow method semantic, instead of returning /// always false or throwing NotImplementedException). /// </returns> /// <remarks> /// <para> /// Normally, an execution model is dependent on the service task. If a service doesn't requires a current OpenGL context /// sharing with the main OpenGL context (created by <see cref="RenderKernel"/>), there's no problem about the execution /// of the service. But if a service really requires a current OpenGL context sharing with the main OpenGL context (i.e. /// a Texture generation service), normally it requires the execution model <see cref="ExecutionModel.MultithreadContext"/>. /// </para> /// <para> /// Setting the execution model to <see cref="ExecutionModel.MultithreadContext"/> could lead to exceptions (caused by /// not sufficient system resources, incompatibility between OpenGL contextes or missing platform support). In the case /// an exception is caught, there are possibilities for the service to accomplish its task even if it is not possible /// to have a current OpenGL context. /// </para> /// <para> /// The first option would be the service execution change into <see cref="ExecutionModel.MultithreadMixed"/>. This would /// imply additional synchronization between the separated thread and the main thread executing this service. This option /// shall be selected by those services which can execute long-time tasks without requiring a current context, and apply /// task result reasonably fast. /// </para> /// <para> /// The second option would be the service execution change into <see cref="ExecutionModel.Context"/>. This would imply /// the loose of all advantages offered by multithreading, but it is a secure fallback execution model. /// </para> /// </remarks> protected virtual bool IsExecutionModelSupported(ExecutionModel model) { return (model == mExecutionModel); }