From 29479c611925c0a8d72680a6536c58ecc4198b34 Mon Sep 17 00:00:00 2001 From: Thomas Gastine Date: Fri, 11 Oct 2024 16:09:45 +0200 Subject: [PATCH] cleanups in magic_wizard.py --- samples/magic_wizard.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/samples/magic_wizard.py b/samples/magic_wizard.py index 44a4bb20..0f272114 100755 --- a/samples/magic_wizard.py +++ b/samples/magic_wizard.py @@ -4,7 +4,6 @@ import shutil import sys import subprocess as sp -import numpy as np import unittest import testOutputs.unitTest import testRadialOutputs.unitTest @@ -108,9 +107,9 @@ def cmake(args, startdir, execDir): os.chdir(execDir) if args.use_debug_flags: - build_type='-DCMAKE_BUILD_TYPE=Debug' + build_type = '-DCMAKE_BUILD_TYPE=Debug' else: - build_type='-DCMAKE_BUILD_TYPE=Release' + build_type = '-DCMAKE_BUILD_TYPE=Release' if args.use_precond: precond_opt = '-DUSE_PRECOND=yes' @@ -191,7 +190,7 @@ def get_exec_cmd(args, execDir): """ magicExec = '{}/magic.exe'.format(execDir) - if args.use_mpi: # With MPI + if args.use_mpi: # With MPI if args.use_openmp: os.environ['OMP_NUM_THREADS'] = str(args.nthreads) os.environ['KMP_STACKSIZE'] = '1g' @@ -202,7 +201,7 @@ def get_exec_cmd(args, execDir): os.environ['I_MPI_PIN_PROCESSOR_LIST'] = 'allcores' execCmd = '{} -n {:d} {}'.format(args.mpicmd, args.nranks, magicExec) - else: # Without MPI + else: # Without MPI execCmd = '{}'.format(magicExec) return execCmd @@ -412,11 +411,11 @@ def printLevelInfo(): print(" Test TO and Geos outputs ") - if __name__ == '__main__': - precision = 1e-8 # relative tolerance between expected and actual result + + precision = 1e-8 # relative tolerance between expected and actual result startdir = os.getcwd() - execDir = '{}/tmp'.format(startdir) # where MagIC will be built + execDir = '{}/tmp'.format(startdir) # where MagIC will be built parser = getParser() args = parser.parse_args()