From 04eb1588d230c2165da41fd272274ba4ef490ffa Mon Sep 17 00:00:00 2001 From: Diego Manzanas Date: Mon, 8 Jul 2024 10:22:37 -0500 Subject: [PATCH] No shared engines --- code/nnv/examples/Submission/VNN_COMP2024/execute.py | 8 ++++---- .../examples/Submission/VNN_COMP2024/prepare_instance.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/nnv/examples/Submission/VNN_COMP2024/execute.py b/code/nnv/examples/Submission/VNN_COMP2024/execute.py index b15393854..932820736 100644 --- a/code/nnv/examples/Submission/VNN_COMP2024/execute.py +++ b/code/nnv/examples/Submission/VNN_COMP2024/execute.py @@ -34,8 +34,8 @@ def prepare_instance(category: str, onnx: str, vnnlib: str) -> None: # keep MATLAB engine open until manually killed # while True: # time.sleep(0.5) - print("We should not be here...") - # print("This is the last line of the prepare instance") + # print("We should not be here...") + print("This is the last line of the prepare instance") def run_instance(category, onnx, vnnlib, timeout, outputlocation) -> None: """Run an instance based on parameters defined in .csv file. @@ -47,11 +47,11 @@ def run_instance(category, onnx, vnnlib, timeout, outputlocation) -> None: """ print("Begin run instance, try to connect to matlab engine") - #eng = matlab.engine.start_matlab() + eng = matlab.engine.start_matlab() # eng_name = matlab.engine.find_matlab()[0] print("Looking for connections") # eng = matlab.engine.connect_matlab(name=eng_name) - eng = matlab.engine.connect_matlab('vnncomp') + # eng = matlab.engine.connect_matlab('vnncomp') print("Is it connected?") # print(f'Successfully connected to engine: {eng_name}.') diff --git a/code/nnv/examples/Submission/VNN_COMP2024/prepare_instance.sh b/code/nnv/examples/Submission/VNN_COMP2024/prepare_instance.sh index bdd8699c8..e4e4301c1 100644 --- a/code/nnv/examples/Submission/VNN_COMP2024/prepare_instance.sh +++ b/code/nnv/examples/Submission/VNN_COMP2024/prepare_instance.sh @@ -28,15 +28,15 @@ killall -q matlab # python -c "exec('$WAIT_FOR_CONNECTION_TO_CLOSE')" # start the matlab engine in background and keep the connection open -# python3 /home/ubuntu/toolkit/code/nnv/examples/Submission/VNN_COMP2024/execute.py 'prepare_instance' $CATEGORY $ONNX_FILE $VNNLIB_FILE & +python3 /home/ubuntu/toolkit/code/nnv/examples/Submission/VNN_COMP2024/execute.py 'prepare_instance' $CATEGORY $ONNX_FILE $VNNLIB_FILE & # python execute.py 'prepare_instance' $CATEGORY $ONNX_FILE $VNNLIB_FILE & # WAIT_FOR_CONNECTION_TO_OPEN='import matlab.engine\nimport time\nwhile not matlab.engine.find_matlab(): time.sleep(1) \nprint(eng)' # python3 -c "exec('$WAIT_FOR_CONNECTION_TO_OPEN')" # python -c "exec('$WAIT_FOR_CONNECTION_TO_OPEN')" -matlab -nodisplay -r "matlab.engine.shareEngine('vnncomp')" +# matlab -nodisplay -r "matlab.engine.shareEngine('vnncomp')" -echo "MATLAB session started and shared" +# echo "MATLAB session started and shared" exit 0