Browse Source

Fixed unnecessary long sleep

Yentl Van Tendeloo 7 years ago
parent
commit
638821432f

BIN
bootstrap/bootstrap.m.gz


+ 8 - 1
bootstrap/core_algorithm.alc

@@ -14,6 +14,7 @@ include "conformance_finding.alh"
 include "typing.alh"
 include "typing.alh"
 include "compiler.alh"
 include "compiler.alh"
 include "random.alh"
 include "random.alh"
+include "io.alh"
 
 
 String core_model_location = "models/core"
 String core_model_location = "models/core"
 
 
@@ -853,7 +854,10 @@ Void function enact_PM_activity(activity_to_task : Element, task_to_result : Ele
 	result = enact_action(pm, element, mapping)
 	result = enact_action(pm, element, mapping)
 	dict_add_fast(task_to_result, get_taskname(), result)
 	dict_add_fast(task_to_result, get_taskname(), result)
 	log("Finished task for activity " + cast_string(read_attribute(pm, element, "name")))
 	log("Finished task for activity " + cast_string(read_attribute(pm, element, "name")))
-	sleep(50)
+
+	while (other_has_output(get_taskname())):
+		sleep(1)
+
 	return!
 	return!
 
 
 Void function enact_PM(pm : Element, mapping : Element):
 Void function enact_PM(pm : Element, mapping : Element):
@@ -1427,6 +1431,9 @@ Void function spawn_activity(returnvalue : Element, transformation_id : String,
 		log("SUCCESS")
 		log("SUCCESS")
 		output("Success")
 		output("Success")
 
 
+	while (other_has_output(get_taskname())):
+		sleep(1)
+
 	return!
 	return!
 
 
 String function cmd_transformation_execute(transformation_name : String, source_models : Element, target_models : Element, tracability_name : String):
 String function cmd_transformation_execute(transformation_name : String, source_models : Element, target_models : Element, tracability_name : String):

+ 0 - 4
bootstrap/semi_primitives.alc

@@ -520,9 +520,6 @@ String function spawn(function : Element, arguments : Element):
 	// Additionally, we copy over all globals that we previously had
 	// Additionally, we copy over all globals that we previously had
 	dict_add_fast(task_root, "globals", dict_copy(root[get_taskname()]["globals"]))
 	dict_add_fast(task_root, "globals", dict_copy(root[get_taskname()]["globals"]))
 
 
-	log("Setting IP to " + cast_value(function["body"]))
-	log("Has outputs: " + set_to_string(dict_keys(function)))
-
 	if (dict_in(function, "params")):
 	if (dict_in(function, "params")):
 		// And add the arguments to the symbol table
 		// And add the arguments to the symbol table
 		Element symbols
 		Element symbols
@@ -542,7 +539,6 @@ String function spawn(function : Element, arguments : Element):
 			dict_add(entry, "value", list_pop(arguments, 0))
 			dict_add(entry, "value", list_pop(arguments, 0))
 			t = create_edge(symbols, entry)
 			t = create_edge(symbols, entry)
 			create_edge(t, param_dict[string_get(arg_names_call, arg_i)])
 			create_edge(t, param_dict[string_get(arg_names_call, arg_i)])
-			log("Adding to symbols: " + cast_value(string_get(arg_names_call, arg_i)))
 			arg_i = arg_i + 1
 			arg_i = arg_i + 1
 
 
 	// Add this only at the end, as otherwise the task will already be detected and executed
 	// Add this only at the end, as otherwise the task will already be detected and executed

+ 3 - 0
kernel/modelverse_kernel/request_handler.py

@@ -278,6 +278,9 @@ class RequestHandler(object):
         except primitive_functions.PrimitiveFinished:
         except primitive_functions.PrimitiveFinished:
             self.push_generator(None)
             self.push_generator(None)
             raise
             raise
+        except:
+            print("EXCEPTION for " + str(locals()))
+            raise
 
 
     def execute_call_args(self, request_args):
     def execute_call_args(self, request_args):
         """Executes a CALL_ARGS-request with the given argument list."""
         """Executes a CALL_ARGS-request with the given argument list."""

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Tue Nov 14 09:33:14 2017
+Date:   Tue Nov 14 09:58:09 2017
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server