def task_correlators(): for dirname in directories: for meson in ['pion', 'kaon']: corr_tsv_files = [] for corr_xml in glob.glob(os.path.join(dirname, 'corr', 'corr.config-*.{}.xml.gz'.format(meson))): corr_tsv = names.correlator_tsv(corr_xml, meson) corr_tsv_files.append(corr_tsv) yield make_single_transform(dirname, correlators.io_extract_pion_corr, corr_xml, corr_tsv) if len(corr_tsv_files) > 0: path_pion_mass = names.tsv_extract(dirname, meson + '_mass') yield { 'actions': [(correlators.analysis.io_extract_mass, [corr_tsv_files, path_pion_mass])], 'name': path_pion_mass, 'file_dep': corr_tsv_files, 'targets': [path_pion_mass], } path_effective_mass = names.tsv_extract(dirname, meson + '_effective_mass') yield { 'actions': [(correlators.analysis.io_effective_mass, [corr_tsv_files, path_effective_mass])], 'name': path_effective_mass, 'file_dep': corr_tsv_files, 'targets': [path_effective_mass], }
def task_running_mean(): for dirname in directories: for window in [100, 10]: path_in = names.tsv_extract(dirname, 'AcceptP') path_out = names.tsv_extract(dirname, 'AcceptP-running_mean_{}'.format(window)) yield make_single_transform(dirname, transforms.io_running_mean, path_in, path_out, window=window)
def task_wflow(): for dirname in directories: files_t0 = [] files_w0 = [] for xml_file in glob.glob(os.path.join(dirname, 'wflow', 'wflow.config-*.out.xml')): file_e = names.wflow_xml_shard_name(xml_file, 'e') file_t2e = names.wflow_xml_shard_name(xml_file, 't2e') file_w = names.wflow_xml_shard_name(xml_file, 'w') file_t0 = names.wflow_xml_shard_name(xml_file, 't0') file_w0 = names.wflow_xml_shard_name(xml_file, 'w0') files_t0.append(file_t0) files_w0.append(file_w0) yield make_single_transform(dirname, wflow.io_convert_xml_to_tsv, xml_file, file_e) yield make_single_transform(dirname, wflow.io_compute_t2_e, file_e, file_t2e) yield make_single_transform(dirname, wflow.io_compute_w, file_e, file_w) yield make_single_transform(dirname, wflow.io_compute_intersection, file_t2e, file_t0) yield make_single_transform(dirname, wflow.io_compute_intersection, file_w, file_w0) for name, files in [('t0', files_t0), ('w0', files_w0)]: path_out = names.wflow_tsv(dirname, name) yield { 'actions': [(wflow.merge_intersections, [files, path_out])], 'name': path_out, 'file_dep': files, 'targets': [path_out], } yield make_single_transform(dirname, wflow.io_w0_to_a, names.tsv_extract(dirname, 'w0'), names.tsv_extract(dirname, 'a_mev_from_w0'))
def task_make_plot(): tasks = [] for dirname in directories: tasks.append(plot_generic(dirname, 'w_plaq', 'Update Number', 'Plaquette (cold is 1.0)', 'Plaquette')) #tasks.append(plot_generic(dirname, 'w_plaq-vs-md_time', 'MD Time', 'Plaquette (cold is 1.0)', 'Plaquette')) tasks.append(plot_generic(dirname, 'deltaH', 'Update Number', r'$\Delta H$', 'MD Energy')) #tasks.append(plot_generic(dirname, 'deltaH-vs-md_time', 'MD Time', r'$\Delta H$', 'MD Energy', transform_delta_h_md_time)) tasks.append(plot_generic(dirname, 'minutes_for_trajectory', 'Update Number', r'Minutes', 'Time for Trajectory')) tasks.append(plot_generic(dirname, 'n_steps', 'Update Number', r'Step Count (coarsest time scale)', 'Integration Steps')) #tasks.append(plot_generic(dirname, 'n_steps-vs-md_time', 'MD Time', r'Step Count (coarsest time scale)', 'Integration Steps')) tasks.append(plot_generic(dirname, 'md_time', 'Update Number', r'MD Time', 'MD Distance')) tasks.append(plot_generic(dirname, 'tau0', 'Update Number', r'MD Step Size', 'MD Step Size')) tasks.append(plot_generic(dirname, 'DeltaDeltaH', 'Update Number', r'$\Delta \Delta H$', 'Reversibility')) tasks.append(plot_generic(dirname, 'DeltaDeltaH_over_DeltaH', 'Update Number', r'$\Delta \Delta H / \Delta H$', 'Reversibility')) tasks.append(plot_generic(dirname, 'exp_deltaH', 'Update Number', r'$\exp(-\Delta H)$', 'MD EnergeReversibility')) tasks.append(plot_generic(dirname, 't0', 'Update Number', r'$t_0$', 'Wilson Flow Scale Setting')) tasks.append(plot_generic(dirname, 'w0', 'Update Number', r'$w_0$', 'Wilson Flow Scale Setting')) tasks.append(plot_generic(dirname, 'AcceptP', 'Update Number', r'Accepted', 'Acceptance Rate')) tasks.append(plot_generic(dirname, 'AcceptP-running_mean_100', 'Update Number', r'Running mean (100 step window)', 'Acceptance Rate')) tasks.append(plot_generic(dirname, 'AcceptP-running_mean_10', 'Update Number', r'Running mean (10 step window)', 'Acceptance Rate')) path_out = names.tsv_extract(dirname, 'AcceptP-running_mean_100') for task in tasks: for subtask in task: yield subtask
def plot_generic(dirname, name, *args, **kwargs): path_in = names.tsv_extract(dirname, name) path_out = names.plot(dirname, name) yield { 'actions': [(visualizers.plot_generic, [path_in, path_out] + list(args), kwargs)], 'name': path_out, 'file_dep': [path_in], 'targets': [path_out], } path_out = names.plot(dirname, name + '_autoy') kwargs = dict(kwargs) kwargs['use_auto_ylim'] = True yield { 'actions': [(visualizers.plot_generic, [path_in, path_out] + list(args), kwargs)], 'name': path_out, 'file_dep': [path_in], 'targets': [path_out], }