|
@@ -4,6 +4,7 @@ import multiprocessing
|
|
|
|
|
|
from compile import do_compile
|
|
|
from link_and_load import link_and_load
|
|
|
+from make_parallel import main
|
|
|
|
|
|
models = []
|
|
|
code = []
|
|
@@ -20,9 +21,6 @@ for f in sys.argv[3:]:
|
|
|
print("Unknown file format for file " + f)
|
|
|
print("Requires either .mvc or .alc")
|
|
|
|
|
|
-def do_compile_wrapper(filename, mode, grammar):
|
|
|
- do_compile(address, filename, str(random.random()), filename, mode, ["--debug"], grammar=grammar)
|
|
|
-
|
|
|
def initialize_SCD():
|
|
|
import urllib2
|
|
|
import urllib
|
|
@@ -42,12 +40,16 @@ def initialize_SCD():
|
|
|
urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username}))).read()
|
|
|
print("Initialized!")
|
|
|
|
|
|
+def do_compile_wrapper(filename, mode, grammar):
|
|
|
+ do_compile(address, filename, str(random.random()), filename, mode, ["--debug"], grammar=grammar)
|
|
|
+
|
|
|
# Parse all models and upload them
|
|
|
initialize_SCD()
|
|
|
|
|
|
for m in models:
|
|
|
do_compile_wrapper(m, "MO", "grammars/modelling.g")
|
|
|
|
|
|
-p = multiprocessing.Pool(multiprocessing.cpu_count() * 2)
|
|
|
-p.map(lambda i: do_compile_wrapper(i, "PO", grammar="grammars/actionlanguage.g"), code)
|
|
|
-link_and_load(address, username, code)
|
|
|
+#p = multiprocessing.Pool(multiprocessing.cpu_count() * 2)
|
|
|
+#p.map(lambda i: do_compile_wrapper(i, "PO", grammar="grammars/actionlanguage.g"), code)
|
|
|
+#link_and_load(address, username, code)
|
|
|
+main(address, username, code)
|