Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Try this:

import multiprocessing as mp
def load_out(out_file,q):
    try:
        chnfobj = dyntools.CHNF(out_file,outvrsn=0)
    except TypeError:
        chnfobj = None
    q.put(chnfobj)

q = mp.Queue() #load the .out in a separate process 
p = mp.Process(target=load_out, args = (out_file,q,))
p.start()
chnfobj = q.get()

It runs in a subprocess and doesn't collide with psspy.

Note that there is no p.join() function; it hangs indefinitely. There is probably a way to garbage collect or pass data rather than the chnf obj back. But this works for me.