diff --git a/hysop/backend/device/kernel_autotuner_config.py b/hysop/backend/device/kernel_autotuner_config.py index ba637732333b7a30d49db127d8779c13440707e5..c29a75a3bbd50dccb92989e02a539df914f473d2 100644 --- a/hysop/backend/device/kernel_autotuner_config.py +++ b/hysop/backend/device/kernel_autotuner_config.py @@ -10,10 +10,10 @@ class KernelAutotunerConfig(object): __metaclass__ = ABCMeta _default_initial_runs = { - AutotunerFlags.ESTIMATE: 2, - AutotunerFlags.MEASURE: 4, - AutotunerFlags.PATIENT: 8, - AutotunerFlags.EXHAUSTIVE: 16 + AutotunerFlags.ESTIMATE: 1, + AutotunerFlags.MEASURE: 2, + AutotunerFlags.PATIENT: 4, + AutotunerFlags.EXHAUSTIVE: 8 } def __init__(self, @@ -31,7 +31,7 @@ class KernelAutotunerConfig(object): dump_folder = first_not_None(dump_folder, self.default_dump_folder()) autotuner_flag = first_not_None(autotuner_flag, DEFAULT_AUTOTUNER_FLAG) prune_threshold = first_not_None(prune_threshold, DEFAULT_AUTOTUNER_PRUNE_THRESHOLD) - max_candidates = first_not_None(max_candidates, 8) + max_candidates = first_not_None(max_candidates, 4) verbose = first_not_None(verbose, 2*__VERBOSE__) debug = first_not_None(debug, __KERNEL_DEBUG__) dump_kernels = first_not_None(dump_kernels, __KERNEL_DEBUG__) diff --git a/hysop/backend/device/opencl/opencl_fft.py b/hysop/backend/device/opencl/opencl_fft.py index 21cba0d39f68d8d4a1a2d108010ea9191141ceef..cc4e2330a89bc24917997e325e3639f115af19d4 100644 --- a/hysop/backend/device/opencl/opencl_fft.py +++ b/hysop/backend/device/opencl/opencl_fft.py @@ -140,6 +140,10 @@ class OpenClFFT(FFT): if self._baked: msg='Plan was already baked.' raise RuntimeError(msg) + msg = 'Baking {}[precision={}, shape={}, inplace={}, layout_in={}, layout_out={}]'.format( + self.__class__.__name__, + self.precision, self.t_shape, self.t_inplace, + self.layout_in, self.layout_out) self.plan.bake(self.queue) self._baked = True return self diff --git a/hysop/fields/continuous_field.py b/hysop/fields/continuous_field.py index aa6990ba7b4c3c0c091e36f67a64acd1436d23b8..2815c76a2170af14675b7ffaccb9fd39a96c499c 100644 --- a/hysop/fields/continuous_field.py +++ b/hysop/fields/continuous_field.py @@ -671,7 +671,7 @@ class ScalarField(NamedScalarContainerI, FieldContainerI): @debug def __new__(cls, domain, name, pretty_name=None, var_name=None, latex_name=None, - initial_values=0, dtype=HYSOP_REAL, + initial_values=None, dtype=HYSOP_REAL, lboundaries=None, rboundaries=None, is_tmp=False, **kwds): """ @@ -701,9 +701,9 @@ class ScalarField(NamedScalarContainerI, FieldContainerI): If None, leaves the memory uninitialized. If a single value is given, the whole field is initialized to this value, - the default being 0. + the default being None (ie. no initialization at all). If tuple, computational mesh will be initialized with the first value, - and ghosts will be initialized with the second value. + and ghosts will be initialized with the second value. lboundaries: array_like of BoundaryCondition, optional Left boundary conditions, defaults to PERIODIC on each axis. rboundaries: array_like of BoundaryCondition, optional diff --git a/hysop/numerics/fft/gpyfft_fft.py b/hysop/numerics/fft/gpyfft_fft.py index 9398f582ade747928c2248deec7fb4f2cbbc74c9..d616bce609d22bd0b6e0f78dbd0f13868238c445 100644 --- a/hysop/numerics/fft/gpyfft_fft.py +++ b/hysop/numerics/fft/gpyfft_fft.py @@ -9,7 +9,7 @@ import numpy as np from abc import abstractmethod from gpyfft.fft import gfft, GFFT -from hysop import __KERNEL_DEBUG__, __TRACE_KERNELS__ +from hysop import __KERNEL_DEBUG__, __TRACE_KERNELS__, __VERBOSE__ from hysop.numerics.fft.fft import HysopFFTDataLayoutError, \ mk_shape, float_to_complex_dtype, complex_to_float_dtype from hysop.numerics.fft.opencl_fft import OpenClFFTPlanI, OpenClFFTI, \ @@ -24,6 +24,7 @@ from hysop.tools.misc import prod from hysop.tools.warning import HysopWarning from hysop.tools.types import first_not_None from hysop.tools.numerics import is_complex, is_fp +from hysop.tools.string_utils import framed_str from hysop.backend.device.opencl import cl, clArray from hysop.backend.device.codegen.base.variables import dtype_to_ctype @@ -607,6 +608,34 @@ Post callback source code: if self._baked: msg='Plan was already baked.' raise RuntimeError(msg) + def fmt_arg(name): + return self._setup_kwds[name] + def fmt_array(name): + arr = fmt_arg(name) + return 'shape={:<16} strides={:<16} dtype={:<16}'.format( + str(arr.shape)+',', + str(arr.strides)+',', + arr.dtype) + title=' Baking {} '.format(self.__class__.__name__) + msg = \ + ''' in_array: {} + out_array: {} + fake_input: {} + fake_output: {} + axes: {} + direction_forward: {} + hardcode twiddles: {}'''.format( + fmt_array('in_array'), + fmt_array('out_array'), + fmt_array('fake_input'), + fmt_array('fake_output'), + fmt_arg('axes'), + fmt_arg('direction_forward'), + fmt_arg('hardcode_twiddles')) + if __VERBOSE__: + print + print framed_str(title, msg, c='*') + self.plan.bake(self.queue) queue = first_not_None(queue, self.queue) self.plan.bake(queue) self._baked = True diff --git a/hysop/tools/io_utils.py b/hysop/tools/io_utils.py index ce02db2fe9c9202422b27bfbc73dfa8683e0aeb9..997cf35d02333a3d33cbc04cf8014524186028d3 100755 --- a/hysop/tools/io_utils.py +++ b/hysop/tools/io_utils.py @@ -8,7 +8,7 @@ * :class:`~XMF`, tools to prepare/write xmf files. """ -import os, h5py, psutil, warnings, tempfile +import os, h5py, psutil, warnings, tempfile, socket import subprocess32 as subprocess from collections import namedtuple from inspect import getouterframes, currentframe @@ -134,14 +134,15 @@ class IO(object): @classmethod def set_cache_path(cls, path): if cls.is_shared_fs(path): + new_path += '/{}'.format(socket.gethostname()) msg='\nSpecified cache path \'{}\' is stored on a network filesystem ' msg += 'which does not correctly support file locking.' - msg += '\nReverting cache_path to \'{}\'.' - msg=msg.format(path, self._cache_path) + msg += '\nSetting cache_path to \'{}\'.' + msg=msg.format(path, new_path) warnings.warn(msg, HysopWarning) - else: - IO._cache_path = path - IO.check_dir(path) + path = new_path + IO._cache_path = path + IO.check_dir(path) @staticmethod def set_datasetname(field_name, topo, direction=None):