Commit b6808c6b authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

update code name in python files

parent 10358af0
......@@ -75,9 +75,9 @@ from setuptools import setup
setup(
name = 'TurTLE',
packages = ['turtle', 'turtle/test'],
packages = ['TurTLE', 'TurTLE/test'],
install_requires = ['numpy>=1.8', 'h5py>=2.2.1'],
package_data = {'turtle': ['test/B32p1e4_checkpoint_0.h5']},
package_data = {'TurTLE': ['test/B32p1e4_checkpoint_0.h5']},
entry_points = {
'console_scripts': [
'turtle = turtle.__main__:main',
......
......@@ -2,20 +2,20 @@
# #
# Copyright 2015-2019 Max Planck Institute for Dynamics and Self-Organization #
# #
# This file is part of bfps. #
# This file is part of TurTLE. #
# #
# bfps is free software: you can redistribute it and/or modify #
# TurTLE is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published #
# by the Free Software Foundation, either version 3 of the License, #
# or (at your option) any later version. #
# #
# bfps is distributed in the hope that it will be useful, #
# TurTLE is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with bfps. If not, see <http://www.gnu.org/licenses/> #
# along with TurTLE. If not, see <http://www.gnu.org/licenses/> #
# #
# Contact: Cristian.Lalescu@ds.mpg.de #
# #
......@@ -33,9 +33,9 @@ import math
import numpy as np
import warnings
import bfps
import TurTLE
from ._code import _code
from bfps import tools
from TurTLE import tools
class DNS(_code):
"""This class is meant to stitch together the C++ code into a final source file,
......@@ -76,8 +76,8 @@ class DNS(_code):
self):
self.version_message = (
'/***********************************************************************\n' +
'* this code automatically generated by bfps\n' +
'* version {0}\n'.format(bfps.__version__) +
'* this code automatically generated by TurTLE\n' +
'* version {0}\n'.format(TurTLE.__version__) +
'***********************************************************************/\n\n\n')
self.include_list = [
'"base.hpp"',
......@@ -445,7 +445,7 @@ class DNS(_code):
assert (self.parameters['niter_out'] % self.parameters['niter_part'] == 0)
_code.write_par(self, iter0 = iter0)
with h5py.File(self.get_data_file_name(), 'r+') as ofile:
ofile['bfps_info/exec_name'] = self.name
ofile['TurTLE_info/exec_name'] = self.name
kspace = self.get_kspace()
for k in kspace.keys():
ofile['kspace/' + k] = kspace[k]
......@@ -696,7 +696,7 @@ class DNS(_code):
opt = _code.prepare_launch(self, args = args)
self.set_precision(opt.precision)
self.dns_type = opt.DNS_class
self.name = self.dns_type + '-' + self.fluid_precision + '-v' + bfps.__version__
self.name = self.dns_type + '-' + self.fluid_precision + '-v' + TurTLE.__version__
# merge parameters if needed
if self.dns_type in ['NSVEparticles', 'NSVEcomplex_particles', 'NSVEparticles_no_output', 'NSVEp_extra_sampling']:
for k in self.NSVEp_extra_parameters.keys():
......@@ -870,8 +870,8 @@ class DNS(_code):
:param write_to_file: should we write the field to file?
:param scalar_generator: which function to use for generating the
individual components.
Possible values: bfps.tools.generate_data_3D,
bfps.tools.generate_data_3D_uniform
Possible values: TurTLE.tools.generate_data_3D,
TurTLE.tools.generate_data_3D_uniform
:type rseed: int
:type spectra_slope: float
:type amplitude: float
......
......@@ -2,20 +2,20 @@
# #
# Copyright 2015-2019 Max Planck Institute for Dynamics and Self-Organization #
# #
# This file is part of bfps. #
# This file is part of TurTLE. #
# #
# bfps is free software: you can redistribute it and/or modify #
# TurTLE is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published #
# by the Free Software Foundation, either version 3 of the License, #
# or (at your option) any later version. #
# #
# bfps is distributed in the hope that it will be useful, #
# TurTLE is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with bfps. If not, see <http://www.gnu.org/licenses/> #
# along with TurTLE. If not, see <http://www.gnu.org/licenses/> #
# #
# Contact: Cristian.Lalescu@ds.mpg.de #
# #
......@@ -34,9 +34,9 @@ import numpy as np
import warnings
import glob
import bfps
import TurTLE
from ._code import _code
from bfps import tools
from TurTLE import tools
class PP(_code):
"""This class is meant to stitch together the C++ code into a final source file,
......@@ -75,8 +75,8 @@ class PP(_code):
def write_src(self):
self.version_message = (
'/***********************************************************************\n' +
'* this code automatically generated by bfps\n' +
'* version {0}\n'.format(bfps.__version__) +
'* this code automatically generated by TurTLE\n' +
'* version {0}\n'.format(TurTLE.__version__) +
'***********************************************************************/\n\n\n')
self.include_list = [
'"base.hpp"',
......@@ -491,7 +491,7 @@ class PP(_code):
opt = _code.prepare_launch(self, args = args)
self.set_precision(opt.precision)
self.dns_type = opt.DNS_class
self.name = self.dns_type + '-' + self.fluid_precision + '-v' + bfps.__version__
self.name = self.dns_type + '-' + self.fluid_precision + '-v' + TurTLE.__version__
# merge parameters if needed
for k in self.pp_parameters.keys():
self.parameters[k] = self.pp_parameters[k]
......@@ -559,8 +559,8 @@ class PP(_code):
:param write_to_file: should we write the field to file?
:param scalar_generator: which function to use for generating the
individual components.
Possible values: bfps.tools.generate_data_3D,
bfps.tools.generate_data_3D_uniform
Possible values: TurTLE.tools.generate_data_3D,
TurTLE.tools.generate_data_3D_uniform
:type rseed: int
:type spectra_slope: float
:type amplitude: float
......@@ -673,7 +673,7 @@ class PP(_code):
opt.klist_kmax = n / 3.
if type(opt.klist_kmin) == type(None):
opt.klist_kmin = 6.
kvals = bfps_addons.tools.power_space_array(
kvals = TurTLE_addons.tools.power_space_array(
power = opt.klist_power,
size = opt.klist_size,
vmin = opt.klist_kmin,
......
......@@ -2,20 +2,20 @@
# #
# Copyright 2015-2019 Max Planck Institute for Dynamics and Self-Organization #
# #
# This file is part of bfps. #
# This file is part of TurTLE. #
# #
# bfps is free software: you can redistribute it and/or modify #
# TurTLE is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published #
# by the Free Software Foundation, either version 3 of the License, #
# or (at your option) any later version. #
# #
# bfps is distributed in the hope that it will be useful, #
# TurTLE is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with bfps. If not, see <http://www.gnu.org/licenses/> #
# along with TurTLE. If not, see <http://www.gnu.org/licenses/> #
# #
# Contact: Cristian.Lalescu@ds.mpg.de #
# #
......@@ -33,10 +33,10 @@ import math
import numpy as np
import warnings
import bfps
import TurTLE
from ._code import _code
from bfps import tools
from bfps import DNS
from TurTLE import tools
from TurTLE import DNS
class TEST(_code):
"""This class is meant to stitch together the C++ code into a final source file,
......@@ -75,8 +75,8 @@ class TEST(_code):
def write_src(self):
self.version_message = (
'/***********************************************************************\n' +
'* this code automatically generated by bfps\n' +
'* version {0}\n'.format(bfps.__version__) +
'* this code automatically generated by TurTLE\n' +
'* version {0}\n'.format(TurTLE.__version__) +
'***********************************************************************/\n\n\n')
self.include_list = [
'"base.hpp"',
......@@ -167,7 +167,7 @@ class TEST(_code):
assert (iter0 == 0)
_code.write_par(self, iter0 = iter0)
with h5py.File(self.get_data_file_name(), 'r+') as ofile:
ofile['bfps_info/exec_name'] = self.name
ofile['TurTLE_info/exec_name'] = self.name
kspace = self.get_kspace()
for k in kspace.keys():
ofile['kspace/' + k] = kspace[k]
......@@ -289,7 +289,7 @@ class TEST(_code):
opt = _code.prepare_launch(self, args = args)
self.set_precision(opt.precision)
self.dns_type = opt.TEST_class
self.name = self.dns_type + '-' + self.fluid_precision + '-v' + bfps.__version__
self.name = self.dns_type + '-' + self.fluid_precision + '-v' + TurTLE.__version__
# merge parameters if needed
self.pars_from_namespace(opt)
return opt
......
......@@ -2,20 +2,20 @@
# #
# Copyright 2015-2019 Max Planck Institute for Dynamics and Self-Organization #
# #
# This file is part of bfps. #
# This file is part of TurTLE. #
# #
# bfps is free software: you can redistribute it and/or modify #
# TurTLE is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published #
# by the Free Software Foundation, either version 3 of the License, #
# or (at your option) any later version. #
# #
# bfps is distributed in the hope that it will be useful, #
# TurTLE is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with bfps. If not, see <http://www.gnu.org/licenses/> #
# along with TurTLE. If not, see <http://www.gnu.org/licenses/> #
# #
# Contact: Cristian.Lalescu@ds.mpg.de #
# #
......@@ -29,13 +29,13 @@ import pickle
import pkg_resources
__version__ = pkg_resources.require('bfps')[0].version
__version__ = pkg_resources.require('TurTLE')[0].version
_dist = pkg_resources.get_distribution('bfps')
_dist = pkg_resources.get_distribution('TurTLE')
dist_loc = os.path.realpath(_dist.location)
here = os.path.normcase(__file__)
header_dir = os.path.join(os.path.join(dist_loc, 'bfps'), 'cpp')
lib_dir = os.path.join(dist_loc, 'bfps')
header_dir = os.path.join(os.path.join(dist_loc, 'TurTLE'), 'cpp')
lib_dir = os.path.join(dist_loc, 'TurTLE')
homefolder = os.path.expanduser('~')
from .host_info import host_info
......
......@@ -2,20 +2,20 @@
# #
# Copyright 2015-2019 Max Planck Institute for Dynamics and Self-Organization #
# #
# This file is part of bfps. #
# This file is part of TurTLE. #
# #
# bfps is free software: you can redistribute it and/or modify #
# TurTLE is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published #
# by the Free Software Foundation, either version 3 of the License, #
# or (at your option) any later version. #
# #
# bfps is distributed in the hope that it will be useful, #
# TurTLE is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with bfps. If not, see <http://www.gnu.org/licenses/> #
# along with TurTLE. If not, see <http://www.gnu.org/licenses/> #
# #
# Contact: Cristian.Lalescu@ds.mpg.de #
# #
......@@ -26,17 +26,17 @@
import sys
import argparse
import bfps
import TurTLE
from .DNS import DNS
from .PP import PP
from .TEST import TEST
def main():
parser = argparse.ArgumentParser(prog = 'bfps', conflict_handler = 'resolve')
parser = argparse.ArgumentParser(prog = 'turtle', conflict_handler = 'resolve')
parser.add_argument(
'-v', '--version',
action = 'version',
version = '%(prog)s ' + bfps.__version__)
version = '%(prog)s ' + TurTLE.__version__)
parser.add_argument(
'base_class',
choices = ['DNS', 'PP', 'TEST'],
......
......@@ -27,7 +27,7 @@ import os
import sys
import numpy as np
import h5py
from bfps import __version__
from TurTLE import __version__
class _base(object):
"""This class contains simulation parameters, and handles parameter related
......
......@@ -4,18 +4,18 @@
# #
# This file is part of bfps. #
# #
# bfps is free software: you can redistribute it and/or modify #
# TurTLE is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published #
# by the Free Software Foundation, either version 3 of the License, #
# or (at your option) any later version. #
# #
# bfps is distributed in the hope that it will be useful, #
# TurTLE is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with bfps. If not, see <http://www.gnu.org/licenses/> #
# along with TurTLE. If not, see <http://www.gnu.org/licenses/> #
# #
# Contact: Cristian.Lalescu@ds.mpg.de #
# #
......@@ -33,8 +33,8 @@ from datetime import datetime
import math
import warnings
import bfps
from bfps.host_info import host_info
import TurTLE
from TurTLE.host_info import host_info
from ._base import _base
class _code(_base):
......@@ -48,8 +48,8 @@ class _code(_base):
_base.__init__(self, work_dir = work_dir, simname = simname)
self.version_message = (
'/***********************************************************************\n' +
'* this code automatically generated by bfps\n' +
'* version {0}\n'.format(bfps.__version__) +
'* this code automatically generated by TurTLE\n' +
'* version {0}\n'.format(TurTLE.__version__) +
'***********************************************************************/\n\n\n')
self.includes = """
//begincpp
......@@ -195,7 +195,7 @@ class _code(_base):
if os.path.exists(os.path.join(self.work_dir, self.name)):
return 0
# compile code
build_dir = 'bfps_build_' + self.name
build_dir = 'TurTLE_build_' + self.name
os.makedirs(build_dir, exist_ok = True)
os.chdir(build_dir)
self.write_src()
......@@ -223,9 +223,9 @@ class _code(_base):
outfile.write('set(CMAKE_CXX_STANDARD_REQUIRED ON)\n')
outfile.write('set(CMAKE_CXX_COMPILE_FLAGS "${CMAKE_CXX_COMPILE_FLAGS} ${BFPS_CXX_COMPILE_FLAGS}")\n')
outfile.write('set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${BFPS_EXE_LINKER_FLAGS}")\n')
outfile.write('include_directories(${BFPS_INCLUDE_DIRECTORIES} ${BFPS_INCLUDE_DIR}/bfps)\n')
outfile.write('include_directories(${BFPS_INCLUDE_DIRECTORIES} ${BFPS_INCLUDE_DIR}/TurTLE)\n')
outfile.write('link_directories(${BFPS_LINK_DIRECTORIES} ${BFPS_LIBRARIES_DIR})\n')
outfile.write('find_library(BFPS_STATIC_LIBRARY bfps)\n')
outfile.write('find_library(BFPS_STATIC_LIBRARY TurTLE)\n')
outfile.write('add_executable({0} {0}.cpp)\n'.format(self.name))
outfile.write('target_link_libraries(' + self.name + ' ${BFPS_STATIC_LIBRARY})\n')
outfile.write('target_link_libraries(' + self.name + ' ${BFPS_LIBS})\n')
......@@ -331,7 +331,7 @@ class _code(_base):
suffix = self.simname + '_{0}'.format(iter0)
job_script_name = 'run_' + suffix + '.sh'
energy_policy_tag = (
'bfps'
'TurTLE'
+ '_np{0}_ntpp{1}'.format(
nb_processes, nb_threads_per_process)
+ '_Nx{0}_Ny{1}_Nz{2}'.format(
......@@ -390,7 +390,7 @@ class _code(_base):
err_file = None,
nb_mpi_processes = None,
nb_threads_per_process = None,
energy_policy_tag = 'bfps'):
energy_policy_tag = 'TurTLE'):
script_file = open(file_name, 'w')
script_file.write('# @ shell=/bin/bash\n')
......@@ -450,7 +450,7 @@ class _code(_base):
script_file.write('# @ queue\n')
script_file.write('source ~/.config/bfps/bashrc\n')
script_file.write('source ~/.config/TurTLE/bashrc\n')
script_file.write('module li\n')
script_file.write('export OMP_NUM_THREADS={}\n'.format(nb_threads_per_process))
......@@ -488,7 +488,7 @@ class _code(_base):
njobs = 2,
nb_mpi_processes = None,
nb_threads_per_process = None,
energy_policy_tag = 'bfps'):
energy_policy_tag = 'TurTLE'):
assert(type(self.host_info['environment']) != type(None))
script_file = open(file_name, 'w')
script_file.write('# @ shell=/bin/bash\n')
......@@ -552,7 +552,7 @@ class _code(_base):
script_file.write('# @ first_node_tasks = {0}\n'.format(first_node_tasks))
script_file.write('# @ queue\n')
script_file.write('source ~/.config/bfps/bashrc\n')
script_file.write('source ~/.config/TurTLE/bashrc\n')
script_file.write('module li\n')
script_file.write('export OMP_NUM_THREADS={}\n'.format(nb_threads_per_process))
......@@ -677,7 +677,7 @@ class _code(_base):
script_file.write('#SBATCH --mail-type=none\n')
script_file.write('#SBATCH --time={0}:{1:0>2d}:00\n'.format(hours, minutes))
script_file.write('source ~/.config/bfps/bashrc\n')
script_file.write('source ~/.config/TurTLE/bashrc\n')
if nb_threads_per_process > 1:
script_file.write('export OMP_NUM_THREADS={0}\n'.format(nb_threads_per_process))
script_file.write('export OMP_PLACES=cores\n')
......@@ -694,7 +694,7 @@ class _code(_base):
self,
args = [],
**kwargs):
parser = argparse.ArgumentParser('bfps ' + type(self).__name__)
parser = argparse.ArgumentParser('TurTLE ' + type(self).__name__)
self.add_parser_arguments(parser)
opt = parser.parse_args(args)
......@@ -705,7 +705,7 @@ class _code(_base):
opt.nb_processes = opt.ncpu
opt.nb_threads_per_process = 1
self.set_host_info(bfps.host_info)
self.set_host_info(TurTLE.host_info)
if type(opt.environment) != type(None):
self.host_info['environment'] = opt.environment
return opt
......
......@@ -3,8 +3,8 @@
import numpy as np
import sys
import bfps
from bfps import DNS
import TurTLE
from TurTLE import DNS
def main():
niterations = 10
......
......@@ -4,20 +4,20 @@
# Copyright 2019 Max Planck Institute #
# for Dynamics and Self-Organization #
# #
# This file is part of bfps. #
# This file is part of TurTLE. #
# #
# bfps is free software: you can redistribute it and/or modify #
# TurTLE is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published #
# by the Free Software Foundation, either version 3 of the License, #
# or (at your option) any later version. #
# #
# bfps is distributed in the hope that it will be useful, #
# TurTLE is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with bfps. If not, see <http://www.gnu.org/licenses/> #
# along with TurTLE. If not, see <http://www.gnu.org/licenses/> #
# #
# Contact: Cristian.Lalescu@ds.mpg.de #
# #
......@@ -30,8 +30,8 @@ import numpy as np
import h5py
import sys
import bfps
from bfps import DNS
import TurTLE
from TurTLE import DNS
def main():
......@@ -58,7 +58,7 @@ def main():
'-n', '32',
'--src-simname', 'B32p1e4',
'--forcing_type', 'linear',
'--src-wd', bfps.lib_dir + '/test',
'--src-wd', TurTLE.lib_dir + '/test',
'--src-iteration', '0',
'--simname', 'dns_nsveparticles',
'--np', '4',
......@@ -75,7 +75,7 @@ def main():
sys.argv[1:])
f0 = h5py.File(
os.path.join(
os.path.join(bfps.lib_dir, 'test'),
os.path.join(TurTLE.lib_dir, 'test'),
'B32p1e4_checkpoint_0.h5'),
'r')
f1 = h5py.File(c.get_checkpoint_0_fname(), 'r')
......
......@@ -5,9 +5,9 @@ import numpy as np
import h5py
import sys
import bfps
from bfps import DNS
from bfps import PP
import TurTLE
from TurTLE import DNS
from TurTLE import PP
import matplotlib.pyplot as plt
import pyfftw
......@@ -20,7 +20,7 @@ def main():
['NSVE',
'-n', '32',
'--src-simname', 'B32p1e4',
'--src-wd', bfps.lib_dir + '/test',
'--src-wd', TurTLE.lib_dir + '/test',
'--src-iteration', '0',
'--simname', 'dns_test',
'--np', '4',
......
......@@ -4,8 +4,8 @@ import numpy as np
import h5py
import sys
import bfps
from bfps import TEST
import TurTLE
from TurTLE import TEST
try:
import matplotlib.pyplot as plt
......
......@@ -5,8 +5,8 @@ import numpy as np
import h5py
import sys
import bfps
from bfps import TEST
import TurTLE
from TurTLE import TEST
try:
import matplotlib.pyplot as plt
......
......@@ -4,20 +4,20 @@
# Copyright 2019 Max Planck Institute #
# for Dynamics and Self-Organization #
# #
# This file is part of bfps. #
# This file is part of TurTLE. #
# #
# bfps is free software: you can redistribute it and/or modify #
# TurTLE is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published #
# by the Free Software Foundation, either version 3 of the License, #
# or (at your option) any later version. #
# #
# bfps is distributed in the hope that it will be useful, #
# TurTLE is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with bfps. If not, see <http://www.gnu.org/licenses/> #
# along with TurTLE. If not, see <http://www.gnu.org/licenses/> #
# #
# Contact: Cristian.Lalescu@ds.mpg.de #
# #
......@@ -30,8 +30,8 @@ import numpy as np
import h5py
import sys
import bfps
from bfps import DNS
import TurTLE
from TurTLE import DNS
def main():
......@@ -55,7 +55,7 @@ def main():
'-n', '32',
'--src-simname', 'B32p1e4',
'--forcing_type', 'linear',
'--src-wd', bfps.lib_dir + '/test',
'--src-wd', TurTLE.lib_dir + '/test',
'--src-iteration', '0',
'--np', '4',
'--ntpp', '1',
......@@ -68,7 +68,7 @@ def main():
'--wd', './'])
f0 = h5py.File(
os.path.join(
os.path.join(bfps.lib_dir, 'test'),
os.path.join(TurTLE.lib_dir, 'test'),
'B32p1e4_checkpoint_0.h5'),
'r')
f1 = h5py.File(c.get_checkpoint_0_fname(), 'r')
......