diff --git a/reproducibility_project/clear_folder.py b/reproducibility_project/clear_folder.py index 32f08c72..abe83c6b 100644 --- a/reproducibility_project/clear_folder.py +++ b/reproducibility_project/clear_folder.py @@ -38,7 +38,7 @@ def main(): ): print("-----------------------------------------------------") - if molecule == "waterSPCE" and engine == "mcccs": + if molecule == "benzeneUA" and engine == "mcccs": print( molecule, ensemble, diff --git a/reproducibility_project/find_job.py b/reproducibility_project/find_job.py index 57cf1e06..469583e5 100644 --- a/reproducibility_project/find_job.py +++ b/reproducibility_project/find_job.py @@ -38,7 +38,9 @@ def main(): ): print("-----------------------------------------------------") - if molecule == "ethanolAA" and engine == "mcccs": + jobs = [] + + if molecule == "benzeneUA" and engine == "mcccs": print( molecule, ensemble, @@ -50,7 +52,15 @@ def main(): ) for job in group: - print(job.sp.replica, job) + jobs.append( + [ + job.sp.replica, + str(job), + ] + ) + jobs.sort() + for job in jobs: + print(job) if __name__ == "__main__": diff --git a/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.cool b/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.cool index 0a30b884..0a13a23d 100644 --- a/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.cool +++ b/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.cool @@ -108,7 +108,6 @@ &mc_simple - pm_atom_tra= 0.05 armtra= 1.000000000000000E-002 rmtra= 0.300000000000000 rmrot= 0.400000000000000 diff --git a/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.equil b/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.equil index 7f2dcfec..58cf11e9 100644 --- a/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.equil +++ b/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.equil @@ -108,7 +108,6 @@ &mc_simple - pm_atom_tra= 0.05 armtra= 1.000000000000000E-002 rmtra= 0.300000000000000 rmrot= 0.400000000000000 diff --git a/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.melt b/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.melt index 4b907da2..c2ff29d2 100644 --- a/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.melt +++ b/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.melt @@ -108,7 +108,6 @@ &mc_simple - pm_atom_tra= 0.05 armtra= 1.000000000000000E-002 rmtra= 0.300000000000000 rmrot= 0.400000000000000 diff --git a/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.prod b/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.prod index 633cfbb6..cbb50080 100644 --- a/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.prod +++ b/reproducibility_project/src/engine_input/mcccs/benzeneUA/NPT/fort.4.prod @@ -108,7 +108,6 @@ &mc_simple - pm_atom_tra= 0.05 armtra= 1.000000000000000E-002 rmtra= 0.300000000000000 rmrot= 0.400000000000000 diff --git a/reproducibility_project/src/engines/mcccs/analysis.py b/reproducibility_project/src/engines/mcccs/analysis.py index a8e6b519..09c4c9cd 100644 --- a/reproducibility_project/src/engines/mcccs/analysis.py +++ b/reproducibility_project/src/engines/mcccs/analysis.py @@ -85,6 +85,7 @@ def main(): base_dir = os.getcwd() if ensemble == "NPT": density_list = [] + density_list_logfile = [] for job in group: os.chdir(job.ws) # print(job) @@ -103,15 +104,25 @@ def main(): ) ) density_list.append(avg_one_seed_density_box1(prod_run_files)) - + density_list_logfile.append(density_avg_logfile("log-npt.txt")) # print(density_list) filtered_density_list = list(filter(None, density_list)) - output_string = "The average density is {} g/ml with SEM {} from {} samples".format( + filtered_density_list_logfile = list( + filter(None, density_list_logfile) + ) + output_string = "For NpT cases, the first line is runfile avg and second line is logfile avg\nThe average density is {} g/ml with SEM {} from {} samples\n".format( np.mean(filtered_density_list), np.std(filtered_density_list) / np.sqrt(len(filtered_density_list)), len(filtered_density_list), ) + output_string += "The average density is {} g/ml with SEM {} from {} samples".format( + np.mean(filtered_density_list_logfile), + np.std(filtered_density_list_logfile) + / np.sqrt(len(filtered_density_list_logfile)), + len(filtered_density_list_logfile), + ) + print(output_string) os.chdir(base_dir) with open("density_results.txt", "w") as text_file: @@ -171,6 +182,16 @@ def main(): os.chdir("..") +def density_avg_logfile(logfile): + """Calc average for log files.""" + data = np.loadtxt("log-npt.txt", skiprows=1) + + # Calculate the average of the third from last column (density) + density_column_index = -3 # Third from last column + average_density = np.mean(data[:, density_column_index]) + return average_density + + def avg_one_seed_density_box1(prod_run_files): """For a one particular seed, read all the prod run files and provide the average density (g/ml) for one seed.""" if len(prod_run_files) == 0: diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/benzeneUA_NPT_450.0K_2260.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/benzeneUA_NPT_450.0K_2260.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index 75f42818..ee260103 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/benzeneUA_NPT_450.0K_2260.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/benzeneUA_NPT_450.0K_2260.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1 +1,3 @@ -The average density is 0.698325046875 g/ml with SEM 0.00019497573995066978 from 16 samples +For NpT cases, the first line is runfile avg and second line is logfile avg +The average density is 0.6980418125000001 g/ml with SEM 0.00023460065439170633 from 16 samples +The average density is 0.698041913994141 g/ml with SEM 0.0002348979377991116 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_280.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_280.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index 92a9489a..39f1204c 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_280.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_280.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1 +1,3 @@ -The average density is 0.8132740781250001 g/ml with SEM 0.00022710556005862753 from 16 samples +For NpT cases, the first line is runfile avg and second line is logfile avg +The average density is 0.8127313437499999 g/ml with SEM 0.0002470408075268068 from 16 samples +The average density is 0.8127309012571694 g/ml with SEM 0.00024699982340980933 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_300.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_300.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index f54d9089..770a53c2 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_300.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_300.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1 +1,3 @@ -The average density is 0.7915156250000001 g/ml with SEM 0.00022247973156454715 from 16 samples +For NpT cases, the first line is runfile avg and second line is logfile avg +The average density is 0.7914194531250001 g/ml with SEM 0.00021111305682752364 from 16 samples +The average density is 0.7914208917911247 g/ml with SEM 0.00021123437103423662 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_320.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_320.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index 18dafd82..fab93a51 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_320.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/ethanolAA_NPT_320.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1 +1,3 @@ -The average density is 0.76872575 g/ml with SEM 0.00020045779758662987 from 16 samples +For NpT cases, the first line is runfile avg and second line is logfile avg +The average density is 0.76839096875 g/ml with SEM 0.00020634974964182785 from 16 samples +The average density is 0.7683913005838312 g/ml with SEM 0.0002062944575966398 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/methaneUA_GEMC-NVT_140.0K_1318.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/methaneUA_GEMC-NVT_140.0K_1318.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index fde573ed..e02a400c 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/methaneUA_GEMC-NVT_140.0K_1318.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/methaneUA_GEMC-NVT_140.0K_1318.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1,2 +1,2 @@ -Box1 The average density is 0.374604859375 g/ml with SEM 3.351215358442761e-05 from 16 samples +Box1 The average density is 0.374604859375 g/ml with SEM 3.3512153584427606e-05 from 16 samples Box2 The average density is 0.010456921875 g/ml with SEM 1.4941499182717499e-05 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/methaneUA_NPT_140.0K_1318.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/methaneUA_NPT_140.0K_1318.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index a196458b..b4646f7d 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/methaneUA_NPT_140.0K_1318.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/methaneUA_NPT_140.0K_1318.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1 +1,3 @@ -The average density is 0.375760578125 g/ml with SEM 4.58862635118307e-05 from 16 samples +For NpT cases, the first line is runfile avg and second line is logfile avg +The average density is 0.375760578125 g/ml with SEM 4.588626351183069e-05 from 16 samples +The average density is 0.3757593605773165 g/ml with SEM 4.592843462569958e-05 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/pentaneUA-constrain_bonds_GEMC-NVT_372.0K_1402.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/pentaneUA-constrain_bonds_GEMC-NVT_372.0K_1402.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index dee1858d..5d752271 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/pentaneUA-constrain_bonds_GEMC-NVT_372.0K_1402.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/pentaneUA-constrain_bonds_GEMC-NVT_372.0K_1402.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1,2 +1,2 @@ -Box1 The average density is 0.538999234375 g/ml with SEM 7.901658581811365e-05 from 16 samples -Box2 The average density is 0.02035428125 g/ml with SEM 3.284094656059866e-05 from 16 samples +Box1 The average density is 0.5389992343750001 g/ml with SEM 7.901658581811365e-05 from 16 samples +Box2 The average density is 0.02035428125 g/ml with SEM 3.284094656059865e-05 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/pentaneUA-constrain_bonds_NPT_372.0K_1402.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/pentaneUA-constrain_bonds_NPT_372.0K_1402.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index 3d4a61af..26a0c86d 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/pentaneUA-constrain_bonds_NPT_372.0K_1402.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/pentaneUA-constrain_bonds_NPT_372.0K_1402.0kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1 +1,3 @@ -The average density is 0.5410875312499999 g/ml with SEM 8.71734668226038e-05 from 16 samples +For NpT cases, the first line is runfile avg and second line is logfile avg +The average density is 0.54108753125 g/ml with SEM 8.71734668226038e-05 from 16 samples +The average density is 0.5410886453415662 g/ml with SEM 8.653017097453927e-05 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_280.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_280.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index 4e574bf5..a27c2c45 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_280.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_280.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1 +1,3 @@ -The average density is 1.0072252343750001 g/ml with SEM 0.00047373785257594106 from 16 samples +For NpT cases, the first line is runfile avg and second line is logfile avg +The average density is 1.00705103125 g/ml with SEM 0.0003472372551509214 from 16 samples +The average density is 1.0070531403810825 g/ml with SEM 0.00034683889433465964 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_300.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_300.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index 8dc66289..301eef01 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_300.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_300.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1 +1,3 @@ -The average density is 0.9977669062499999 g/ml with SEM 0.0003959896293592313 from 16 samples +For NpT cases, the first line is runfile avg and second line is logfile avg +The average density is 0.99770809375 g/ml with SEM 0.0003722279679110896 from 16 samples +The average density is 0.9977080406908347 g/ml with SEM 0.00037210745263542696 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_320.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt b/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_320.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt index 58a890c2..bf8f6dee 100644 --- a/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_320.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt +++ b/reproducibility_project/src/engines/mcccs/analysis_data/waterSPCE_NPT_320.0K_101.325kPa_cutoff_hard_lrc_energy_pressure/density_results.txt @@ -1 +1,3 @@ -The average density is 0.9861051249999999 g/ml with SEM 0.00017870171851222096 from 16 samples +For NpT cases, the first line is runfile avg and second line is logfile avg +The average density is 0.986137296875 g/ml with SEM 0.0002256395199824372 from 16 samples +The average density is 0.9861366533115048 g/ml with SEM 0.0002257823152641847 from 16 samples diff --git a/reproducibility_project/src/engines/mcccs/project.py b/reproducibility_project/src/engines/mcccs/project.py index 009cd3fe..4855ed63 100644 --- a/reproducibility_project/src/engines/mcccs/project.py +++ b/reproducibility_project/src/engines/mcccs/project.py @@ -287,7 +287,17 @@ def sanitize_npt_log(step, job): """Sanitize the output logs for NPT simulations.""" import numpy as np - mw = job.sp.mass + masses = { + "methaneUA": 16.043, + "pentaneUA-flexible_bonds": 72.151, + "pentaneUA-constrain_bonds": 72.151, + "benzeneUA": 78.114, + "waterSPCE": 18.015324, + "ethanolAA": 46.068672, + } + + mw = masses[job.sp.molecule] + print("sanitizing for", job, "molecule =", job.sp.molecule, "mw=", mw) temp = job.sp.temperature files = sorted(glob("fort*12*{}*".format(step))) arrays = []