diff --git a/bfps/NSVorticityEquation.py b/bfps/NSVorticityEquation.py index 255f2d68674843e85286f032fa1c324490ae940e..3d2a2038a127440222197c816ce5eafe983b61be 100644 --- a/bfps/NSVorticityEquation.py +++ b/bfps/NSVorticityEquation.py @@ -636,9 +636,17 @@ class NSVorticityEquation(_fluid_particle_base): if not os.path.exists(init_condition_file): f = h5py.File(init_condition_file, 'w') if len(opt.src_simname) > 0: - src_file = os.path.join( + source_cp = 0 + src_file = 'not_a_file' + while True: + src_file = os.path.join( os.path.realpath(opt.src_work_dir), - opt.src_simname + '_cvorticity_i{0:0>5x}.h5'.format(opt.src_iteration)) + opt.src_simname + '_checkpoint_{0}.h5'.format(source_cp)) + f0 = h5py.File(src_file, 'r') + if '{0}'.format(opt.src_iteration) in f0['vorticity/complex'].keys(): + f0.close() + break + source_cp += 1 f['vorticity/complex/{0}'.format(0)] = h5py.ExternalLink( src_file, 'vorticity/complex/{0}'.format(opt.src_iteration)) diff --git a/bfps/_code.py b/bfps/_code.py index 221d4b0a0291f316e2595829a39d91d36db82069..faf151559f25078ffbb214659a81f0a2f418b177 100644 --- a/bfps/_code.py +++ b/bfps/_code.py @@ -618,7 +618,8 @@ class _code(_base): nb_threads_per_process, nb_cpus_per_node)) # Warn if some core will not be ued if nb_cpus_per_node%nb_threads_per_process != 0: - warnings.warn("The number of threads is smaller than the number of cores (machine will be underused)", + warnings.warn( + "The number of threads is smaller than the number of cores (machine will be underused)", UserWarning) nb_cpus = nb_mpi_processes*nb_threads_per_process @@ -663,7 +664,9 @@ class _code(_base): opt = parser.parse_args(args) if opt.ncpu != -1: - warnings.warn('ncpu should be replaced by np/ntpp',DeprecationWarning) + warnings.warn( + 'ncpu should be replaced by np/ntpp', + DeprecationWarning) opt.nb_processes = opt.ncpu opt.nb_threads_per_process = 1