The same applies to FileTemplate instances passed to ParameterStudy with the `templates` keyword. """ import os import numpy as np from pwtools import common, batch, sql, comb pj = os.path.join # step 1 # ------ # # Define study_name. Use any string you like. # study_name = "job_" + os.path.basename(common.fullpath(".")) # step 2 # ------ # # Create Machine instances. For each machine, calculations are written to # calc_host0/ and calc_host1/, if requested in ParameterStudy. Job template files # are defined by `filename` or `template`. These are usually shell scripts which # you use on a cluster to submit the job to a batch system such as LSF, PBS, # SLURM, ... # host0 = batch.Machine( hostname="host0", subcmd="bash", scratch="/tmp", filename="calc.templ/job.host0", home="/home/schmerler" ) host1 = batch.Machine(
Result of fft(...) dt : time step area : integral area """ full_faxis = np.fft.fftfreq(full_y.shape[0], dt) split_idx = full_faxis.shape[0]/2 y_out = full_y[:split_idx] faxis = full_faxis[:split_idx] return faxis, num.norm_int(y_out, faxis, area=area) ############################################################################### # common settings for 1d and 3d case ############################################################################### fourier_exe = common.fullpath('~/soft/bin/fourier.x') fourier_dir = '/tmp/fourier_test' use_fourier = os.path.exists(fourier_exe) print "temp dir: %s" %fourier_dir print "trying to find fourier.x: %s" %fourier_exe if use_fourier: print "ok, will use fourier.x" if os.path.exists(fourier_dir): shutil.rmtree(fourier_dir) os.makedirs(fourier_dir) else: os.makedirs(fourier_dir) else: print "not found, will skip fourier.x" # For the calculation of nstep and dt, we increase `fmax` to
Result of fft(...) dt : time step area : integral area """ full_faxis = np.fft.fftfreq(full_y.shape[0], dt) split_idx = full_faxis.shape[0] / 2 y_out = full_y[:split_idx] faxis = full_faxis[:split_idx] return faxis, num.norm_int(y_out, faxis, area=area) ############################################################################### # common settings for 1d and 3d case ############################################################################### fourier_exe = common.fullpath('~/soft/bin/fourier.x') fourier_dir = '/tmp/fourier_test' use_fourier = os.path.exists(fourier_exe) print("temp dir: %s" % fourier_dir) print("trying to find fourier.x: %s" % fourier_exe) if use_fourier: print("ok, will use fourier.x") if os.path.exists(fourier_dir): shutil.rmtree(fourier_dir) os.makedirs(fourier_dir) else: os.makedirs(fourier_dir) else: print("not found, will skip fourier.x") # For the calculation of nstep and dt, we increase `fmax` to
The same applies to FileTemplate instances passed to ParameterStudy with the `templates` keyword. """ import os import numpy as np from pwtools import common, batch, sql, comb pj = os.path.join # step 1 # ------ # # Define study_name. Use any string you like. # study_name = 'job_' + os.path.basename(common.fullpath('.')) # step 2 # ------ # # Create Machine instances. For each machine, calculations are written to # calc_host0/ and calc_host1/, if requested in ParameterStudy. Job template files # are defined by `filename` or `template`. These are usually shell scripts which # you use on a cluster to submit the job to a batch system such as LSF, PBS, # SLURM, ... # host0 = \ batch.Machine(hostname='host0', subcmd='bash', scratch='/tmp', filename='calc.templ/job.host0',