Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I use python multiprocessing to open multiple octave displays a timeou #283

Open
fireAj opened this issue Feb 1, 2023 · 1 comment

Comments

@fireAj
Copy link

fireAj commented Feb 1, 2023

source
import oct2py
import os
import sys
from multiprocessing import Process, Pool
import time
def yhmatrix(i):

octave = oct2py.Oct2Py()

octave.addpath("/root/weather/ecwmf_png")

str =octave.feval('/root/weather/ecwmf_png/micaps_matlab_exec.m',i)#,i

def error_callback(error):
print(f"Error info: {error}")

if name == 'main':

startTime = time.time()

pool = Pool(15)

for i in range(0,15):

 pool.apply_async(yhmatrix, args=(i, ), error_callback=error_callback)

pool.close()
pool.join()
endTime = time.time()
print ("time :", endTime - startTime)

Error info: Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x7f98e80423d0>
command: /root/yhMatrix/octave/bin/octave
args: [b'/root/yhMatrix/octave/bin/octave', b'--interactive', b'--quiet', b'--no-init-file']
buffer (last 100 chars): ''
before (last 100 chars): ''
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 434435
child_fd: 36
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile('octave.*>')

@fireAj
Copy link
Author

fireAj commented Feb 1, 2023

That looks like Octave taking so long to start that the pexpect module managing communications with Octave exceeds the configured timeout for waiting for the Octave prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant