diff --git a/CMakeLists.txt b/CMakeLists.txt index 58acb90035f9d379eb83990cb2293a668cd5e999..46258cff868f7eca2336fe013e5ef76af7baf1c3 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ option(OPTIM "To allow python -OO run, some packages must be deactivated. Set th option(WITH_MPI_TESTS "Enable mpi tests. Default = ON if USE_MPI is ON." ON) option(WITH_GOOGLE_TESTS "Enable google tests (c++). Default = OFF." OFF) option(FORTRAN_LAYOUT "Choose default data layout ('fortran', column-major or 'C' order, row-major) for arrays. Default = column-major." ON) -option(WITH_DOCUMENTATION "Build Documentation. Default = OFF" ON) +option(WITH_DOCUMENTATION "Build Documentation. Default = OFF" OFF) option(ENABLE_LONG_TESTS "Enable tests that may run for long time with important memory print. Default = OFF." OFF) option(DEV_MODE "Enable devel mode (aggressive checking of warnings ..). Default = ON." ON) # Set python install mode: diff --git a/cmake/hysop_tests.cmake b/cmake/hysop_tests.cmake index db5b29852cd5bfdf48b7c30656e72c12e809c075..b32777bcaa0d58499bda318ecc272a82f8dbecfa 100755 --- a/cmake/hysop_tests.cmake +++ b/cmake/hysop_tests.cmake @@ -55,34 +55,32 @@ endif() # === Set the list of all directories which may contain tests === set(py_src_dirs + core + backend fields domain operator numerics - problem tools - mpi ) # If GPU is on, we add test_XXX.py files of hysop/gpu directory -if(WITH_GPU) - list(APPEND py_src_dirs gpu) - list(APPEND py_src_dirs codegen) -endif() +#if(WITH_GPU) +#endif() # Copy the OpenCL sources files to build dir (required since only python files are copied by setup.py) -set(clfiles) -file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/[a-z]*.cl) -set(clfiles ${clfiles} ${clfilestmp}) -file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/kernels/[a-z]*.cl) -set(clfiles ${clfiles} ${clfilestmp}) -file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/advection/[a-z]*.cl) -set(clfiles ${clfiles} ${clfilestmp}) -file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/remeshing/[a-z]*.cl) -set(clfiles ${clfiles} ${clfilestmp}) -foreach(_F ${clfiles}) - configure_file(${_F} ${testDir}/${_F} COPYONLY) -endforeach() +#set(clfiles) +#file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/[a-z]*.cl) +#set(clfiles ${clfiles} ${clfilestmp}) +#file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/kernels/[a-z]*.cl) +#set(clfiles ${clfiles} ${clfilestmp}) +#file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/advection/[a-z]*.cl) +#set(clfiles ${clfiles} ${clfilestmp}) +#file(GLOB clfilestmp RELATIVE ${CMAKE_SOURCE_DIR} hysop/gpu/cl_src/remeshing/[a-z]*.cl) +#set(clfiles ${clfiles} ${clfilestmp}) +#foreach(_F ${clfiles}) + #configure_file(${_F} ${testDir}/${_F} COPYONLY) +#endforeach() # === Create the files list from all directories in py_src_dirs === diff --git a/hysop/__init__.py b/hysop/__init__.py index 8ca5855b6a2769f19c89009ded2d02d98a3bf8c8..a589ac754cad519a8cd762fade7e479911dc1867 100644 --- a/hysop/__init__.py +++ b/hysop/__init__.py @@ -10,24 +10,26 @@ package_name = "hysop" version = "2.0.0" # Compilation flags -__MPI_ENABLED__ = "ON" is "ON" -__GPU_ENABLED__ = "ON" is "ON" -__FFTW_ENABLED__ = "ON" is "ON" -__SCALES_ENABLED__ = "ON" is "ON" -__OPTIMIZE__ = "OFF" is "ON" - -__VERBOSE__ = True -__DEBUG__ = False -__TRACE__ = False -__KERNEL_DEBUG__ = True +__MPI_ENABLED__ = "ON" is "ON" +__GPU_ENABLED__ = "ON" is "ON" +__FFTW_ENABLED__ = "ON" is "ON" +__SCALES_ENABLED__ = "ON" is "ON" +__OPTIMIZE__ = "OFF" is "ON" + +__VERBOSE__ = "ON" in ["1", "3"] +__DEBUG__ = "ON" in ["2", "3"] +__TRACE__ = "ON" in ["5"] +__KERNEL_DEBUG__ = "ON" in ["4", "3"] __PROFILE__ = "OFF" in ["0", "1"] -__ENABLE_LONG_TESTS__ = False +__ENABLE_LONG_TESTS__ = "OFF" is "ON" # OpenCL -__DEFAULT_PLATFORM_ID__ = 1 +__DEFAULT_PLATFORM_ID__ = 0 __DEFAULT_DEVICE_ID__ = 0 + + if __MPI_ENABLED__: from hysop.core.mpi import MPI, main_rank, main_size, \ host_rank, interhost_size, \ @@ -75,7 +77,7 @@ from hysop.simulation import Simulation from hysop.problem import Problem from hysop.tools.io_utils import IO, IOParams __all__ = ['Box', 'Field', 'Cartesian', 'Domain', 'Discretization', 'Simulation', - 'Problem', 'IO', 'IOParams', 'Topology', 'Cartesian', 'TopologyDescriptor'] + 'Problem', 'IO', 'IOParams', 'Topology', 'Cartesian', 'TopologyDescriptor] if __MPI_ENABLED__: __all__ += ['MPI', 'main_rank', 'main_size'] diff --git a/hysop/constants.py b/hysop/constants.py index daffc02bdb0a6c6647e057f8838480353682e780..0c517fb552817fb091a959bebd2f0629fa8a919b 100644 --- a/hysop/constants.py +++ b/hysop/constants.py @@ -79,8 +79,8 @@ System type enum. """ Basis = EnumFactory.create('Basis', - ['NATURAL', 'FOURIER', 'CHEBYSHEV']) -"""Basis enum""" + ['CARTESIAN', 'FOURIER', 'CHEBYSHEV']) +"""Basis""" Backend = EnumFactory.create('Backend', ['OPENCL','HOST','CUDA']) @@ -188,6 +188,9 @@ del cls del default del labels +TranspositionState1D = transposition_states[1] +"""1D memory layout (transposition state) enum""" + TranspositionState2D = transposition_states[2] """2D memory layout (transposition state) enum""" diff --git a/setup.py.in b/setup.py.in index fc161eabb2a7cd5d4bdab8b30cebb9ed39cf5b99..155cecdb51532da0bed650ab5c2d8283a257b3aa 100644 --- a/setup.py.in +++ b/setup.py.in @@ -25,7 +25,8 @@ if enable_cpp: def parseCMakeVar(var): - """post-process cmake list-like variable + """ + Post-process cmake list-like variables. Example:: @@ -44,7 +45,8 @@ def parseCMakeVar(var): def parseCMakeDefines(var): - """post-process cmake variables, corresponding + """ + Post-process cmake variables, corresponding to pre-processor definitions. Example:: @@ -209,7 +211,6 @@ def create_swig_extension(name, inc_dirs, src_dirs=None, sources=None): sources.insert(0, swig_config_file) include_dirs = list(include_dirs) - print sources name = 'hysop._' + name swig_opts = ['-I' + swig_dir, @@ -248,9 +249,9 @@ else: where="@CMAKE_SOURCE_DIR@") if "@WITH_GPU@" is "ON": - packages.append('hysop.backend.opencl') + packages.append('hysop.backend.device.opencl') if with_test: - packages.append('hysop.backend.opencl.tests') + packages.append('hysop.backend.device.opencl.tests') # Enable this to get debug info DISTUTILS_DEBUG = 1 @@ -279,8 +280,8 @@ if enable_fortran is "ON": withfftw = "@WITH_FFTW@" if withfftw is "ON": subdirs.append(os.path.join('numerics', 'fftw_f')) - fftwdir = '@FFTWLIB@' - hysop_libdir.append(fftwdir) + fftwdir = parseCMakeVar('@FFTWLIB@') + hysop_libdir.extend(fftwdir) # -- scales sources -- withscales = '@WITH_SCALES@' @@ -311,7 +312,9 @@ if enable_fortran is "ON": num_dirs = [] for sd in subdirs: num_dirs.append(os.path.join(fortran_root, sd)) - + + hysop_libdir = [ld.strip() for ld in hysop_libdir] + # hysop_libdir = ' '.join([ '-L{}'.format(ld) if ld[1]!='L' else hysop_libdir]) num_dirs.append('@GENERATED_FORTRAN_FILES_DIR@') # create python interface to fortran sources # For the moment, it includes the 'old' interface