diff --git a/analysis.py b/analysis.py index 1c1f65c..2b3423d 100644 --- a/analysis.py +++ b/analysis.py @@ -9,7 +9,7 @@ import msgpi.io.iovabs as miovabs -def solve(sg_xml, analysis, ppcmd, solver, scrnout=True): +def solve(sg_xml, analysis, ppcmd, solver, timeout=30, scrnout=True): """Solve Parameters @@ -33,7 +33,7 @@ def solve(sg_xml, analysis, ppcmd, solver, scrnout=True): """ # Preprocess - sg_in, smdim = psg.preSG(sg_xml, analysis, ppcmd, solver, scrnout=scrnout) + sg_in, smdim = psg.preSG(sg_xml, analysis, ppcmd, solver, timeout=timeout, scrnout=scrnout) # Solve run(sg_in, analysis, solver, smdim, scrnout) diff --git a/dakota_interface.py b/dakota_interface.py index c9162a4..725e2e5 100644 --- a/dakota_interface.py +++ b/dakota_interface.py @@ -64,10 +64,16 @@ def process(fn_json_args): analysis = interface_args['analysis'] ppcmd = interface_args['prevabs_cmd'] solver = interface_args['solver'] + timeout = 30 + if 'timeout' in interface_args.keys(): + timeout = interface_args['timeout'] scrnout = False if 'scrnout' in interface_args.keys(): scrnout = interface_args['scrnout'] - ms = sga.solve(fn_main, analysis, ppcmd, solver, scrnout=scrnout) + ms = sga.solve( + fn_main, analysis, ppcmd, solver, + timeout=timeout, scrnout=scrnout + ) if 'ref_center' in interface_args.keys(): if interface_args['ref_center'] == 'sc':