diff --git a/hysop/backend/device/opencl/__init__.py b/hysop/backend/device/opencl/__init__.py index 36f976e52cab2299ce1d8825c22e8a14b209fc9e..e63a4b7acfd8a3acad7e1ebcb18c0b0f20eefdcd 100644 --- a/hysop/backend/device/opencl/__init__.py +++ b/hysop/backend/device/opencl/__init__.py @@ -24,17 +24,17 @@ except ImportError: from pyopencl import _cl as cl_api -from hysop import __DEFAULT_PLATFORM_ID__, __DEFAULT_DEVICE_ID__, __PROFILE__ +from hysop import __DEFAULT_PLATFORM_ID__, __DEFAULT_DEVICE_ID__, __PROFILE__, get_env from hysop.tools.io_utils import IO from hysop.backend.device import KERNEL_DUMP_FOLDER -OPENCL_KERNEL_DUMP_FOLDER='{}/opencl'.format(KERNEL_DUMP_FOLDER) +OPENCL_KERNEL_DUMP_FOLDER = '{}/opencl'.format(KERNEL_DUMP_FOLDER) """Default opencl kernel dump folder.""" -__OPENCL_PROFILE__ = __PROFILE__ +__OPENCL_PROFILE__ = get_env('OPENCL_PROFILE', __PROFILE__) """Boolean, true to enable OpenCL profiling events to time computations""" -## open cl underlying implementation +# open cl underlying implementation cl = pyopencl """PyOpencl module, underlying OpenCL implementation""" @@ -69,4 +69,3 @@ if not os.path.isdir(os.environ['CLFFT_CACHE_PATH']): except: print("Could not create clfft cache directory '{}'.".format( os.environ['CLFFT_CACHE_PATH'])) - diff --git a/hysop/iterative_method.py b/hysop/iterative_method.py index 2281d40dc156e51229726db8e0ad49a5c6654240..8f9f758844c8d62996fbf854ed05ff47a3368caf 100644 --- a/hysop/iterative_method.py +++ b/hysop/iterative_method.py @@ -133,7 +133,8 @@ class IterativeMethod(Problem): mpi_params=self.mpi_params) self.configsimu(loop, simulation) # Usual initialize-loop-finalize sequence : - loop.initialize() + if not loop._is_ready: + loop.initialize() with Timer() as tm: while not loop.is_over: if loop.current_iteration % self.state_print == 0: