Skip to content

Commit

Permalink
Can we keep matlab running? consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
mldiego committed Jul 11, 2024
1 parent 1a06bc9 commit 18a8c98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/nnv/examples/Submission/VNN_COMP2024/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def run_instance(category, onnx, vnnlib, timeout, outputlocation) -> None:
print("Begin run instance, try to connect to matlab engine")
# eng = matlab.engine.start_matlab()
print("Looking for connections")
matlab.engine.find_matlab()
eng = matlab.engine.connect_matlab()
#print(eng_name)
# eng = matlab.engine.connect_matlab(name=eng_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ killall -q matlab
# python3 -c "exec('$WAIT_FOR_CONNECTION_TO_OPEN')"
# python -c "exec('$WAIT_FOR_CONNECTION_TO_OPEN')"

nohup matlab -nosplash -nodisplay -nodesktop -r "; p = parpool; p.IdleTimeout = 120; matlab.engine.shareEngine();" &
nohup matlab -nosplash -nodisplay -nodesktop -batch "p = parpool; p.IdleTimeout = 120; matlab.engine.shareEngine;" &

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')"

exit 0

0 comments on commit 18a8c98

Please sign in to comment.