Skip to content

Commit

Permalink
0708
Browse files Browse the repository at this point in the history
  • Loading branch information
Su Tian committed Jul 8, 2021
1 parent ac66f0e commit a1fa7aa
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions msgpi/dakota_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import dakota.interfacing as di

def process(fn_json_args, logger=None):
if logger is None:
logger = mlog.initLogger(__name__)
# if logger is None:
# logger = mlog.initLogger(__name__)
# if timer is None:
# timer = mtime.Timer(logger=logger.info)

Expand All @@ -21,11 +21,12 @@ def process(fn_json_args, logger=None):
with open(fn_json_args, 'r') as fo:
interface_args = json.load(fo)

# logging.basicConfig(
# filename='app.log', filemode='w',
# format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S',
# level=20
# )
# Set logger
log_level = 'INFO'
if 'log_level' in interface_args.keys():
if interface_args['log_level'] == 'debug':
log_level = 'DEBUG'
logger = mlog.initLogger(__name__, cout_level=log_level)

# Load data processing module
if 'data_process_functions_file' in interface_args.keys():
Expand Down Expand Up @@ -73,6 +74,9 @@ def process(fn_json_args, logger=None):
ppcmd = interface_args['prevabs_cmd_linux']

solver = interface_args['solver']
integrated = False
if 'integrated' in interface_args.keys():
integrated = interface_args['integrated']
timeout = 30
if 'timeout' in interface_args.keys():
timeout = interface_args['timeout']
Expand All @@ -85,7 +89,7 @@ def process(fn_json_args, logger=None):

# timer.start()
bp = sga.solve(
fn_main, analysis, ppcmd, solver,
fn_main, analysis, ppcmd, solver, integrated,
timeout=timeout, scrnout=scrnout, logger=logger
)
# timer.stop()
Expand Down

0 comments on commit a1fa7aa

Please sign in to comment.