/*private void resolveOper(String compId) { * * ArchComponent archComponent = HPCStormObjectRepository * .getWorkflowEngine().getArchComponentByID( * Integer.parseInt(compId)); * System.out.println("wait resolve=> archComponent: ["+archComponent.getId()+"]" + archComponent.getName()); * * }*/ private void computeOper(String handle_id) { /*ArchAction archAction = HPCStormObjectRepository.getWorkflowEngine() * .getArchActionId(Integer.parseInt(actionId)); * System.out.println("wait compute=> archAction: ["+archAction.getId()+"]" + archAction.getName()); */ CertifierConsoleLogger.write("wait compute => " + "handleId " + handle_id); LogicActionCompute l = null; if (!Certifier.ComputeActions.ContainsKey(handle_id)) { CertifierConsoleLogger.write("Fatal Error: Waiting for inexistent handleid. handle_id: " + handle_id); System.Environment.Exit(0); } else { l = (LogicActionCompute)Certifier.ComputeActions[handle_id]; } l._thread.Join(); //System.out.println("ACTION! " + "prove "+ actionId); }
/*private void resolveOper(String compId) { * * ArchComponent archComponent = HPCStormObjectRepository * .getWorkflowEngine().getArchComponentByID( * Integer.parseInt(compId)); * System.out.println("invoke resolve=> archComponent: ["+archComponent.getId()+"]" + archComponent.getName()); * * }*/ private void computeOper(String compId, string portId, string actionId) { /*ArchAction archAction = HPCStormObjectRepository.getWorkflowEngine() * .getArchActionId(Integer.parseInt(actionId)); * System.out.println("invoke compute=> archAction: ["+archAction.getId()+"]" + archAction.getName()); * */string handle_fake = "handle perform " + compId + " " + portId + " " + actionId; CertifierConsoleLogger.write("perform compute => " + "CompID " + compId + " portId " + portId + " actId " + actionId); LogicActionCompute l; // if(!Certifier.ComputeActions.ContainsKey(handle_fake)){ //if (compId.Equals("79")){ // call alt-ergo l = new LogicActionCompute(compId, portId, actionId, handle_fake); // else{// call z3 // l = new LogicActionCompute(compId, actionId, Certifier.tacticalCommand2); // } Certifier.ComputeActions.TryAdd(handle_fake, l); /* }else{ * l= (LogicActionCompute)Certifier.ComputeActions[compId]; * * } * */ l.run(); }
/*private void resolveOper(String compId){ * * ArchComponent archComponent = HPCStormObjectRepository.getWorkflowEngine().getArchComponentByID(Integer.parseInt(compId)); * System.out.println("start resolve=> archComponent: ["+archComponent.getId()+"]" + archComponent.getName()); * * }*/ private void computeOper(String compId, string port_id, string action_id, string handle_id) { /* ArchAction archAction = HPCStormObjectRepository.getWorkflowEngine().getArchActionId(Integer.parseInt(actionId)); * System.out.println("start compute=> archAction: ["+archAction.getId()+"]" + archAction.getName()); */ CertifierConsoleLogger.write("start compute => " + " CompID " + compId + " portid " + port_id + "actionId " + action_id); LogicActionCompute l; if (!Certifier.ComputeActions.ContainsKey(compId)) { //if (compId.Equals("1")){// call alt-ergo l = new LogicActionCompute(compId, port_id, action_id, handle_id); //else{// call z3 // l = new LogicActionCompute(compId, action_id, Certifier.tacticalCommand2); // } Certifier.ComputeActions.TryAdd(compId, l); } else { l = (LogicActionCompute)Certifier.ComputeActions[compId]; CertifierConsoleLogger.write("Action already exists. Waiting for it to finish in order to create a new one."); l._thread.Join(); CertifierConsoleLogger.write("Previous action finished! Creating a new one."); // if (compId.Equals("1")){ // call alt-ergo l = new LogicActionCompute(compId, port_id, action_id, handle_id); // else{// call z3 // l = new LogicActionCompute(compId, action_id, Certifier.tacticalCommand2); // } Certifier.ComputeActions.TryUpdate(compId, l, Certifier.ComputeActions[compId]); } l.start(); /*TacticInvoker ti = new TacticInvoker(Certifier.tacticalCommand); * Thread t = new Thread(ti); * t.start();*/ /*try { * t.Join(); * } catch (InterruptedException e) { * // TODO Auto-generated catch block * e.printStackTrace(); * }*/ /*TacticInvoker t1 = new TacticInvoker(Certifier.tacticalCommand); * t1.start();*/ //System.out.println("ACTION! " + "prove "+ actionId); }
/* private void resolveOper(String compId) { * * ArchComponent archComponent = HPCStormObjectRepository * .getWorkflowEngine().getArchComponentByID( * Integer.parseInt(compId)); * System.out.println("ACTION: " + archComponent); * * }*/ private void computeOper(String handle_id) { /*ArchAction archAction = HPCStormObjectRepository.getWorkflowEngine() * .getArchActionId(Integer.parseInt(actionId)); * System.out.println("ACTION: " + archAction);*/ CertifierConsoleLogger.write("cancel compute " + "handle_id " + handle_id); LogicActionCompute l = null; if (!Certifier.ComputeActions.ContainsKey(handle_id)) { CertifierConsoleLogger.write("Fatal Error: Cancelling inexistent handle_id: handle_id " + handle_id); System.Environment.Exit(0); } else { l = (LogicActionCompute)Certifier.ComputeActions[handle_id]; } l._thread.Interrupt(); }