diff --git a/Examples/Bae-Mixture/output.txt b/Examples/Bae-Mixture/output.txt index 5133194..36c6877 100644 --- a/Examples/Bae-Mixture/output.txt +++ b/Examples/Bae-Mixture/output.txt @@ -1,5 +1,5 @@ -/home/z/Desktop/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined -True path of exe is /home/z/Desktop/gRASPA_fork/src_clean/ +/home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined +True path of exe is /home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/ There are 1 simulations running only one simulation ------------------PARSING FORCE FIELD MIXING RULES---------------- @@ -302,6 +302,9 @@ Parsing [1] Component Component 0 starts at line number 33 -------------- READING AdsorbateComponent 0 (CO2) -------------- Adsorbate Component is rigid +O_co2, type: 7, Acharge = -0.35000 +C_co2, type: 6, Acharge = 0.70000 +O_co2, type: 7, Acharge = -0.35000 Bonds not implemented. Break Atom [0]: Type [7], Name: O_co2, Mass: 15.999400, position: 0.00000 0.00000 -1.16000 Atom [1]: Type [6], Name: C_co2, Mass: 12.000000, position: 0.00000 0.00000 0.00000 @@ -330,6 +333,7 @@ Parsing [2] Component Component 1 starts at line number 44 -------------- READING AdsorbateComponent 1 (methane) -------------- Adsorbate Component is rigid +CH4_sp3, type: 5, Acharge = 0.00000 Bonds not implemented. Break Atom [0]: Type [5], Name: CH4_sp3, Mass: 16.000000, position: 0.00000 0.00000 0.00000 Adsorbate Type[5], Name: CH4_sp3, #: 1 @@ -375,23 +379,31 @@ Component [2] (methane), Mol Fraction: 0.50000 Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [0-2], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-2], VDW: 0.00000, Real: 0.00000 +Compoent [2-2], VDW: 0.00000, Real: 0.00000 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 0.00000, Host-Host Fourier: 45015.24699, Framework-Guest Fourier: 0.00000 -Component: 0, SelfAtomE: 9563024.14332 -Component: 1, SelfAtomE: 0.00000 -Component: 2, SelfAtomE: 0.00000 -Component: 0, Intra-Molecular ExclusionE: 9909165.51672 -Component: 1, Intra-Molecular ExclusionE: 0.00000 -Component: 2, Intra-Molecular ExclusionE: 0.00000 -HostEwald took 0.41062 sec -Component 0, Intra Exclusion Energy: -9909165.51672 -Component 0, Atom Self Exclusion Energy: 9563024.14332 +CPU Guest-Guest Fourier: 0.00000, Host-Host Fourier: 45015.24699, Framework-Guest Fourier: 0.00000 +Component: 0, SelfAtomE: 9563024.14332 (11501681.37235 kJ/mol) +Component: 1, SelfAtomE: 0.00000 (0.00000 kJ/mol) +Component: 2, SelfAtomE: 0.00000 (0.00000 kJ/mol) +Component: 0, Intra-Molecular ExclusionE: 9909165.51672 (11917994.00807 kJ/mol) +Component: 1, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) +Component: 2, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) +HostEwald took 0.40993 sec +Ewald Summation (total energy) on the CPU took 0.40993 secs +Component 0, Intra Exclusion Energy: -9909165.51672 (-11917994.00807 kJ/mol) +Component 0, Atom Self Exclusion Energy: 9563024.14332 (11501681.37235 kJ/mol) DEBUG: comp: 0, IntraE: -9909165.51672, SelfE: 9563024.14332 -Component 1, Intra Exclusion Energy: -15222.08930 -Component 1, Atom Self Exclusion Energy: 15270.98300 +Component 1, Intra Exclusion Energy: -15222.08930 (-18307.97646 kJ/mol) +Component 1, Atom Self Exclusion Energy: 15270.98300 (18366.78210 kJ/mol) DEBUG: comp: 1, IntraE: -15222.08930, SelfE: 15270.98300 -Component 2, Intra Exclusion Energy: 0.00000 -Component 2, Atom Self Exclusion Energy: 0.00000 +Component 2, Intra Exclusion Energy: 0.00000 (0.00000 kJ/mol) +Component 2, Atom Self Exclusion Energy: 0.00000 (0.00000 kJ/mol) DEBUG: comp: 2, IntraE: 0.00000, SelfE: 0.00000 ****** Allocating Ewald WaveVectors (INITIAL STAGE ONLY) ****** Allocated 155520 155520 168480 space for eikxyz @@ -428,10 +440,22 @@ Framework Wave Vector 6, real: -0.00000 imag: 0.00000 Framework Wave Vector 7, real: -0.00000 imag: -0.00000 Framework Wave Vector 8, real: -0.00000 imag: -0.00000 Framework Wave Vector 9, real: -0.00000 imag: -0.00000 -GPU Ewald: 45015.24699 -Ewald Summation (total energy) on the CPU took 0.41062 secs -Ewald Summation (total energy) on the GPU took 0.00598 secs i: 3, j: 3, Ni: 432, Nj: 432, E: -346.58035 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 3240, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +VDW + Real on the GPU took 0.00000 secs +GPU Ewald Summary: NHostAtom: 3240, NGuestAtom: 0 +GPU Ewald Summary: Nthread: 128, Host thread: 128, Guest thread: 0 +Host NAtomPerThread: 25, Guest NAtomPerThread: 0 +Host residueAtoms: 40, Guest residueAtoms: 0 +GPU fourier, HHFourier: 45015.24699, GGFourier: 0.00000, HGFourier: 0.00000, TOTFourier: 45015.24699 +Framework Component 0 Exclusion: 346141.37340 +Ewald Summation (total energy) on the GPU took 0.00800 secs +i: 3, j: 3, Ni: 432, Nj: 432, E: -346.58035 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 391156.62038, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: -346.58035, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING INITIAL STAGE ENERGY ====================== Component 1, Need to create 0 full molecule Component 2, Need to create 0 full molecule @@ -440,15 +464,23 @@ Component 2, Need to create 0 full molecule Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [0-2], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-2], VDW: 0.00000, Real: 0.00000 +Compoent [2-2], VDW: 0.00000, Real: 0.00000 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 0.00000, Host-Host Fourier: 45015.24699, Framework-Guest Fourier: 0.00000 -Component: 0, SelfAtomE: 9563024.14332 -Component: 1, SelfAtomE: 0.00000 -Component: 2, SelfAtomE: 0.00000 -Component: 0, Intra-Molecular ExclusionE: 9909165.51672 -Component: 1, Intra-Molecular ExclusionE: 0.00000 -Component: 2, Intra-Molecular ExclusionE: 0.00000 -HostEwald took 0.41142 sec +CPU Guest-Guest Fourier: 0.00000, Host-Host Fourier: 45015.24699, Framework-Guest Fourier: 0.00000 +Component: 0, SelfAtomE: 9563024.14332 (11501681.37235 kJ/mol) +Component: 1, SelfAtomE: 0.00000 (0.00000 kJ/mol) +Component: 2, SelfAtomE: 0.00000 (0.00000 kJ/mol) +Component: 0, Intra-Molecular ExclusionE: 9909165.51672 (11917994.00807 kJ/mol) +Component: 1, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) +Component: 2, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) +HostEwald took 0.40863 sec +Ewald Summation (total energy) on the CPU took 0.40863 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -471,17 +503,26 @@ Framework Wave Vector 6, real: -0.00000 imag: 0.00000 Framework Wave Vector 7, real: -0.00000 imag: -0.00000 Framework Wave Vector 8, real: -0.00000 imag: -0.00000 Framework Wave Vector 9, real: -0.00000 imag: -0.00000 -GPU Ewald: 45015.24699 -Ewald Summation (total energy) on the CPU took 0.41142 secs -Ewald Summation (total energy) on the GPU took 0.00120 secs i: 3, j: 3, Ni: 432, Nj: 432, E: -346.58035 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 3240, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +VDW + Real on the GPU took 0.00000 secs +GPU Ewald Summary: NHostAtom: 3240, NGuestAtom: 0 +GPU Ewald Summary: Nthread: 128, Host thread: 128, Guest thread: 0 +Host NAtomPerThread: 25, Guest NAtomPerThread: 0 +Host residueAtoms: 40, Guest residueAtoms: 0 +GPU fourier, HHFourier: 45015.24699, GGFourier: 0.00000, HGFourier: 0.00000, TOTFourier: 45015.24699 +Framework Component 0 Exclusion: 346141.37340 +Ewald Summation (total energy) on the GPU took 0.00276 secs +i: 3, j: 3, Ni: 432, Nj: 432, E: -346.58035 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 391156.62038, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: -346.58035, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING CREATE_MOLECULE STAGE ENERGY ====================== Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.03011, temp: 296.00000 Number of Frameworks: 1 INITIALIZATION Cycle: 0, 1 Adsorbate Molecules, Total Energy: 389780.06339 || Component 0 [MATVAF_clean-Bae-PartialCharge-fixed-Original-N2-Charge.cif], 1 Molecules || Component 1 [CO2], 1 Molecules || Component 2 [methane], 0 Molecules || -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -1075.17531, HGReal: 399.72598, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: -32.03727, GGEwaldE: 0.00120, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 INITIALIZATION Cycle: 5000, 184 Adsorbate Molecules, Total Energy: 24501.55087 || Component 0 [MATVAF_clean-Bae-PartialCharge-fixed-Original-N2-Charge.cif], 1 Molecules || Component 1 [CO2], 146 Molecules || Component 2 [methane], 38 Molecules || INITIALIZATION Cycle: 10000, 243 Adsorbate Molecules, Total Energy: -106237.97580 || Component 0 [MATVAF_clean-Bae-PartialCharge-fixed-Original-N2-Charge.cif], 1 Molecules || Component 1 [CO2], 197 Molecules || Component 2 [methane], 46 Molecules || INITIALIZATION Cycle: 15000, 260 Adsorbate Molecules, Total Energy: -156250.08132 || Component 0 [MATVAF_clean-Bae-PartialCharge-fixed-Original-N2-Charge.cif], 1 Molecules || Component 1 [CO2], 223 Molecules || Component 2 [methane], 37 Molecules || @@ -540,9 +581,6 @@ Printing: Component: 2 [ methane ], NumMol: 37, Molsize: 1 Component 0, Molsize: 3240 Component 1, Molsize: 3 Component 2, Molsize: 1 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -98.86231, HGReal: 0.00000, GGVDW: 156.94021, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 PRODUCTION Cycle: 5000, 283 Adsorbate Molecules, Total Energy: -232415.92033 || Component 0 [MATVAF_clean-Bae-PartialCharge-fixed-Original-N2-Charge.cif], 1 Molecules || Component 1 [CO2], 252 Molecules || Component 2 [methane], 31 Molecules || Printing: Component: 0 [ MATVAF_clean-Bae-PartialCharge-fixed-Original-N2-Charge.cif ], NumMol: 1, Molsize: 3240 Printing: Component: 1 [ CO2 ], NumMol: 252, Molsize: 3 @@ -831,13 +869,75 @@ BLOCK [4], Blocksize: 20000, Average: 12.28549, ErrorBar: 3.05471 Overall: Average: 13.44164, ErrorBar: 1.90427 ---------------------------------------------------------- ============================================================== +=====================Rosenbluth Summary===================== +There are 5 blocks +=====BLOCK 0===== +Widom Performed: 1009.0 +Framework Density: 877.96524 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 71.8537329795 +(Total) Averaged Excess Mu: -1264.6963750499 +(Total) Averaged Henry Coefficient: 0.0000332542 +(Total) Converted to Fugacity: 236969.7232838897 [Pascal], Temp: 296.00000 [K] +Framework Density: 877.96524 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 71.8537329795 +(Insertion) Averaged Excess Mu: -1264.6963750499 +(Insertion) Converted to Fugacity: 236969.7232838897 [Pascal], Temp: 296.00000 [K] +=====BLOCK 1===== +Widom Performed: 919.0 +Framework Density: 877.96524 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 56.7371845676 +(Total) Averaged Excess Mu: -1194.8132290024 +(Total) Averaged Henry Coefficient: 0.0000262582 +(Total) Converted to Fugacity: 300105.8186237355 [Pascal], Temp: 296.00000 [K] +Framework Density: 877.96524 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 56.7371845676 +(Insertion) Averaged Excess Mu: -1194.8132290024 +(Insertion) Converted to Fugacity: 300105.8186237355 [Pascal], Temp: 296.00000 [K] +=====BLOCK 2===== +Widom Performed: 1025.0 +Framework Density: 877.96524 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 50.3046586630 +(Total) Averaged Excess Mu: -1159.2116677136 +(Total) Averaged Henry Coefficient: 0.0000232812 +(Total) Converted to Fugacity: 338480.7624901723 [Pascal], Temp: 296.00000 [K] +Framework Density: 877.96524 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 50.3046586630 +(Insertion) Averaged Excess Mu: -1159.2116677136 +(Insertion) Converted to Fugacity: 338480.7624901723 [Pascal], Temp: 296.00000 [K] +=====BLOCK 3===== +Widom Performed: 989.0 +Framework Density: 877.96524 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 75.5843641797 +(Total) Averaged Excess Mu: -1279.6719253631 +(Total) Averaged Henry Coefficient: 0.0000349807 +(Total) Converted to Fugacity: 225273.5655828447 [Pascal], Temp: 296.00000 [K] +Framework Density: 877.96524 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 75.5843641797 +(Insertion) Averaged Excess Mu: -1279.6719253631 +(Insertion) Converted to Fugacity: 225273.5655828447 [Pascal], Temp: 296.00000 [K] +=====BLOCK 4===== +Widom Performed: 978.0 +Framework Density: 877.96524 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 52.7933587630 +(Total) Averaged Excess Mu: -1173.4981105016 +(Total) Averaged Henry Coefficient: 0.0000244330 +(Total) Converted to Fugacity: 322524.6436300247 [Pascal], Temp: 296.00000 [K] +Framework Density: 877.96524 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 52.7933587630 +(Insertion) Averaged Excess Mu: -1173.4981105016 +(Insertion) Converted to Fugacity: 322524.6436300247 [Pascal], Temp: 296.00000 [K] +=========================AVERAGE======================== +Averaged Rosenbluth Weight: 61.4546598306 +/- 20.5793003268 +Averaged Excess Chemical Potential: -1214.3782615262 +/- 97.5397576547 +Averaged Henry Coefficient [mol/kg/Pa]: 2.844144131e-05 +/- 9.52417545e-06 +Averaged Fugacity: 284670.9027221334 +/- 91082.7734180518 Printing: Component: 0 [ MATVAF_clean-Bae-PartialCharge-fixed-Original-N2-Charge.cif ], NumMol: 1, Molsize: 3240 Printing: Component: 1 [ CO2 ], NumMol: 278, Molsize: 3 Printing: Component: 2 [ methane ], NumMol: 28, Molsize: 1 Component 0, Molsize: 3240 Component 1, Molsize: 3 Component 2, Molsize: 1 -Work took 16.781124 seconds +Work took 16.725032 seconds ====================================== CHECKING FINAL ENERGY FOR SYSTEM [0] ====================================== @@ -846,15 +946,23 @@ CHECKING FINAL ENERGY FOR SYSTEM [0] Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: -496169.74937; Real: -75763.09704 Guest-Guest VDW: -91929.03257; Real: -26159.72209 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: -461750.90439, Real: -75763.09704 +Compoent [0-2], VDW: -34418.84498, Real: 0.00000 +Compoent [1-1], VDW: -80449.58729, Real: -26159.72209 +Compoent [1-2], VDW: -10940.01412, Real: 0.00000 +Compoent [2-2], VDW: -539.43115, Real: 0.00000 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 11368.11634, Host-Host Fourier: 45015.24699, Framework-Guest Fourier: -10278.63639 -Component: 0, SelfAtomE: 9563024.14332 -Component: 1, SelfAtomE: 4245333.27328 -Component: 2, SelfAtomE: 0.00000 -Component: 0, Intra-Molecular ExclusionE: 9909165.51672 -Component: 1, Intra-Molecular ExclusionE: 4231740.82451 -Component: 2, Intra-Molecular ExclusionE: 0.00000 -HostEwald took 0.44511 sec +CPU Guest-Guest Fourier: 11368.11634, Host-Host Fourier: 45015.24699, Framework-Guest Fourier: -10278.63639 +Component: 0, SelfAtomE: 9563024.14332 (11501681.37235 kJ/mol) +Component: 1, SelfAtomE: 4245333.27328 (5105965.42441 kJ/mol) +Component: 2, SelfAtomE: 0.00000 (0.00000 kJ/mol) +Component: 0, Intra-Molecular ExclusionE: 9909165.51672 (11917994.00807 kJ/mol) +Component: 1, Intra-Molecular ExclusionE: 4231740.82451 (5089617.45619 kJ/mol) +Component: 2, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) +HostEwald took 0.44556 sec +Ewald Summation (total energy) on the CPU took 0.44556 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -877,12 +985,32 @@ Framework Wave Vector 6, real: -0.00000 imag: 0.00000 Framework Wave Vector 7, real: -0.00000 imag: -0.00000 Framework Wave Vector 8, real: -0.00000 imag: -0.00000 Framework Wave Vector 9, real: -0.00000 imag: -0.00000 +i: 3, j: 3, Ni: 432, Nj: 432, E: -346.58035 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 3240, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 3240 862 +Interactions: 0 2792880 371091 +Nblock 248, blocks: 0 219 29, threads needed: 0 27929 3711, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -496169.74937, HGReal: -75763.09704, GGVDW: -91929.03257, GGReal: -26159.72209, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00088 secs +GPU Ewald Summary: NHostAtom: 3240, NGuestAtom: 862 +GPU Ewald Summary: Nthread: 128, Host thread: 101, Guest thread: 27 +Host NAtomPerThread: 32, Guest NAtomPerThread: 31 +Host residueAtoms: 8, Guest residueAtoms: 25 +GPU fourier, HHFourier: 45015.24699, GGFourier: 11368.11634, HGFourier: -10278.63639, TOTFourier: 46104.72694 +Framework Component 0 Exclusion: 346141.37340 Component 1, Nblock: 3, Nthread: 128 +Component 1, Exclusion (self + intra) = -13592.44877 Component 2, Nblock: 1, Nthread: 128 -GPU Ewald: 35057.85423 -Ewald Summation (total energy) on the CPU took 0.44512 secs -Ewald Summation (total energy) on the GPU took 0.00163 secs +Component 2, Exclusion (self + intra) = 0.00000 +Ewald Summation (total energy) on the GPU took 0.00322 secs i: 3, j: 3, Ni: 432, Nj: 432, E: -346.58035 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -496169.74937, HGReal: -75763.09704, GGVDW: -91929.03257, GGReal: -26159.72209, HHEwaldE: 391156.62038, HGEwaldE: -10278.63639, GGEwaldE: -2224.33243, TailE: -346.58035, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING FINAL STAGE ENERGY ====================== ====================================== ======================== ENERGY SUMMARY (Simulation 0) ========================= @@ -976,7 +1104,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -702524.56987 (-844943.36079 [K]) ======================================================================== - *** CHECK DELTA_E (FINAL - CREATE MOLECULE) *** + *** CHECK DELTA_E (RUNNING FINAL - CREATE MOLECULE) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: -496169.74937 (-596755.40690 [K]) @@ -991,7 +1119,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -702524.56987 (-844943.36078 [K]) ======================================================================== - *** ENERGY DRIFT *** + *** ENERGY DRIFT (CPU FINAL - RUNNING FINAL) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -1005,6 +1133,21 @@ Ewald [Guest-Guest]: -0.00000 (-0.00000 [K]) DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -0.00000 (-0.00000 [K]) +======================================================================== + *** GPU DRIFT (GPU FINAL - CPU FINAL) *** +======================================================================== +VDW [Host-Host]: 0.00000 (0.00000 [K]) +VDW [Host-Guest]: -0.00000 (-0.00000 [K]) +VDW [Guest-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Host]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Guest-Guest]: 0.00000 (0.00000 [K]) +Ewald [Host-Host]: -0.00000 (-0.00000 [K]) +Ewald [Host-Guest]: -0.00000 (-0.00000 [K]) +Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) +DNN Energy: 0.00000 (0.00000 [K]) +Tail Correction Energy: 0.00000 (0.00000 [K]) +Total Energy: 0.00000 (0.00000 [K]) ======================================================================== ================================================================================ ======================== PRODUCTION PHASE AVERAGE ENERGIES (Simulation 0) ========================= @@ -1063,8 +1206,8 @@ PseudoAtom Type: Zn[4], #: 72 PseudoAtom Type: CH4_sp3[5], #: 28 PseudoAtom Type: C_co2[6], #: 278 PseudoAtom Type: O_co2[7], #: 556 -Total Program Size: 5590 MB -Resident Set Size: 130 MB -Shared Pages: 94 MB +Total Program Size: 5596 MB +Resident Set Size: 135 MB +Shared Pages: 95 MB Text (code): 0 MB -Data + Stack: 80 MB +Data + Stack: 86 MB diff --git a/Examples/CO2-MFI/output.txt b/Examples/CO2-MFI/output.txt index f5b0ed1..7bc26d9 100644 --- a/Examples/CO2-MFI/output.txt +++ b/Examples/CO2-MFI/output.txt @@ -1,5 +1,5 @@ -/home/z/Desktop/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined -True path of exe is /home/z/Desktop/gRASPA_fork/src_clean/ +/home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined +True path of exe is /home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/ There are 1 simulations running only one simulation ------------------PARSING FORCE FIELD MIXING RULES---------------- @@ -2572,6 +2572,9 @@ Parsing [1] Component Component 0 starts at line number 33 -------------- READING AdsorbateComponent 0 (CO2) -------------- Adsorbate Component is rigid +O_co2, type: 17, Acharge = -0.32560 +C_co2, type: 16, Acharge = 0.65120 +O_co2, type: 17, Acharge = -0.32560 Bonds not implemented. Break Atom [0]: Type [17], Name: O_co2, Mass: 15.999400, position: 0.00000 0.00000 -1.16000 Atom [1]: Type [16], Name: C_co2, Mass: 12.000000, position: 0.00000 0.00000 0.00000 @@ -2615,18 +2618,23 @@ Box Temperature: 298.00000 Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 0.00000, Real: 0.00000 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 0.00000, Host-Host Fourier: 409293.46532, Framework-Guest Fourier: 0.00000 -Component: 0, SelfAtomE: 100586536.82400 -Component: 1, SelfAtomE: 0.00000 -Component: 0, Intra-Molecular ExclusionE: 115033008.45111 -Component: 1, Intra-Molecular ExclusionE: 0.00000 -HostEwald took 0.20101 sec -Component 0, Intra Exclusion Energy: -115033008.45111 -Component 0, Atom Self Exclusion Energy: 100586536.82400 +CPU Guest-Guest Fourier: 0.00000, Host-Host Fourier: 409293.46532, Framework-Guest Fourier: 0.00000 +Component: 0, SelfAtomE: 100586536.82400 (120977870.55210 kJ/mol) +Component: 1, SelfAtomE: 0.00000 (0.00000 kJ/mol) +Component: 0, Intra-Molecular ExclusionE: 115033008.45111 (138352992.80625 kJ/mol) +Component: 1, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) +HostEwald took 0.20098 sec +Ewald Summation (total energy) on the CPU took 0.20098 secs +Component 0, Intra Exclusion Energy: -115033008.45111 (-138352992.80625 kJ/mol) +Component 0, Atom Self Exclusion Energy: 100586536.82400 (120977870.55210 kJ/mol) DEBUG: comp: 0, IntraE: -115033008.45111, SelfE: 100586536.82400 -Component 1, Intra Exclusion Energy: -13173.67573 -Component 1, Atom Self Exclusion Energy: 13215.98988 +Component 1, Intra Exclusion Energy: -13173.67573 (-15844.29972 kJ/mol) +Component 1, Atom Self Exclusion Energy: 13215.98988 (15895.19197 kJ/mol) DEBUG: comp: 1, IntraE: -13173.67573, SelfE: 13215.98988 ****** Allocating Ewald WaveVectors (INITIAL STAGE ONLY) ****** Allocated 110592 110592 73728 space for eikxyz @@ -2663,9 +2671,20 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: -0.00000 imag: -0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: -0.00000 -GPU Ewald: 409293.46532 -Ewald Summation (total energy) on the CPU took 0.20101 secs -Ewald Summation (total energy) on the GPU took 0.00548 secs +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 2304, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +VDW + Real on the GPU took 0.00000 secs +GPU Ewald Summary: NHostAtom: 2304, NGuestAtom: 0 +GPU Ewald Summary: Nthread: 128, Host thread: 128, Guest thread: 0 +Host NAtomPerThread: 18, Guest NAtomPerThread: 0 +Host residueAtoms: 0, Guest residueAtoms: 0 +GPU fourier, HHFourier: 409293.46532, GGFourier: 0.00000, HGFourier: 0.00000, TOTFourier: 409293.46532 +Framework Component 0 Exclusion: 14446471.62713 +Ewald Summation (total energy) on the GPU took 0.00657 secs +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 14855765.09245, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING INITIAL STAGE ENERGY ====================== Component 1, Need to create 0 full molecule ======================== CALCULATING CREATE_MOLECULE STAGE ENERGY ======================== @@ -2673,13 +2692,18 @@ Component 1, Need to create 0 full molecule Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 0.00000, Real: 0.00000 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 0.00000, Host-Host Fourier: 409293.46532, Framework-Guest Fourier: 0.00000 -Component: 0, SelfAtomE: 100586536.82400 -Component: 1, SelfAtomE: 0.00000 -Component: 0, Intra-Molecular ExclusionE: 115033008.45111 -Component: 1, Intra-Molecular ExclusionE: 0.00000 -HostEwald took 0.20025 sec +CPU Guest-Guest Fourier: 0.00000, Host-Host Fourier: 409293.46532, Framework-Guest Fourier: 0.00000 +Component: 0, SelfAtomE: 100586536.82400 (120977870.55210 kJ/mol) +Component: 1, SelfAtomE: 0.00000 (0.00000 kJ/mol) +Component: 0, Intra-Molecular ExclusionE: 115033008.45111 (138352992.80625 kJ/mol) +Component: 1, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) +HostEwald took 0.19995 sec +Ewald Summation (total energy) on the CPU took 0.19995 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -2702,97 +2726,48 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: -0.00000 imag: -0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: -0.00000 -GPU Ewald: 409293.46532 -Ewald Summation (total energy) on the CPU took 0.20025 secs -Ewald Summation (total energy) on the GPU took 0.00062 secs +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 2304, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +VDW + Real on the GPU took 0.00000 secs +GPU Ewald Summary: NHostAtom: 2304, NGuestAtom: 0 +GPU Ewald Summary: Nthread: 128, Host thread: 128, Guest thread: 0 +Host NAtomPerThread: 18, Guest NAtomPerThread: 0 +Host residueAtoms: 0, Guest residueAtoms: 0 +GPU fourier, HHFourier: 409293.46532, GGFourier: 0.00000, HGFourier: 0.00000, TOTFourier: 409293.46532 +Framework Component 0 Exclusion: 14446471.62713 +Ewald Summation (total energy) on the GPU took 0.00139 secs +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 14855765.09245, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING CREATE_MOLECULE STAGE ENERGY ====================== Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00060, temp: 298.00000 Number of Frameworks: 1 INITIALIZATION Cycle: 0, 0 Adsorbate Molecules, Total Energy: 14855765.09240 || Component 0 [MFI-2x2x2-P1.cif], 1 Molecules || Component 1 [CO2], 0 Molecules || -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): -41.16653, (CrossType) 133.73591 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): 4.46649, (CrossType) 233.05328 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): 42.28071, (CrossType) -2.26394 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): -0.25454, (CrossType) 7.17092 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): -41.03848, (CrossType) 628.27624 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): 0.06912, (CrossType) -8.91197 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): 39.99852, (CrossType) -102.93955 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -1602.68346, HGReal: -424.89645, GGVDW: -1.75259, GGReal: -0.01345, HHEwaldE: 0.00000, HGEwaldE: -102.93955, GGEwaldE: -2.31563, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 160.33972, HGReal: -79.83133, GGVDW: 1.75259, GGReal: 0.01345, HHEwaldE: 0.00000, HGEwaldE: -311.13203, GGEwaldE: 2.48331, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): -41.22037, (CrossType) 133.73591 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): -0.58401, (CrossType) 12.22396 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): 42.61932, (CrossType) -500.70133 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -1811.70605, HGReal: 386.81340, GGVDW: -0.07679, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: -500.70133, GGEwaldE: 0.30517, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): 40.55780, (CrossType) -380.15849 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -1680.78224, HGReal: 15.71819, GGVDW: -1.22731, GGReal: 0.00058, HHEwaldE: 0.00000, HGEwaldE: -380.15849, GGEwaldE: -1.75635, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Number of blocks: 33, Nthread: 128 GPU Fourier Energy (SameType): -41.96438, (CrossType) 335.31598 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ======================== MOVE STATISTICS FOR COMPONENT [1] (CO2) ======================== =====================SWAP MOVES===================== Insertion Performed: 13735 @@ -2813,7 +2788,7 @@ Printing: Component: 0 [ MFI-2x2x2-P1.cif ], NumMol: 1, Molsize: 2304 Printing: Component: 1 [ CO2 ], NumMol: 26, Molsize: 3 Component 0, Molsize: 2304 Component 1, Molsize: 3 -Work took 9.755640 seconds +Work took 9.728188 seconds ====================================== CHECKING FINAL ENERGY FOR SYSTEM [0] ====================================== @@ -2822,13 +2797,18 @@ CHECKING FINAL ENERGY FOR SYSTEM [0] Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: -51231.47920; Real: -2603.98941 Guest-Guest VDW: -557.70387; Real: -48.54348 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: -51231.47920, Real: -2603.98941 +Compoent [1-1], VDW: -557.70387, Real: -48.54348 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 1128.48178, Host-Host Fourier: 409293.46532, Framework-Guest Fourier: -11661.42009 -Component: 0, SelfAtomE: 100586536.82400 -Component: 1, SelfAtomE: 343615.73682 -Component: 0, Intra-Molecular ExclusionE: 115033008.45111 -Component: 1, Intra-Molecular ExclusionE: 342515.56894 -HostEwald took 0.20415 sec +CPU Guest-Guest Fourier: 1128.48178, Host-Host Fourier: 409293.46532, Framework-Guest Fourier: -11661.42009 +Component: 0, SelfAtomE: 100586536.82400 (120977870.55210 kJ/mol) +Component: 1, SelfAtomE: 343615.73682 (413274.99128 kJ/mol) +Component: 0, Intra-Molecular ExclusionE: 115033008.45111 (138352992.80625 kJ/mol) +Component: 1, Intra-Molecular ExclusionE: 342515.56894 (411951.79266 kJ/mol) +HostEwald took 0.20243 sec +Ewald Summation (total energy) on the CPU took 0.20243 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -2851,10 +2831,28 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: -0.00000 imag: -0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: -0.00000 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 2304, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 2304 78 +Interactions: 0 179712 3003 +Nblock 16, blocks: 0 15 1, threads needed: 0 1798 31, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -51231.47920, HGReal: -2603.98941, GGVDW: -557.70387, GGReal: -48.54348, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00040 secs +GPU Ewald Summary: NHostAtom: 2304, NGuestAtom: 78 +GPU Ewald Summary: Nthread: 128, Host thread: 123, Guest thread: 5 +Host NAtomPerThread: 18, Guest NAtomPerThread: 15 +Host residueAtoms: 90, Guest residueAtoms: 3 +GPU fourier, HHFourier: 409293.46532, GGFourier: 1128.48178, HGFourier: -11661.42009, TOTFourier: 398760.52701 +Framework Component 0 Exclusion: 14446471.62713 Component 1, Nblock: 1, Nthread: 128 -GPU Ewald: 397660.35913 -Ewald Summation (total energy) on the CPU took 0.20415 secs -Ewald Summation (total energy) on the GPU took 0.00058 secs +Component 1, Exclusion (self + intra) = -1100.16788 +Ewald Summation (total energy) on the GPU took 0.00131 secs +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -51231.47920, HGReal: -2603.98941, GGVDW: -557.70387, GGReal: -48.54348, HHEwaldE: 14855765.09245, HGEwaldE: -11661.42009, GGEwaldE: 28.31390, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING FINAL STAGE ENERGY ====================== ====================================== ======================== ENERGY SUMMARY (Simulation 0) ========================= @@ -2948,7 +2946,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -66074.82215 (-79469.79321 [K]) ======================================================================== - *** CHECK DELTA_E (FINAL - CREATE MOLECULE) *** + *** CHECK DELTA_E (RUNNING FINAL - CREATE MOLECULE) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: -51231.47920 (-61617.34417 [K]) @@ -2963,7 +2961,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -66074.82215 (-79469.79321 [K]) ======================================================================== - *** ENERGY DRIFT *** + *** ENERGY DRIFT (CPU FINAL - RUNNING FINAL) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: -0.00000 (-0.00000 [K]) @@ -2977,6 +2975,21 @@ Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) +======================================================================== + *** GPU DRIFT (GPU FINAL - CPU FINAL) *** +======================================================================== +VDW [Host-Host]: 0.00000 (0.00000 [K]) +VDW [Host-Guest]: -0.00000 (-0.00000 [K]) +VDW [Guest-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Host]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Guest-Guest]: -0.00000 (-0.00000 [K]) +Ewald [Host-Host]: -0.00004 (-0.00005 [K]) +Ewald [Host-Guest]: -0.00000 (-0.00000 [K]) +Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) +DNN Energy: 0.00000 (0.00000 [K]) +Tail Correction Energy: 0.00000 (0.00000 [K]) +Total Energy: -0.00004 (-0.00005 [K]) ======================================================================== ================================================================================ ======================== PRODUCTION PHASE AVERAGE ENERGIES (Simulation 0) ========================= diff --git a/Examples/Methane-TMMC/output.txt b/Examples/Methane-TMMC/output.txt index 86849ad..e4703cf 100644 --- a/Examples/Methane-TMMC/output.txt +++ b/Examples/Methane-TMMC/output.txt @@ -1,5 +1,5 @@ -/home/z/Desktop/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined -True path of exe is /home/z/Desktop/gRASPA_fork/src_clean/ +/home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined +True path of exe is /home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/ There are 1 simulations running only one simulation ------------------PARSING FORCE FIELD MIXING RULES---------------- @@ -403,6 +403,7 @@ Parsing [1] Component Component 0 starts at line number 37 -------------- READING AdsorbateComponent 0 (methane) -------------- Adsorbate Component is rigid +CH4_sp3, type: 13, Acharge = 0.00000 Bonds not implemented. Break Atom [0]: Type [13], Name: CH4_sp3, Mass: 16.000000, position: 0.00000 0.00000 0.00000 Adsorbate Type[13], Name: CH4_sp3, #: 1 @@ -447,8 +448,17 @@ Box Temperature: 95.00000 Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 -Ewald Summation (total energy) on the CPU took 0.00000 secs -Ewald Summation (total energy) on the GPU took 0.00000 secs +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 0.00000, Real: 0.00000 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 207, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +VDW + Real on the GPU took 0.00001 secs +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING INITIAL STAGE ENERGY ====================== Component 1, Need to create 0 full molecule ======================== CALCULATING CREATE_MOLECULE STAGE ENERGY ======================== @@ -456,15 +466,21 @@ Component 1, Need to create 0 full molecule Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 -Ewald Summation (total energy) on the CPU took 0.00000 secs -Ewald Summation (total energy) on the GPU took 0.00000 secs +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 0.00000, Real: 0.00000 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 207, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +VDW + Real on the GPU took 0.00000 secs +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING CREATE_MOLECULE STAGE ENERGY ====================== Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00041, temp: 95.00000 Number of Frameworks: 1 INITIALIZATION Cycle: 0, 0 Adsorbate Molecules, Total Energy: 0.00000 || Component 0 [667.cif], 1 Molecules || Component 1 [methane], 0 Molecules || -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ======================== MOVE STATISTICS FOR COMPONENT [1] (methane) ======================== =====================SWAP MOVES===================== Insertion Performed: 1678 @@ -480,9 +496,6 @@ Reinsertion Accepted: 389 Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00041, temp: 95.00000 Number of Frameworks: 1 EQUILIBRATION Cycle: 0, 59 Adsorbate Molecules, Total Energy: -48094.15797 || Component 0 [667.cif], 1 Molecules || Component 1 [methane], 59 Molecules || -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 EQUILIBRATION Cycle: 10000, 62 Adsorbate Molecules, Total Energy: -52121.68757 || Component 0 [667.cif], 1 Molecules || Component 1 [methane], 62 Molecules || EQUILIBRATION Cycle: 20000, 56 Adsorbate Molecules, Total Energy: -45419.04810 || Component 0 [667.cif], 1 Molecules || Component 1 [methane], 56 Molecules || EQUILIBRATION Cycle: 30000, 58 Adsorbate Molecules, Total Energy: -48166.04905 || Component 0 [667.cif], 1 Molecules || Component 1 [methane], 58 Molecules || @@ -507,9 +520,6 @@ Printing: Component: 0 [ 667.cif ], NumMol: 1, Molsize: 207 Printing: Component: 1 [ methane ], NumMol: 60, Molsize: 1 Component 0, Molsize: 207 Component 1, Molsize: 1 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -87.54050, HGReal: 0.00000, GGVDW: -42.40380, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 PRODUCTION Cycle: 10000, 62 Adsorbate Molecules, Total Energy: -48220.01615 || Component 0 [667.cif], 1 Molecules || Component 1 [methane], 62 Molecules || Printing: Component: 0 [ 667.cif ], NumMol: 1, Molsize: 207 Printing: Component: 1 [ methane ], NumMol: 62, Molsize: 1 @@ -632,11 +642,73 @@ BLOCK [4], Blocksize: 10000, Average: 12.41149, ErrorBar: 9.85773 Overall: Average: 34.71939, ErrorBar: 28.98501 ---------------------------------------------------------- ============================================================== +=====================Rosenbluth Summary===================== +There are 5 blocks +=====BLOCK 0===== +Widom Performed: 3369.0 +Framework Density: 116.33074 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 795.7580576518 +(Total) Averaged Excess Mu: -634.2347235877 +(Total) Averaged Henry Coefficient: 0.0086602168 +(Total) Converted to Fugacity: 344.8401406044 [Pascal], Temp: 95.00000 [K] +Framework Density: 116.33074 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 795.7580576518 +(Insertion) Averaged Excess Mu: -634.2347235877 +(Insertion) Converted to Fugacity: 344.8401406044 [Pascal], Temp: 95.00000 [K] +=====BLOCK 1===== +Widom Performed: 3286.0 +Framework Density: 116.33074 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 655.3110108386 +(Total) Averaged Excess Mu: -615.7957984343 +(Total) Averaged Henry Coefficient: 0.0071317348 +(Total) Converted to Fugacity: 418.7466957660 [Pascal], Temp: 95.00000 [K] +Framework Density: 116.33074 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 655.3110108386 +(Insertion) Averaged Excess Mu: -615.7957984343 +(Insertion) Converted to Fugacity: 418.7466957660 [Pascal], Temp: 95.00000 [K] +=====BLOCK 2===== +Widom Performed: 3349.0 +Framework Density: 116.33074 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 685.9186917949 +(Total) Averaged Excess Mu: -620.1304285532 +(Total) Averaged Henry Coefficient: 0.0074648375 +(Total) Converted to Fugacity: 400.0610039794 [Pascal], Temp: 95.00000 [K] +Framework Density: 116.33074 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 685.9186917949 +(Insertion) Averaged Excess Mu: -620.1304285532 +(Insertion) Converted to Fugacity: 400.0610039794 [Pascal], Temp: 95.00000 [K] +=====BLOCK 3===== +Widom Performed: 3289.0 +Framework Density: 116.33074 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 448.0360138531 +(Total) Averaged Excess Mu: -579.6903295768 +(Total) Averaged Henry Coefficient: 0.0048759657 +(Total) Converted to Fugacity: 612.4715692558 [Pascal], Temp: 95.00000 [K] +Framework Density: 116.33074 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 448.0360138531 +(Insertion) Averaged Excess Mu: -579.6903295768 +(Insertion) Converted to Fugacity: 612.4715692558 [Pascal], Temp: 95.00000 [K] +=====BLOCK 4===== +Widom Performed: 3325.0 +Framework Density: 116.33074 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 556.6735704443 +(Total) Averaged Excess Mu: -600.3056460581 +(Total) Averaged Henry Coefficient: 0.0060582658 +(Total) Converted to Fugacity: 492.9447616288 [Pascal], Temp: 95.00000 [K] +Framework Density: 116.33074 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 556.6735704443 +(Insertion) Averaged Excess Mu: -600.3056460581 +(Insertion) Converted to Fugacity: 492.9447616288 [Pascal], Temp: 95.00000 [K] +=========================AVERAGE======================== +Averaged Rosenbluth Weight: 628.3394689165 +/- 236.1646065721 +Averaged Excess Chemical Potential: -610.0313852420 +/- 37.2686504599 +Averaged Henry Coefficient [mol/kg/Pa]: 0.006838204138 +/- 0.002570174038 +Averaged Fugacity: 453.8128342469 +/- 184.8195730328 Printing: Component: 0 [ 667.cif ], NumMol: 1, Molsize: 207 Printing: Component: 1 [ methane ], NumMol: 6, Molsize: 1 Component 0, Molsize: 207 Component 1, Molsize: 1 -Work took 3.235230 seconds +Work took 3.160120 seconds ====================================== CHECKING FINAL ENERGY FOR SYSTEM [0] ====================================== @@ -645,8 +717,23 @@ CHECKING FINAL ENERGY FOR SYSTEM [0] Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: -4894.72762; Real: 0.00000 Guest-Guest VDW: -51.91054; Real: 0.00000 -Ewald Summation (total energy) on the CPU took 0.00000 secs -Ewald Summation (total energy) on the GPU took 0.00000 secs +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: -4894.72762, Real: 0.00000 +Compoent [1-1], VDW: -51.91054, Real: 0.00000 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 207, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 207 6 +Interactions: 0 1242 15 +Nblock 2, blocks: 0 1 1, threads needed: 0 13 1, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -4894.72762, HGReal: 0.00000, GGVDW: -51.91054, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00018 secs +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -4894.72762, HGReal: 0.00000, GGVDW: -51.91054, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING FINAL STAGE ENERGY ====================== ====================================== ======================== ENERGY SUMMARY (Simulation 0) ========================= @@ -740,7 +827,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -4946.63815 (-5949.44183 [K]) ======================================================================== - *** CHECK DELTA_E (FINAL - CREATE MOLECULE) *** + *** CHECK DELTA_E (RUNNING FINAL - CREATE MOLECULE) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: -4894.72762 (-5887.00777 [K]) @@ -755,7 +842,22 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -4946.63815 (-5949.44183 [K]) ======================================================================== - *** ENERGY DRIFT *** + *** ENERGY DRIFT (CPU FINAL - RUNNING FINAL) *** +======================================================================== +VDW [Host-Host]: 0.00000 (0.00000 [K]) +VDW [Host-Guest]: -0.00000 (-0.00000 [K]) +VDW [Guest-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Host]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Guest-Guest]: 0.00000 (0.00000 [K]) +Ewald [Host-Host]: 0.00000 (0.00000 [K]) +Ewald [Host-Guest]: 0.00000 (0.00000 [K]) +Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) +DNN Energy: 0.00000 (0.00000 [K]) +Tail Correction Energy: 0.00000 (0.00000 [K]) +Total Energy: -0.00000 (-0.00000 [K]) +======================================================================== + *** GPU DRIFT (GPU FINAL - CPU FINAL) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: -0.00000 (-0.00000 [K]) @@ -833,8 +935,8 @@ PseudoAtom Type: Hw[10], #: 0 PseudoAtom Type: Ow[11], #: 0 PseudoAtom Type: CH3_sp3[12], #: 0 PseudoAtom Type: CH4_sp3[13], #: 6 -Total Program Size: 5577 MB -Resident Set Size: 115 MB -Shared Pages: 94 MB +Total Program Size: 5578 MB +Resident Set Size: 116 MB +Shared Pages: 95 MB Text (code): 0 MB -Data + Stack: 67 MB +Data + Stack: 68 MB diff --git a/Examples/NU2000-pX-LinkerRotations/output.txt b/Examples/NU2000-pX-LinkerRotations/output.txt index 9518247..a8d5a44 100644 --- a/Examples/NU2000-pX-LinkerRotations/output.txt +++ b/Examples/NU2000-pX-LinkerRotations/output.txt @@ -1,5 +1,5 @@ -/home/z/Desktop/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined -True path of exe is /home/z/Desktop/gRASPA_fork/src_clean/ +/home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined +True path of exe is /home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/ There are 1 simulations running only one simulation ------------------PARSING FORCE FIELD MIXING RULES---------------- @@ -382,6 +382,18 @@ Parsing [2] Component Component 0 starts at line number 45 -------------- READING AdsorbateComponent 0 (p-xylene) -------------- Adsorbate Component is rigid +CH3_xyl, type: 7, Acharge = 0.11500 +CH3_xyl, type: 7, Acharge = 0.11500 +C_xyl, type: 8, Acharge = -0.11500 +C_xyl, type: 8, Acharge = -0.11500 +C_xyl, type: 8, Acharge = -0.11500 +C_xyl, type: 8, Acharge = -0.11500 +C_xyl, type: 8, Acharge = -0.11500 +C_xyl, type: 8, Acharge = -0.11500 +H_xyl, type: 9, Acharge = 0.11500 +H_xyl, type: 9, Acharge = 0.11500 +H_xyl, type: 9, Acharge = 0.11500 +H_xyl, type: 9, Acharge = 0.11500 Bonds not implemented. Break Atom [0]: Type [7], Name: CH3_xyl, Mass: 15.000000, position: -0.75500 -1.30770 -0.00000 Atom [1]: Type [7], Name: CH3_xyl, Mass: 15.000000, position: 2.15500 3.73257 0.00000 @@ -434,23 +446,31 @@ Box Temperature: 298.00000 Host-Host VDW: 5523439918.41786; Real: -6257646.54087 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 5523618451.87958, Real: -6724985.12633 +Compoent [0-2], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: -178533.45689, Real: 467338.58546 +Compoent [1-2], VDW: 0.00000, Real: 0.00000 +Compoent [2-2], VDW: 0.00000, Real: 0.00000 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 0.00000, Host-Host Fourier: 7328.67519, Framework-Guest Fourier: 0.00000 -Component: 0, SelfAtomE: 7123268.40575 -Component: 1, SelfAtomE: 1479886.61726 -Component: 2, SelfAtomE: 0.00000 -Component: 0, Intra-Molecular ExclusionE: -32892160.48297 -Component: 1, Intra-Molecular ExclusionE: -243671.40556 -Component: 2, Intra-Molecular ExclusionE: 0.00000 -HostEwald took 0.05991 sec -Component 0, Intra Exclusion Energy: 32892160.48297 -Component 0, Atom Self Exclusion Energy: 7123268.40575 +CPU Guest-Guest Fourier: 0.00000, Host-Host Fourier: 7328.67519, Framework-Guest Fourier: 0.00000 +Component: 0, SelfAtomE: 7123268.40575 (8567327.89803 kJ/mol) +Component: 1, SelfAtomE: 1479886.61726 (1779895.57319 kJ/mol) +Component: 2, SelfAtomE: 0.00000 (0.00000 kJ/mol) +Component: 0, Intra-Molecular ExclusionE: -32892160.48297 (-39560200.18912 kJ/mol) +Component: 1, Intra-Molecular ExclusionE: -243671.40556 (-293069.51695 kJ/mol) +Component: 2, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) +HostEwald took 0.05826 sec +Ewald Summation (total energy) on the CPU took 0.05826 secs +Component 0, Intra Exclusion Energy: 32892160.48297 (39560200.18912 kJ/mol) +Component 0, Atom Self Exclusion Energy: 7123268.40575 (8567327.89803 kJ/mol) DEBUG: comp: 0, IntraE: 32892160.48297, SelfE: 7123268.40575 -Component 1, Intra Exclusion Energy: 3807.36571 -Component 1, Atom Self Exclusion Energy: 23123.22839 +Component 1, Intra Exclusion Energy: 3807.36571 (4579.21120 kJ/mol) +Component 1, Atom Self Exclusion Energy: 23123.22839 (27810.86833 kJ/mol) DEBUG: comp: 1, IntraE: 3807.36571, SelfE: 23123.22839 -Component 2, Intra Exclusion Energy: -3038.44649 -Component 2, Atom Self Exclusion Energy: 3297.28572 +Component 2, Intra Exclusion Energy: -3038.44649 (-3654.41338 kJ/mol) +Component 2, Atom Self Exclusion Energy: 3297.28572 (3965.72560 kJ/mol) DEBUG: comp: 2, IntraE: -3038.44649, SelfE: 3297.28572 ****** Allocating Ewald WaveVectors (INITIAL STAGE ONLY) ****** Allocated 29696 29696 37120 space for eikxyz @@ -487,9 +507,28 @@ Framework Wave Vector 6, real: 0.00000 imag: -0.00000 Framework Wave Vector 7, real: -0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: -0.00000 Framework Wave Vector 9, real: -0.00000 imag: 0.00000 -GPU Ewald: 7328.67519 -Ewald Summation (total energy) on the CPU took 0.05991 secs -Ewald Summation (total energy) on the GPU took 0.00027 secs +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 448, Other Comp Atoms: 1408 +NFrameworkZero_ExtraFramework interactions: 630784, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 990528 +Atoms: 1856 0 +Interactions: 1621312 0 0 +Nblock 127, blocks: 127 0 0, threads needed: 16214 0 0, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 5523439918.42259, HHReal: -6257646.54087, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00556 secs +GPU Ewald Summary: NHostAtom: 1856, NGuestAtom: 0 +GPU Ewald Summary: Nthread: 128, Host thread: 128, Guest thread: 0 +Host NAtomPerThread: 14, Guest NAtomPerThread: 0 +Host residueAtoms: 64, Guest residueAtoms: 0 +GPU fourier, HHFourier: 7328.67519, GGFourier: 0.00000, HGFourier: 0.00000, TOTFourier: 7328.67519 +Framework Component 0 Exclusion: -40015428.88872 +Component 1, Nblock: 1, Nthread: 128 +Component 1, Exclusion (self + intra) = -1723558.02282 +Ewald Summation (total energy) on the GPU took 0.00126 secs +Total GPU Energy: +HHVDW: 5523439918.42259, HHReal: -6257646.54087, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: -41731658.23635, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING INITIAL STAGE ENERGY ====================== Component 2, Need to create 0 full molecule ======================== CALCULATING CREATE_MOLECULE STAGE ENERGY ======================== @@ -497,15 +536,23 @@ Component 2, Need to create 0 full molecule Host-Host VDW: 5523439918.41786; Real: -6257646.54087 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 5523618451.87958, Real: -6724985.12633 +Compoent [0-2], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: -178533.45689, Real: 467338.58546 +Compoent [1-2], VDW: 0.00000, Real: 0.00000 +Compoent [2-2], VDW: 0.00000, Real: 0.00000 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 0.00000, Host-Host Fourier: 7328.67519, Framework-Guest Fourier: 0.00000 -Component: 0, SelfAtomE: 7123268.40575 -Component: 1, SelfAtomE: 1479886.61726 -Component: 2, SelfAtomE: 0.00000 -Component: 0, Intra-Molecular ExclusionE: -32892160.48297 -Component: 1, Intra-Molecular ExclusionE: -243671.40556 -Component: 2, Intra-Molecular ExclusionE: 0.00000 -HostEwald took 0.05861 sec +CPU Guest-Guest Fourier: 0.00000, Host-Host Fourier: 7328.67519, Framework-Guest Fourier: 0.00000 +Component: 0, SelfAtomE: 7123268.40575 (8567327.89803 kJ/mol) +Component: 1, SelfAtomE: 1479886.61726 (1779895.57319 kJ/mol) +Component: 2, SelfAtomE: 0.00000 (0.00000 kJ/mol) +Component: 0, Intra-Molecular ExclusionE: -32892160.48297 (-39560200.18912 kJ/mol) +Component: 1, Intra-Molecular ExclusionE: -243671.40556 (-293069.51695 kJ/mol) +Component: 2, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) +HostEwald took 0.05787 sec +Ewald Summation (total energy) on the CPU took 0.05787 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -528,18 +575,34 @@ Framework Wave Vector 6, real: 0.00000 imag: -0.00000 Framework Wave Vector 7, real: -0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: -0.00000 Framework Wave Vector 9, real: -0.00000 imag: 0.00000 -GPU Ewald: 7328.67519 -Ewald Summation (total energy) on the CPU took 0.05861 secs -Ewald Summation (total energy) on the GPU took 0.00025 secs +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 448, Other Comp Atoms: 1408 +NFrameworkZero_ExtraFramework interactions: 630784, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 990528 +Atoms: 1856 0 +Interactions: 1621312 0 0 +Nblock 127, blocks: 127 0 0, threads needed: 16214 0 0, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 5523439918.42259, HHReal: -6257646.54087, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00048 secs +GPU Ewald Summary: NHostAtom: 1856, NGuestAtom: 0 +GPU Ewald Summary: Nthread: 128, Host thread: 128, Guest thread: 0 +Host NAtomPerThread: 14, Guest NAtomPerThread: 0 +Host residueAtoms: 64, Guest residueAtoms: 0 +GPU fourier, HHFourier: 7328.67519, GGFourier: 0.00000, HGFourier: 0.00000, TOTFourier: 7328.67519 +Framework Component 0 Exclusion: -40015428.88872 +Component 1, Nblock: 1, Nthread: 128 +Component 1, Exclusion (self + intra) = -1723558.02282 +Ewald Summation (total energy) on the GPU took 0.00103 secs +Total GPU Energy: +HHVDW: 5523439918.42259, HHReal: -6257646.54087, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: -41731658.23635, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING CREATE_MOLECULE STAGE ENERGY ====================== Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00023, temp: 298.00000 Number of Frameworks: 65 Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00023, temp: 298.00000 Number of Frameworks: 65 EQUILIBRATION Cycle: 0, 0 Adsorbate Molecules, Total Energy: 5475450613.64063 || Component 0 [Al-Bicyclo-AddedH-P1-fix-PBC.cif], 1 Molecules || Component 1 [BiCyclo-Linker], 64 Molecules || Component 2 [p-xylene], 0 Molecules || -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 Sampled 0 WangLandau, Adjusted WL 0 times ======================== MOVE STATISTICS FOR COMPONENT [1] (BiCyclo-Linker) ======================== =====================SPECIAL ROTATION MOVES======================== @@ -579,9 +642,6 @@ Printing: Component: 2 [ p-xylene ], NumMol: 2, Molsize: 12 Component 0, Molsize: 448 Component 1, Molsize: 22 Component 2, Molsize: 12 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ======================== MOVE STATISTICS FOR COMPONENT [1] (BiCyclo-Linker) ======================== =====================SPECIAL ROTATION MOVES======================== Special Rotation Performed: 257 @@ -744,13 +804,30 @@ BLOCK [4], Blocksize: 1000, Average: 23.68986, ErrorBar: -nan Overall: Average: 23.41822, ErrorBar: 1.08658 ---------------------------------------------------------- ============================================================== +=====================Rosenbluth Summary===================== +There are 5 blocks +=====BLOCK 0===== +Widom Performed: 0.0 +=====BLOCK 1===== +Widom Performed: 0.0 +=====BLOCK 2===== +Widom Performed: 0.0 +=====BLOCK 3===== +Widom Performed: 0.0 +=====BLOCK 4===== +Widom Performed: 0.0 +=========================AVERAGE======================== +Averaged Rosenbluth Weight: 0.0000000000 +/- 0.0000000000 +Averaged Excess Chemical Potential: 0.0000000000 +/- 0.0000000000 +Averaged Henry Coefficient [mol/kg/Pa]: 0 +/- 0 +Averaged Fugacity: 0.0000000000 +/- 0.0000000000 Printing: Component: 0 [ Al-Bicyclo-AddedH-P1-fix-PBC.cif ], NumMol: 1, Molsize: 448 Printing: Component: 1 [ BiCyclo-Linker ], NumMol: 64, Molsize: 22 Printing: Component: 2 [ p-xylene ], NumMol: 3, Molsize: 12 Component 0, Molsize: 448 Component 1, Molsize: 22 Component 2, Molsize: 12 -Work took 1.536386 seconds +Work took 1.529762 seconds ====================================== CHECKING FINAL ENERGY FOR SYSTEM [0] ====================================== @@ -759,15 +836,23 @@ CHECKING FINAL ENERGY FOR SYSTEM [0] Host-Host VDW: 5523450487.06026; Real: -6257686.00080 Host-Guest VDW: -22522.69448; Real: 173.17031 Guest-Guest VDW: 20.02303; Real: 59.87284 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 5523629563.29998, Real: -6724432.88270 +Compoent [0-2], VDW: -5106.21022, Real: -4124.65798 +Compoent [1-1], VDW: -179076.23980, Real: 466746.88190 +Compoent [1-2], VDW: -17416.48426, Real: 4297.82829 +Compoent [2-2], VDW: 20.02303, Real: 59.87284 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 759.64814, Host-Host Fourier: 7340.54056, Framework-Guest Fourier: -575.66969 -Component: 0, SelfAtomE: 7123268.40575 -Component: 1, SelfAtomE: 1479886.61726 -Component: 2, SelfAtomE: 9891.85715 -Component: 0, Intra-Molecular ExclusionE: -32892160.48297 -Component: 1, Intra-Molecular ExclusionE: -243671.40556 -Component: 2, Intra-Molecular ExclusionE: 9115.33946 -HostEwald took 0.05920 sec +CPU Guest-Guest Fourier: 759.64814, Host-Host Fourier: 7340.54056, Framework-Guest Fourier: -575.66969 +Component: 0, SelfAtomE: 7123268.40575 (8567327.89803 kJ/mol) +Component: 1, SelfAtomE: 1479886.61726 (1779895.57319 kJ/mol) +Component: 2, SelfAtomE: 9891.85715 (11897.17681 kJ/mol) +Component: 0, Intra-Molecular ExclusionE: -32892160.48297 (-39560200.18912 kJ/mol) +Component: 1, Intra-Molecular ExclusionE: -243671.40556 (-293069.51695 kJ/mol) +Component: 2, Intra-Molecular ExclusionE: 9115.33946 (10963.24013 kJ/mol) +HostEwald took 0.05915 sec +Ewald Summation (total energy) on the CPU took 0.05915 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -790,10 +875,30 @@ Framework Wave Vector 6, real: 0.13671 imag: -0.09343 Framework Wave Vector 7, real: 0.36067 imag: -0.05485 Framework Wave Vector 8, real: 0.29686 imag: 0.07023 Framework Wave Vector 9, real: 0.14060 imag: 0.05323 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 448, Other Comp Atoms: 1408 +NFrameworkZero_ExtraFramework interactions: 630784, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 990528 +Atoms: 1856 36 +Interactions: 1621312 66816 630 +Nblock 134, blocks: 127 6 1, threads needed: 16214 669 7, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 5523450487.06017, HHReal: -6257686.00080, HGVDW: -22522.69448, HGReal: 173.17031, GGVDW: 20.02303, GGReal: 59.87284, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00072 secs +GPU Ewald Summary: NHostAtom: 1856, NGuestAtom: 36 +GPU Ewald Summary: Nthread: 128, Host thread: 125, Guest thread: 3 +Host NAtomPerThread: 14, Guest NAtomPerThread: 12 +Host residueAtoms: 106, Guest residueAtoms: 0 +GPU fourier, HHFourier: 7340.54056, GGFourier: 759.64814, HGFourier: -575.66969, TOTFourier: 7524.51901 +Framework Component 0 Exclusion: -40015428.88872 +Component 1, Nblock: 1, Nthread: 128 +Component 1, Exclusion (self + intra) = -1723558.02282 Component 2, Nblock: 1, Nthread: 128 -GPU Ewald: 6564.02287 -Ewald Summation (total energy) on the CPU took 0.05920 secs -Ewald Summation (total energy) on the GPU took 0.00036 secs +Component 2, Exclusion (self + intra) = -776.51769 +Ewald Summation (total energy) on the GPU took 0.00109 secs +Total GPU Energy: +HHVDW: 5523450487.06017, HHReal: -6257686.00080, HGVDW: -22522.69448, HGReal: 173.17031, GGVDW: 20.02303, GGReal: 59.87284, HHEwaldE: -41731646.37098, HGEwaldE: -575.66969, GGEwaldE: -16.86955, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING FINAL STAGE ENERGY ====================== ====================================== ======================== ENERGY SUMMARY (Simulation 0) ========================= @@ -887,7 +992,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -12321.12452 (-14818.91568 [K]) ======================================================================== - *** CHECK DELTA_E (FINAL - CREATE MOLECULE) *** + *** CHECK DELTA_E (RUNNING FINAL - CREATE MOLECULE) *** ======================================================================== VDW [Host-Host]: 10568.64241 (12711.16288 [K]) VDW [Host-Guest]: -22522.69448 (-27088.59160 [K]) @@ -902,7 +1007,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -12321.11970 (-14818.90987 [K]) ======================================================================== - *** ENERGY DRIFT *** + *** ENERGY DRIFT (CPU FINAL - RUNNING FINAL) *** ======================================================================== VDW [Host-Host]: -0.00482 (-0.00580 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -916,6 +1021,21 @@ Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -0.00483 (-0.00581 [K]) +======================================================================== + *** GPU DRIFT (GPU FINAL - CPU FINAL) *** +======================================================================== +VDW [Host-Host]: 0.00009 (0.00011 [K]) +VDW [Host-Guest]: -0.00000 (-0.00000 [K]) +VDW [Guest-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Host]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Guest-Guest]: 0.00000 (0.00000 [K]) +Ewald [Host-Host]: 0.00000 (0.00000 [K]) +Ewald [Host-Guest]: 0.00000 (0.00000 [K]) +Ewald [Guest-Guest]: -0.00000 (-0.00000 [K]) +DNN Energy: 0.00000 (0.00000 [K]) +Tail Correction Energy: 0.00000 (0.00000 [K]) +Total Energy: 0.00009 (0.00011 [K]) ======================================================================== ================================================================================ ======================== PRODUCTION PHASE AVERAGE ENERGIES (Simulation 0) ========================= @@ -976,8 +1096,8 @@ PseudoAtom Type: H[6], #: 768 PseudoAtom Type: CH3_xyl[7], #: 6 PseudoAtom Type: C_xyl[8], #: 18 PseudoAtom Type: H_xyl[9], #: 12 -Total Program Size: 5581 MB -Resident Set Size: 119 MB +Total Program Size: 5582 MB +Resident Set Size: 121 MB Shared Pages: 95 MB Text (code): 0 MB -Data + Stack: 71 MB +Data + Stack: 72 MB diff --git a/Examples/Reference_NIST_SPCE/Box-1/output.txt b/Examples/Reference_NIST_SPCE/Box-1/output.txt index 92c1971..9f30c66 100644 --- a/Examples/Reference_NIST_SPCE/Box-1/output.txt +++ b/Examples/Reference_NIST_SPCE/Box-1/output.txt @@ -1,5 +1,5 @@ -/home/z/Desktop/gRASPA_versions/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined -True path of exe is /home/z/Desktop/gRASPA_versions/gRASPA_fork/src_clean/ +/home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined +True path of exe is /home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/ There are 1 simulations running only one simulation ------------------PARSING FORCE FIELD MIXING RULES---------------- @@ -115,13 +115,18 @@ Box Temperature: 300.00000 Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 93115.39346; Real: -604643.73945 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 93115.39346, Real: -604643.73945 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 37146.53160, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 37146.53160, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 9629777.37122 (11581967.10063 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 9507891.21586 (11435371.66160 kJ/mol) -HostEwald took 0.01057 sec +HostEwald took 0.01081 sec +Ewald Summation (total energy) on the CPU took 0.01082 secs DEBUG: comp: 0, IntraE: 0.00000, SelfE: 0.00000 Component 1, Intra Exclusion Energy: -23769.72804 (-28588.42915 kJ/mol) Component 1, Atom Self Exclusion Energy: 24074.44343 (28954.91775 kJ/mol) @@ -161,11 +166,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 400, Nj: 400, E: -3416.56651 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 1200 +Interactions: 0 0 719400 +Nblock 57, blocks: 0 0 57, threads needed: 0 0 7194, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 93115.39346, GGReal: -604643.73945, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00563 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 1200 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 9 +Host residueAtoms: 0, Guest residueAtoms: 48 +GPU fourier, HHFourier: 0.00000, GGFourier: 37146.53160, HGFourier: 0.00000, TOTFourier: 37146.53160 Component 1, Nblock: 4, Nthread: 128 -GPU Ewald: -118694.26233 -Ewald Summation (total energy) on the CPU took 0.01057 secs -Ewald Summation (total energy) on the GPU took 0.00020 secs +Component 1, Exclusion (self + intra) = -121886.15536 +Ewald Summation (total energy) on the GPU took 0.00061 secs i: 0, j: 0, Ni: 400, Nj: 400, E: -3416.56651 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 93115.39346, GGReal: -604643.73945, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -84739.62377, TailE: -3416.56651, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING INITIAL STAGE ENERGY ====================== Component 1, Need to create 0 full molecule ======================== CALCULATING CREATE_MOLECULE STAGE ENERGY ======================== @@ -173,13 +196,18 @@ Component 1, Need to create 0 full molecule Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 93115.39346; Real: -604643.73945 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 93115.39346, Real: -604643.73945 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 37146.53160, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 37146.53160, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 9629777.37122 (11581967.10063 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 9507891.21586 (11435371.66160 kJ/mol) -HostEwald took 0.01032 sec +HostEwald took 0.01029 sec +Ewald Summation (total energy) on the CPU took 0.01029 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -202,11 +230,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 400, Nj: 400, E: -3416.56651 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 1200 +Interactions: 0 0 719400 +Nblock 57, blocks: 0 0 57, threads needed: 0 0 7194, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 93115.39346, GGReal: -604643.73945, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00052 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 1200 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 9 +Host residueAtoms: 0, Guest residueAtoms: 48 +GPU fourier, HHFourier: 0.00000, GGFourier: 37146.53160, HGFourier: 0.00000, TOTFourier: 37146.53160 Component 1, Nblock: 4, Nthread: 128 -GPU Ewald: -118694.26233 -Ewald Summation (total energy) on the CPU took 0.01032 secs -Ewald Summation (total energy) on the GPU took 0.00012 secs +Component 1, Exclusion (self + intra) = -121886.15536 +Ewald Summation (total energy) on the GPU took 0.00024 secs i: 0, j: 0, Ni: 400, Nj: 400, E: -3416.56651 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 93115.39346, GGReal: -604643.73945, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -84739.62377, TailE: -3416.56651, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING CREATE_MOLECULE STAGE ENERGY ====================== Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00031, temp: 300.00000 Number of Frameworks: 1 @@ -218,7 +264,7 @@ Printing: Component: 0 [ Box-1.cif ], NumMol: 1, Molsize: 0 Printing: Component: 1 [ SPCE ], NumMol: 400, Molsize: 3 Component 0, Molsize: 0 Component 1, Molsize: 3 -Work took 0.010459 seconds +Work took 0.010509 seconds ====================================== CHECKING FINAL ENERGY FOR SYSTEM [0] ====================================== @@ -227,13 +273,18 @@ CHECKING FINAL ENERGY FOR SYSTEM [0] Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 93115.39346; Real: -604643.73945 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 93115.39346, Real: -604643.73945 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 37146.53160, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 37146.53160, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 9629777.37122 (11581967.10063 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 9507891.21586 (11435371.66160 kJ/mol) -HostEwald took 0.01031 sec +HostEwald took 0.01028 sec +Ewald Summation (total energy) on the CPU took 0.01028 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -256,11 +307,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 400, Nj: 400, E: -3416.56651 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 1200 +Interactions: 0 0 719400 +Nblock 57, blocks: 0 0 57, threads needed: 0 0 7194, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 93115.39346, GGReal: -604643.73945, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00051 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 1200 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 9 +Host residueAtoms: 0, Guest residueAtoms: 48 +GPU fourier, HHFourier: 0.00000, GGFourier: 37146.53160, HGFourier: 0.00000, TOTFourier: 37146.53160 Component 1, Nblock: 4, Nthread: 128 -GPU Ewald: -118694.26233 -Ewald Summation (total energy) on the CPU took 0.01031 secs -Ewald Summation (total energy) on the GPU took 0.00014 secs +Component 1, Exclusion (self + intra) = -121886.15536 +Ewald Summation (total energy) on the GPU took 0.00021 secs i: 0, j: 0, Ni: 400, Nj: 400, E: -3416.56651 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 93115.39346, GGReal: -604643.73945, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -84739.62377, TailE: -3416.56651, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING FINAL STAGE ENERGY ====================== ====================================== ======================== ENERGY SUMMARY (Simulation 0) ========================= @@ -354,7 +423,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) ======================================================================== - *** CHECK DELTA_E (FINAL - CREATE MOLECULE) *** + *** CHECK DELTA_E (RUNNING FINAL - CREATE MOLECULE) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -369,7 +438,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) ======================================================================== - *** ENERGY DRIFT *** + *** ENERGY DRIFT (CPU FINAL - RUNNING FINAL) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -383,6 +452,21 @@ Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) +======================================================================== + *** GPU DRIFT (GPU FINAL - CPU FINAL) *** +======================================================================== +VDW [Host-Host]: 0.00000 (0.00000 [K]) +VDW [Host-Guest]: 0.00000 (0.00000 [K]) +VDW [Guest-Guest]: -0.00000 (-0.00000 [K]) +Real Coulomb [Host-Host]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Guest-Guest]: -0.00000 (-0.00000 [K]) +Ewald [Host-Host]: 0.00000 (0.00000 [K]) +Ewald [Host-Guest]: 0.00000 (0.00000 [K]) +Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) +DNN Energy: 0.00000 (0.00000 [K]) +Tail Correction Energy: 0.00000 (0.00000 [K]) +Total Energy: 0.00000 (0.00000 [K]) ======================================================================== ================================================================================ ======================== PRODUCTION PHASE AVERAGE ENERGIES (Simulation 0) ========================= @@ -435,8 +519,8 @@ DNN GPU Time: 0.00000, DNN Sort Time: 0.00000, std::sort Time: 0.00000, Featuriz System 0 PseudoAtom Type: O_spce[0], #: 400 PseudoAtom Type: H_spce[1], #: 800 -Total Program Size: 5579 MB -Resident Set Size: 117 MB +Total Program Size: 5580 MB +Resident Set Size: 118 MB Shared Pages: 94 MB Text (code): 0 MB -Data + Stack: 69 MB +Data + Stack: 70 MB diff --git a/Examples/Reference_NIST_SPCE/Box-2/output.txt b/Examples/Reference_NIST_SPCE/Box-2/output.txt index 3a5297e..a57f132 100644 --- a/Examples/Reference_NIST_SPCE/Box-2/output.txt +++ b/Examples/Reference_NIST_SPCE/Box-2/output.txt @@ -1,5 +1,5 @@ -/home/z/Desktop/gRASPA_versions/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined -True path of exe is /home/z/Desktop/gRASPA_versions/gRASPA_fork/src_clean/ +/home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined +True path of exe is /home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/ There are 1 simulations running only one simulation ------------------PARSING FORCE FIELD MIXING RULES---------------- @@ -115,13 +115,18 @@ Box Temperature: 300.00000 Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 35989.92683; Real: -396518.45984 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 35989.92683, Real: -396518.45984 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 36924.07708, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 36924.07708, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 7222333.02842 (8686475.32547 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 7130918.41182 (8576528.74611 kJ/mol) -HostEwald took 0.01048 sec +HostEwald took 0.00988 sec +Ewald Summation (total energy) on the CPU took 0.00988 secs DEBUG: comp: 0, IntraE: 0.00000, SelfE: 0.00000 Component 1, Intra Exclusion Energy: -23769.72804 (-28588.42915 kJ/mol) Component 1, Atom Self Exclusion Energy: 24074.44343 (28954.91775 kJ/mol) @@ -161,11 +166,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 300, Nj: 300, E: -1750.70142 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 900 +Interactions: 0 0 404550 +Nblock 32, blocks: 0 0 32, threads needed: 0 0 4046, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 35989.92683, GGReal: -396518.45984, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00558 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 900 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 7 +Host residueAtoms: 0, Guest residueAtoms: 4 +GPU fourier, HHFourier: 0.00000, GGFourier: 36924.07708, HGFourier: 0.00000, TOTFourier: 36924.07708 Component 1, Nblock: 3, Nthread: 128 -GPU Ewald: -89145.49024 -Ewald Summation (total energy) on the CPU took 0.01049 secs -Ewald Summation (total energy) on the GPU took 0.00012 secs +Component 1, Exclusion (self + intra) = -91414.61660 +Ewald Summation (total energy) on the GPU took 0.00035 secs i: 0, j: 0, Ni: 300, Nj: 300, E: -1750.70142 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 35989.92683, GGReal: -396518.45984, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -54490.53953, TailE: -1750.70142, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING INITIAL STAGE ENERGY ====================== Component 1, Need to create 0 full molecule ======================== CALCULATING CREATE_MOLECULE STAGE ENERGY ======================== @@ -173,13 +196,18 @@ Component 1, Need to create 0 full molecule Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 35989.92683; Real: -396518.45984 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 35989.92683, Real: -396518.45984 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 36924.07708, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 36924.07708, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 7222333.02842 (8686475.32547 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 7130918.41182 (8576528.74611 kJ/mol) -HostEwald took 0.01028 sec +HostEwald took 0.00974 sec +Ewald Summation (total energy) on the CPU took 0.00974 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -202,11 +230,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 300, Nj: 300, E: -1750.70142 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 900 +Interactions: 0 0 404550 +Nblock 32, blocks: 0 0 32, threads needed: 0 0 4046, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 35989.92683, GGReal: -396518.45984, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00047 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 900 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 7 +Host residueAtoms: 0, Guest residueAtoms: 4 +GPU fourier, HHFourier: 0.00000, GGFourier: 36924.07708, HGFourier: 0.00000, TOTFourier: 36924.07708 Component 1, Nblock: 3, Nthread: 128 -GPU Ewald: -89145.49024 -Ewald Summation (total energy) on the CPU took 0.01028 secs -Ewald Summation (total energy) on the GPU took 0.00007 secs +Component 1, Exclusion (self + intra) = -91414.61660 +Ewald Summation (total energy) on the GPU took 0.00019 secs i: 0, j: 0, Ni: 300, Nj: 300, E: -1750.70142 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 35989.92683, GGReal: -396518.45984, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -54490.53953, TailE: -1750.70142, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING CREATE_MOLECULE STAGE ENERGY ====================== Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00031, temp: 300.00000 Number of Frameworks: 1 @@ -218,7 +264,7 @@ Printing: Component: 0 [ Box-2.cif ], NumMol: 1, Molsize: 0 Printing: Component: 1 [ SPCE ], NumMol: 300, Molsize: 3 Component 0, Molsize: 0 Component 1, Molsize: 3 -Work took 0.008424 seconds +Work took 0.008061 seconds ====================================== CHECKING FINAL ENERGY FOR SYSTEM [0] ====================================== @@ -227,13 +273,18 @@ CHECKING FINAL ENERGY FOR SYSTEM [0] Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 35989.92683; Real: -396518.45984 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 35989.92683, Real: -396518.45984 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 36924.07708, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 36924.07708, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 7222333.02842 (8686475.32547 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 7130918.41182 (8576528.74611 kJ/mol) -HostEwald took 0.01029 sec +HostEwald took 0.00973 sec +Ewald Summation (total energy) on the CPU took 0.00973 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -256,11 +307,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 300, Nj: 300, E: -1750.70142 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 900 +Interactions: 0 0 404550 +Nblock 32, blocks: 0 0 32, threads needed: 0 0 4046, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 35989.92683, GGReal: -396518.45984, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00047 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 900 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 7 +Host residueAtoms: 0, Guest residueAtoms: 4 +GPU fourier, HHFourier: 0.00000, GGFourier: 36924.07708, HGFourier: 0.00000, TOTFourier: 36924.07708 Component 1, Nblock: 3, Nthread: 128 -GPU Ewald: -89145.49024 -Ewald Summation (total energy) on the CPU took 0.01029 secs -Ewald Summation (total energy) on the GPU took 0.00007 secs +Component 1, Exclusion (self + intra) = -91414.61660 +Ewald Summation (total energy) on the GPU took 0.00019 secs i: 0, j: 0, Ni: 300, Nj: 300, E: -1750.70142 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 35989.92683, GGReal: -396518.45984, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -54490.53953, TailE: -1750.70142, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING FINAL STAGE ENERGY ====================== ====================================== ======================== ENERGY SUMMARY (Simulation 0) ========================= @@ -354,7 +423,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) ======================================================================== - *** CHECK DELTA_E (FINAL - CREATE MOLECULE) *** + *** CHECK DELTA_E (RUNNING FINAL - CREATE MOLECULE) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -369,7 +438,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) ======================================================================== - *** ENERGY DRIFT *** + *** ENERGY DRIFT (CPU FINAL - RUNNING FINAL) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -383,6 +452,21 @@ Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) +======================================================================== + *** GPU DRIFT (GPU FINAL - CPU FINAL) *** +======================================================================== +VDW [Host-Host]: 0.00000 (0.00000 [K]) +VDW [Host-Guest]: 0.00000 (0.00000 [K]) +VDW [Guest-Guest]: -0.00000 (-0.00000 [K]) +Real Coulomb [Host-Host]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Guest-Guest]: -0.00000 (-0.00000 [K]) +Ewald [Host-Host]: 0.00000 (0.00000 [K]) +Ewald [Host-Guest]: 0.00000 (0.00000 [K]) +Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) +DNN Energy: 0.00000 (0.00000 [K]) +Tail Correction Energy: 0.00000 (0.00000 [K]) +Total Energy: 0.00000 (0.00000 [K]) ======================================================================== ================================================================================ ======================== PRODUCTION PHASE AVERAGE ENERGIES (Simulation 0) ========================= @@ -435,8 +519,8 @@ DNN GPU Time: 0.00000, DNN Sort Time: 0.00000, std::sort Time: 0.00000, Featuriz System 0 PseudoAtom Type: O_spce[0], #: 300 PseudoAtom Type: H_spce[1], #: 600 -Total Program Size: 5578 MB +Total Program Size: 5579 MB Resident Set Size: 117 MB Shared Pages: 94 MB Text (code): 0 MB -Data + Stack: 68 MB +Data + Stack: 69 MB diff --git a/Examples/Reference_NIST_SPCE/Box-3/output.txt b/Examples/Reference_NIST_SPCE/Box-3/output.txt index b46d0a1..fa2e3bd 100644 --- a/Examples/Reference_NIST_SPCE/Box-3/output.txt +++ b/Examples/Reference_NIST_SPCE/Box-3/output.txt @@ -1,5 +1,5 @@ -/home/z/Desktop/gRASPA_versions/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined -True path of exe is /home/z/Desktop/gRASPA_versions/gRASPA_fork/src_clean/ +/home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined +True path of exe is /home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/ There are 1 simulations running only one simulation ------------------PARSING FORCE FIELD MIXING RULES---------------- @@ -115,13 +115,18 @@ Box Temperature: 300.00000 Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 11975.53721; Real: -247046.90094 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 11975.53721, Real: -247046.90094 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 24026.63799, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 24026.63799, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 4814888.68561 (5790983.55031 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 4753945.60794 (5717685.83081 kJ/mol) -HostEwald took 0.00568 sec +HostEwald took 0.00531 sec +Ewald Summation (total energy) on the CPU took 0.00531 secs DEBUG: comp: 0, IntraE: 0.00000, SelfE: 0.00000 Component 1, Intra Exclusion Energy: -23769.72804 (-28588.42916 kJ/mol) Component 1, Atom Self Exclusion Energy: 24074.44343 (28954.91775 kJ/mol) @@ -161,11 +166,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 200, Nj: 200, E: -854.14163 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 600 +Interactions: 0 0 179700 +Nblock 15, blocks: 0 0 15, threads needed: 0 0 1797, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 11975.53721, GGReal: -247046.90094, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00561 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 600 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 4 +Host residueAtoms: 0, Guest residueAtoms: 88 +GPU fourier, HHFourier: 0.00000, GGFourier: 24026.63799, HGFourier: 0.00000, TOTFourier: 24026.63799 Component 1, Nblock: 2, Nthread: 128 -GPU Ewald: -58658.51001 -Ewald Summation (total energy) on the CPU took 0.00568 secs -Ewald Summation (total energy) on the GPU took 0.00012 secs +Component 1, Exclusion (self + intra) = -60943.07767 +Ewald Summation (total energy) on the GPU took 0.00030 secs i: 0, j: 0, Ni: 200, Nj: 200, E: -854.14163 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 11975.53721, GGReal: -247046.90094, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -36916.43968, TailE: -854.14163, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING INITIAL STAGE ENERGY ====================== Component 1, Need to create 0 full molecule ======================== CALCULATING CREATE_MOLECULE STAGE ENERGY ======================== @@ -173,13 +196,18 @@ Component 1, Need to create 0 full molecule Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 11975.53721; Real: -247046.90094 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 11975.53721, Real: -247046.90094 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 24026.63799, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 24026.63799, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 4814888.68561 (5790983.55031 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 4753945.60794 (5717685.83081 kJ/mol) -HostEwald took 0.00553 sec +HostEwald took 0.00520 sec +Ewald Summation (total energy) on the CPU took 0.00520 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -202,11 +230,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 200, Nj: 200, E: -854.14163 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 600 +Interactions: 0 0 179700 +Nblock 15, blocks: 0 0 15, threads needed: 0 0 1797, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 11975.53721, GGReal: -247046.90094, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00047 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 600 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 4 +Host residueAtoms: 0, Guest residueAtoms: 88 +GPU fourier, HHFourier: 0.00000, GGFourier: 24026.63799, HGFourier: 0.00000, TOTFourier: 24026.63799 Component 1, Nblock: 2, Nthread: 128 -GPU Ewald: -58658.51001 -Ewald Summation (total energy) on the CPU took 0.00553 secs -Ewald Summation (total energy) on the GPU took 0.00007 secs +Component 1, Exclusion (self + intra) = -60943.07767 +Ewald Summation (total energy) on the GPU took 0.00017 secs i: 0, j: 0, Ni: 200, Nj: 200, E: -854.14163 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 11975.53721, GGReal: -247046.90094, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -36916.43968, TailE: -854.14163, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING CREATE_MOLECULE STAGE ENERGY ====================== Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00031, temp: 300.00000 Number of Frameworks: 1 @@ -218,7 +264,7 @@ Printing: Component: 0 [ Box-3.cif ], NumMol: 1, Molsize: 0 Printing: Component: 1 [ SPCE ], NumMol: 200, Molsize: 3 Component 0, Molsize: 0 Component 1, Molsize: 3 -Work took 0.005824 seconds +Work took 0.005622 seconds ====================================== CHECKING FINAL ENERGY FOR SYSTEM [0] ====================================== @@ -227,13 +273,18 @@ CHECKING FINAL ENERGY FOR SYSTEM [0] Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 11975.53721; Real: -247046.90094 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 11975.53721, Real: -247046.90094 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 24026.63799, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 24026.63799, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 4814888.68561 (5790983.55031 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 4753945.60794 (5717685.83081 kJ/mol) -HostEwald took 0.00549 sec +HostEwald took 0.00520 sec +Ewald Summation (total energy) on the CPU took 0.00520 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -256,11 +307,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 200, Nj: 200, E: -854.14163 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 600 +Interactions: 0 0 179700 +Nblock 15, blocks: 0 0 15, threads needed: 0 0 1797, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 11975.53721, GGReal: -247046.90094, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00047 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 600 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 4 +Host residueAtoms: 0, Guest residueAtoms: 88 +GPU fourier, HHFourier: 0.00000, GGFourier: 24026.63799, HGFourier: 0.00000, TOTFourier: 24026.63799 Component 1, Nblock: 2, Nthread: 128 -GPU Ewald: -58658.51001 -Ewald Summation (total energy) on the CPU took 0.00549 secs -Ewald Summation (total energy) on the GPU took 0.00007 secs +Component 1, Exclusion (self + intra) = -60943.07767 +Ewald Summation (total energy) on the GPU took 0.00017 secs i: 0, j: 0, Ni: 200, Nj: 200, E: -854.14163 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 11975.53721, GGReal: -247046.90094, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -36916.43968, TailE: -854.14163, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING FINAL STAGE ENERGY ====================== ====================================== ======================== ENERGY SUMMARY (Simulation 0) ========================= @@ -354,7 +423,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) ======================================================================== - *** CHECK DELTA_E (FINAL - CREATE MOLECULE) *** + *** CHECK DELTA_E (RUNNING FINAL - CREATE MOLECULE) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -369,7 +438,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) ======================================================================== - *** ENERGY DRIFT *** + *** ENERGY DRIFT (CPU FINAL - RUNNING FINAL) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -383,6 +452,21 @@ Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) +======================================================================== + *** GPU DRIFT (GPU FINAL - CPU FINAL) *** +======================================================================== +VDW [Host-Host]: 0.00000 (0.00000 [K]) +VDW [Host-Guest]: 0.00000 (0.00000 [K]) +VDW [Guest-Guest]: -0.00000 (-0.00000 [K]) +Real Coulomb [Host-Host]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Guest-Guest]: 0.00000 (0.00000 [K]) +Ewald [Host-Host]: 0.00000 (0.00000 [K]) +Ewald [Host-Guest]: 0.00000 (0.00000 [K]) +Ewald [Guest-Guest]: -0.00000 (-0.00000 [K]) +DNN Energy: 0.00000 (0.00000 [K]) +Tail Correction Energy: 0.00000 (0.00000 [K]) +Total Energy: -0.00000 (-0.00000 [K]) ======================================================================== ================================================================================ ======================== PRODUCTION PHASE AVERAGE ENERGIES (Simulation 0) ========================= @@ -435,8 +519,8 @@ DNN GPU Time: 0.00000, DNN Sort Time: 0.00000, std::sort Time: 0.00000, Featuriz System 0 PseudoAtom Type: O_spce[0], #: 200 PseudoAtom Type: H_spce[1], #: 400 -Total Program Size: 5578 MB +Total Program Size: 5579 MB Resident Set Size: 117 MB Shared Pages: 94 MB Text (code): 0 MB -Data + Stack: 68 MB +Data + Stack: 69 MB diff --git a/Examples/Reference_NIST_SPCE/Box-4/output.txt b/Examples/Reference_NIST_SPCE/Box-4/output.txt index df167b7..9899705 100644 --- a/Examples/Reference_NIST_SPCE/Box-4/output.txt +++ b/Examples/Reference_NIST_SPCE/Box-4/output.txt @@ -1,5 +1,5 @@ -/home/z/Desktop/gRASPA_versions/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined -True path of exe is /home/z/Desktop/gRASPA_versions/gRASPA_fork/src_clean/ +/home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined +True path of exe is /home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/ There are 1 simulations running only one simulation ------------------PARSING FORCE FIELD MIXING RULES---------------- @@ -115,13 +115,18 @@ Box Temperature: 300.00000 Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 20807.00982; Real: -142561.72577 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 20807.00982, Real: -142561.72577 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 18572.16906, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 18572.16906, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 2407444.34281 (2895491.77516 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 2376972.80395 (2858842.91538 kJ/mol) -HostEwald took 0.00344 sec +HostEwald took 0.00339 sec +Ewald Summation (total energy) on the CPU took 0.00339 secs DEBUG: comp: 0, IntraE: 0.00000, SelfE: 0.00000 Component 1, Intra Exclusion Energy: -23769.72804 (-28588.42915 kJ/mol) Component 1, Atom Self Exclusion Energy: 24074.44343 (28954.91775 kJ/mol) @@ -161,11 +166,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 100, Nj: 100, E: -135.60095 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 300 +Interactions: 0 0 44850 +Nblock 4, blocks: 0 0 4, threads needed: 0 0 449, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 20807.00982, GGReal: -142561.72577, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00564 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 300 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 2 +Host residueAtoms: 0, Guest residueAtoms: 44 +GPU fourier, HHFourier: 0.00000, GGFourier: 18572.16906, HGFourier: 0.00000, TOTFourier: 18572.16906 Component 1, Nblock: 1, Nthread: 128 -GPU Ewald: -29841.47485 -Ewald Summation (total energy) on the CPU took 0.00345 secs -Ewald Summation (total energy) on the GPU took 0.00013 secs +Component 1, Exclusion (self + intra) = -30471.53886 +Ewald Summation (total energy) on the GPU took 0.00025 secs i: 0, j: 0, Ni: 100, Nj: 100, E: -135.60095 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 20807.00982, GGReal: -142561.72577, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -11899.36979, TailE: -135.60095, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING INITIAL STAGE ENERGY ====================== Component 1, Need to create 0 full molecule ======================== CALCULATING CREATE_MOLECULE STAGE ENERGY ======================== @@ -173,13 +196,18 @@ Component 1, Need to create 0 full molecule Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 20807.00982; Real: -142561.72577 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 20807.00982, Real: -142561.72577 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 18572.16906, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 18572.16906, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 2407444.34281 (2895491.77516 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 2376972.80395 (2858842.91538 kJ/mol) -HostEwald took 0.00333 sec +HostEwald took 0.00317 sec +Ewald Summation (total energy) on the CPU took 0.00317 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -202,11 +230,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 100, Nj: 100, E: -135.60095 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 300 +Interactions: 0 0 44850 +Nblock 4, blocks: 0 0 4, threads needed: 0 0 449, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 20807.00982, GGReal: -142561.72577, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00046 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 300 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 2 +Host residueAtoms: 0, Guest residueAtoms: 44 +GPU fourier, HHFourier: 0.00000, GGFourier: 18572.16906, HGFourier: 0.00000, TOTFourier: 18572.16906 Component 1, Nblock: 1, Nthread: 128 -GPU Ewald: -29841.47485 -Ewald Summation (total energy) on the CPU took 0.00333 secs -Ewald Summation (total energy) on the GPU took 0.00006 secs +Component 1, Exclusion (self + intra) = -30471.53886 +Ewald Summation (total energy) on the GPU took 0.00015 secs i: 0, j: 0, Ni: 100, Nj: 100, E: -135.60095 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 20807.00982, GGReal: -142561.72577, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -11899.36979, TailE: -135.60095, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING CREATE_MOLECULE STAGE ENERGY ====================== Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00031, temp: 300.00000 Number of Frameworks: 1 @@ -218,7 +264,7 @@ Printing: Component: 0 [ Box-4.cif ], NumMol: 1, Molsize: 0 Printing: Component: 1 [ SPCE ], NumMol: 100, Molsize: 3 Component 0, Molsize: 0 Component 1, Molsize: 3 -Work took 0.003303 seconds +Work took 0.003247 seconds ====================================== CHECKING FINAL ENERGY FOR SYSTEM [0] ====================================== @@ -227,13 +273,18 @@ CHECKING FINAL ENERGY FOR SYSTEM [0] Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 20807.00982; Real: -142561.72577 +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 20807.00982, Real: -142561.72577 ****** Calculating Ewald Energy (CPU) ****** -Guest-Guest Fourier: 18572.16906, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 +CPU Guest-Guest Fourier: 18572.16906, Host-Host Fourier: 0.00000, Framework-Guest Fourier: 0.00000 Component: 0, SelfAtomE: 0.00000 (0.00000 kJ/mol) Component: 1, SelfAtomE: 2407444.34281 (2895491.77516 kJ/mol) Component: 0, Intra-Molecular ExclusionE: 0.00000 (0.00000 kJ/mol) Component: 1, Intra-Molecular ExclusionE: 2376972.80395 (2858842.91538 kJ/mol) -HostEwald took 0.00337 sec +HostEwald took 0.00318 sec +Ewald Summation (total energy) on the CPU took 0.00318 secs ****** CHECKING WaveVectors Stored on CPU vs. GPU ****** Wave Vector 0, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 Wave Vector 1, CPU: 0.00000 0.00000, GPU: 0.00000 0.00000 @@ -256,11 +307,29 @@ Framework Wave Vector 6, real: 0.00000 imag: 0.00000 Framework Wave Vector 7, real: 0.00000 imag: 0.00000 Framework Wave Vector 8, real: 0.00000 imag: 0.00000 Framework Wave Vector 9, real: 0.00000 imag: 0.00000 +i: 0, j: 0, Ni: 100, Nj: 100, E: -135.60095 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 0, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 0 300 +Interactions: 0 0 44850 +Nblock 4, blocks: 0 0 4, threads needed: 0 0 449, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 20807.00982, GGReal: -142561.72577, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00047 secs +GPU Ewald Summary: NHostAtom: 0, NGuestAtom: 300 +GPU Ewald Summary: Nthread: 128, Host thread: 0, Guest thread: 128 +Host NAtomPerThread: 0, Guest NAtomPerThread: 2 +Host residueAtoms: 0, Guest residueAtoms: 44 +GPU fourier, HHFourier: 0.00000, GGFourier: 18572.16906, HGFourier: 0.00000, TOTFourier: 18572.16906 Component 1, Nblock: 1, Nthread: 128 -GPU Ewald: -29841.47485 -Ewald Summation (total energy) on the CPU took 0.00337 secs -Ewald Summation (total energy) on the GPU took 0.00007 secs +Component 1, Exclusion (self + intra) = -30471.53886 +Ewald Summation (total energy) on the GPU took 0.00015 secs i: 0, j: 0, Ni: 100, Nj: 100, E: -135.60095 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 20807.00982, GGReal: -142561.72577, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: -11899.36979, TailE: -135.60095, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING FINAL STAGE ENERGY ====================== ====================================== ======================== ENERGY SUMMARY (Simulation 0) ========================= @@ -354,7 +423,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) ======================================================================== - *** CHECK DELTA_E (FINAL - CREATE MOLECULE) *** + *** CHECK DELTA_E (RUNNING FINAL - CREATE MOLECULE) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -369,7 +438,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) ======================================================================== - *** ENERGY DRIFT *** + *** ENERGY DRIFT (CPU FINAL - RUNNING FINAL) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -383,6 +452,21 @@ Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) +======================================================================== + *** GPU DRIFT (GPU FINAL - CPU FINAL) *** +======================================================================== +VDW [Host-Host]: 0.00000 (0.00000 [K]) +VDW [Host-Guest]: 0.00000 (0.00000 [K]) +VDW [Guest-Guest]: -0.00000 (-0.00000 [K]) +Real Coulomb [Host-Host]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Guest-Guest]: 0.00000 (0.00000 [K]) +Ewald [Host-Host]: 0.00000 (0.00000 [K]) +Ewald [Host-Guest]: 0.00000 (0.00000 [K]) +Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) +DNN Energy: 0.00000 (0.00000 [K]) +Tail Correction Energy: 0.00000 (0.00000 [K]) +Total Energy: 0.00000 (0.00000 [K]) ======================================================================== ================================================================================ ======================== PRODUCTION PHASE AVERAGE ENERGIES (Simulation 0) ========================= diff --git a/Examples/Tail-Correction/output.txt b/Examples/Tail-Correction/output.txt index d0df37c..2345cb4 100644 --- a/Examples/Tail-Correction/output.txt +++ b/Examples/Tail-Correction/output.txt @@ -1,5 +1,5 @@ -/home/z/Desktop/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined -True path of exe is /home/z/Desktop/gRASPA_fork/src_clean/ +/home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/nvc_main.xChecking if all inputs are defined +True path of exe is /home/z/Desktop/gRASPA_versions/080424-code/gRASPA_fork/src_clean/ There are 1 simulations running only one simulation ------------------PARSING FORCE FIELD MIXING RULES---------------- @@ -1221,6 +1221,7 @@ Parsing [1] Component Component 0 starts at line number 33 -------------- READING AdsorbateComponent 0 (argon) -------------- Adsorbate Component is rigid +Ar, type: 20, Acharge = 0.00000 Bonds not implemented. Break Atom [0]: Type [20], Name: Ar, Mass: 39.948000, position: 0.00000 0.00000 0.00000 Adsorbate Type[20], Name: Ar, #: 1 @@ -1261,9 +1262,19 @@ Box Temperature: 87.00000 Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 -Ewald Summation (total energy) on the CPU took 0.00000 secs -Ewald Summation (total energy) on the GPU took 0.00000 secs +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 0.00000, Real: 0.00000 i: 20, j: 20, Ni: 0, Nj: 0, E: -0.00000 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 636, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +VDW + Real on the GPU took 0.00001 secs +i: 20, j: 20, Ni: 0, Nj: 0, E: -0.00000 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING INITIAL STAGE ENERGY ====================== Component 1, Need to create 0 full molecule ======================== CALCULATING CREATE_MOLECULE STAGE ENERGY ======================== @@ -1271,16 +1282,23 @@ Component 1, Need to create 0 full molecule Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: 0.00000; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 -Ewald Summation (total energy) on the CPU took 0.00000 secs -Ewald Summation (total energy) on the GPU took 0.00000 secs +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: 0.00000, Real: 0.00000 +Compoent [1-1], VDW: 0.00000, Real: 0.00000 +i: 20, j: 20, Ni: 0, Nj: 0, E: -0.00000 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 636, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +VDW + Real on the GPU took 0.00000 secs i: 20, j: 20, Ni: 0, Nj: 0, E: -0.00000 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING CREATE_MOLECULE STAGE ENERGY ====================== Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00241, temp: 87.00000 Number of Frameworks: 1 INITIALIZATION Cycle: 0, 0 Adsorbate Molecules, Total Energy: 0.00000 || Component 0 [BAZGAM_clean.cif], 1 Molecules || Component 1 [argon], 0 Molecules || -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 INITIALIZATION Cycle: 5000, 267 Adsorbate Molecules, Total Energy: -176244.88875 || Component 0 [BAZGAM_clean.cif], 1 Molecules || Component 1 [argon], 267 Molecules || ======================== MOVE STATISTICS FOR COMPONENT [1] (argon) ======================== =====================SWAP MOVES===================== @@ -1297,9 +1315,6 @@ Reinsertion Accepted: 841 Running Simulation Boxes in SERIAL, currently [0] box; pres: 0.00241, temp: 87.00000 Number of Frameworks: 1 EQUILIBRATION Cycle: 0, 447 Adsorbate Molecules, Total Energy: -303195.08229 || Component 0 [BAZGAM_clean.cif], 1 Molecules || Component 1 [argon], 447 Molecules || -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 EQUILIBRATION Cycle: 5000, 530 Adsorbate Molecules, Total Energy: -376444.42922 || Component 0 [BAZGAM_clean.cif], 1 Molecules || Component 1 [argon], 530 Molecules || EQUILIBRATION Cycle: 10000, 632 Adsorbate Molecules, Total Energy: -460563.80229 || Component 0 [BAZGAM_clean.cif], 1 Molecules || Component 1 [argon], 632 Molecules || EQUILIBRATION Cycle: 15000, 672 Adsorbate Molecules, Total Energy: -492711.55352 || Component 0 [BAZGAM_clean.cif], 1 Molecules || Component 1 [argon], 672 Molecules || @@ -1323,9 +1338,6 @@ Printing: Component: 0 [ BAZGAM_clean.cif ], NumMol: 1, Molsize: 636 Printing: Component: 1 [ argon ], NumMol: 722, Molsize: 1 Component 0, Molsize: 636 Component 1, Molsize: 1 -Cycle [4], Printing DeltaE -HHVDW: 0.00000, HHReal: 0.00000, HGVDW: 0.00000, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 -Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 PRODUCTION Cycle: 5000, 786 Adsorbate Molecules, Total Energy: -588825.22702 || Component 0 [BAZGAM_clean.cif], 1 Molecules || Component 1 [argon], 786 Molecules || Printing: Component: 0 [ BAZGAM_clean.cif ], NumMol: 1, Molsize: 636 Printing: Component: 1 [ argon ], NumMol: 786, Molsize: 1 @@ -1443,11 +1455,73 @@ BLOCK [4], Blocksize: 4000, Average: 761.86509, ErrorBar: 24.95958 Overall: Average: 686.13525, ErrorBar: 101.06825 ---------------------------------------------------------- ============================================================== +=====================Rosenbluth Summary===================== +There are 5 blocks +=====BLOCK 0===== +Widom Performed: 1363.0 +Framework Density: 126.77087 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 838.3926151672 +(Total) Averaged Excess Mu: -585.3639932244 +(Total) Averaged Henry Coefficient: 0.0091427014 +(Total) Converted to Fugacity: 16657.7070705105 [Pascal], Temp: 87.00000 [K] +Framework Density: 126.77087 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 838.3926151672 +(Insertion) Averaged Excess Mu: -585.3639932244 +(Insertion) Converted to Fugacity: 16657.7070705105 [Pascal], Temp: 87.00000 [K] +=====BLOCK 1===== +Widom Performed: 1320.0 +Framework Density: 126.77087 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 1110.1180784066 +(Total) Averaged Excess Mu: -609.7764694802 +(Total) Averaged Henry Coefficient: 0.0121058773 +(Total) Converted to Fugacity: 12580.3721830926 [Pascal], Temp: 87.00000 [K] +Framework Density: 126.77087 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 1110.1180784066 +(Insertion) Averaged Excess Mu: -609.7764694802 +(Insertion) Converted to Fugacity: 12580.3721830926 [Pascal], Temp: 87.00000 [K] +=====BLOCK 2===== +Widom Performed: 1316.0 +Framework Density: 126.77087 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 1499.5683645666 +(Total) Averaged Excess Mu: -635.9260200488 +(Total) Averaged Henry Coefficient: 0.0163528466 +(Total) Converted to Fugacity: 9313.1456514626 [Pascal], Temp: 87.00000 [K] +Framework Density: 126.77087 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 1499.5683645666 +(Insertion) Averaged Excess Mu: -635.9260200488 +(Insertion) Converted to Fugacity: 9313.1456514626 [Pascal], Temp: 87.00000 [K] +=====BLOCK 3===== +Widom Performed: 1317.0 +Framework Density: 126.77087 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 882.1606458582 +(Total) Averaged Excess Mu: -589.7891392958 +(Total) Averaged Henry Coefficient: 0.0096199934 +(Total) Converted to Fugacity: 15831.2419162019 [Pascal], Temp: 87.00000 [K] +Framework Density: 126.77087 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 882.1606458582 +(Insertion) Averaged Excess Mu: -589.7891392958 +(Insertion) Converted to Fugacity: 15831.2419162019 [Pascal], Temp: 87.00000 [K] +=====BLOCK 4===== +Widom Performed: 1338.0 +Framework Density: 126.77087 [kg/m^3] +(Total) Averaged Rosenbluth Weight: 648.8135149169 +(Total) Averaged Excess Mu: -563.0727961777 +(Total) Averaged Henry Coefficient: 0.0070753346 +(Total) Converted to Fugacity: 21524.9810191205 [Pascal], Temp: 87.00000 [K] +Framework Density: 126.77087 [kg/m^3] +(Insertion) Averaged Rosenbluth Weight: 648.8135149169 +(Insertion) Averaged Excess Mu: -563.0727961777 +(Insertion) Converted to Fugacity: 21524.9810191205 [Pascal], Temp: 87.00000 [K] +=========================AVERAGE======================== +Averaged Rosenbluth Weight: 995.8106437831 +/- 583.0552605455 +Averaged Excess Chemical Potential: -596.7856836454 +/- 49.1258944077 +Averaged Henry Coefficient [mol/kg/Pa]: 0.01085935068 +/- 0.006358238465 +Averaged Fugacity: 15181.4895680776 +/- 8199.7342392046 Printing: Component: 0 [ BAZGAM_clean.cif ], NumMol: 1, Molsize: 636 Printing: Component: 1 [ argon ], NumMol: 927, Molsize: 1 Component 0, Molsize: 636 Component 1, Molsize: 1 -Work took 1.646740 seconds +Work took 1.631678 seconds ====================================== CHECKING FINAL ENERGY FOR SYSTEM [0] ====================================== @@ -1456,9 +1530,25 @@ CHECKING FINAL ENERGY FOR SYSTEM [0] Host-Host VDW: 0.00000; Real: 0.00000 Host-Guest VDW: -714726.88212; Real: 0.00000 Guest-Guest VDW: 0.00000; Real: 0.00000 -Ewald Summation (total energy) on the CPU took 0.00000 secs -Ewald Summation (total energy) on the GPU took 0.00000 secs +********** PRINTING COMPONENT ENERGIES********** +Compoent [0-0], VDW: 0.00000, Real: 0.00000 +Compoent [0-1], VDW: -714726.88212, Real: 0.00000 +Compoent [1-1], VDW: 0.00000, Real: 0.00000 +i: 20, j: 20, Ni: 927, Nj: 927, E: -0.00000 +THERE IS MORE THAN 1 FRAMEWORK COMPONENTS +Framework Comp Zero Atoms: 636, Other Comp Atoms: 0 +NFrameworkZero_ExtraFramework interactions: 0, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: 0 +Atoms: 636 927 +Interactions: 0 589572 429201 +Nblock 81, blocks: 0 47 34, threads needed: 0 5896 4293, Nthread: 128 +GPU VDW REAL ENERGY: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -714726.88212, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 +VDW + Real on the GPU took 0.00028 secs i: 20, j: 20, Ni: 927, Nj: 927, E: -0.00000 +Total GPU Energy: +HHVDW: 0.00000, HHReal: 0.00000, HGVDW: -714726.88212, HGReal: 0.00000, GGVDW: 0.00000, GGReal: 0.00000, HHEwaldE: 0.00000, HGEwaldE: 0.00000, GGEwaldE: 0.00000, TailE: 0.00000, DNN_E: 0.00000 +Stored HGVDW: 0.00000, Stored HGReal: 0.00000, Stored HGEwaldE: 0.00000 ====================== DONE CALCULATING FINAL STAGE ENERGY ====================== ====================================== ======================== ENERGY SUMMARY (Simulation 0) ========================= @@ -1552,7 +1642,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -714726.88212 (-859619.37805 [K]) ======================================================================== - *** CHECK DELTA_E (FINAL - CREATE MOLECULE) *** + *** CHECK DELTA_E (RUNNING FINAL - CREATE MOLECULE) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: -714726.88212 (-859619.37805 [K]) @@ -1567,7 +1657,7 @@ DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: -714726.88212 (-859619.37805 [K]) ======================================================================== - *** ENERGY DRIFT *** + *** ENERGY DRIFT (CPU FINAL - RUNNING FINAL) *** ======================================================================== VDW [Host-Host]: 0.00000 (0.00000 [K]) VDW [Host-Guest]: 0.00000 (0.00000 [K]) @@ -1581,6 +1671,21 @@ Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) DNN Energy: 0.00000 (0.00000 [K]) Tail Correction Energy: 0.00000 (0.00000 [K]) Total Energy: 0.00000 (0.00000 [K]) +======================================================================== + *** GPU DRIFT (GPU FINAL - CPU FINAL) *** +======================================================================== +VDW [Host-Host]: 0.00000 (0.00000 [K]) +VDW [Host-Guest]: -0.00000 (-0.00000 [K]) +VDW [Guest-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Host]: 0.00000 (0.00000 [K]) +Real Coulomb [Host-Guest]: 0.00000 (0.00000 [K]) +Real Coulomb [Guest-Guest]: 0.00000 (0.00000 [K]) +Ewald [Host-Host]: 0.00000 (0.00000 [K]) +Ewald [Host-Guest]: 0.00000 (0.00000 [K]) +Ewald [Guest-Guest]: 0.00000 (0.00000 [K]) +DNN Energy: 0.00000 (0.00000 [K]) +Tail Correction Energy: 0.00000 (0.00000 [K]) +Total Energy: -0.00000 (-0.00000 [K]) ======================================================================== ================================================================================ ======================== PRODUCTION PHASE AVERAGE ENERGIES (Simulation 0) ========================= diff --git a/Examples/test_examples.py b/Examples/test_examples.py index cc097dd..480bdec 100644 --- a/Examples/test_examples.py +++ b/Examples/test_examples.py @@ -43,7 +43,10 @@ def check_energy_drift(relative_file_path): energy_drift_pattern = re.compile(r'ENERGY DRIFT') total_energy_pattern = re.compile(r'Total Energy:\s+([-+]?[0-9]*\.?[0-9]+)') + gpu_drift_pattern = re.compile(r'GPU DRIFT') + matches = list(energy_drift_pattern.finditer(content)) + gpu_matches = list(gpu_drift_pattern.finditer(content)) if not matches: return False @@ -58,6 +61,14 @@ def check_energy_drift(relative_file_path): if energy_value < 1e-3: finish = True + for match in gpu_matches: + search_start = match.end() + total_energy_match = total_energy_pattern.search(content, search_start) + if total_energy_match: + # Read the first float value in that line + energy_value = float(total_energy_match.group(1)) + print(f"This simulation in {folder_name} folder has a GPU final energy drift of {energy_value} (internal unit, 10 J/mol)\n") + # Search for "Work took" and "seconds" in the same line work_took_pattern = re.compile(r'Work took\s+([-+]?[0-9]*\.?[0-9]+)\s+seconds') work_took_match = work_took_pattern.search(content) diff --git a/src_clean/Ewald_Energy_Functions.h b/src_clean/Ewald_Energy_Functions.h index 6b4949e..522765a 100644 --- a/src_clean/Ewald_Energy_Functions.h +++ b/src_clean/Ewald_Energy_Functions.h @@ -722,19 +722,19 @@ __global__ void Setup_Ewald_Vector(Boxsize Box, Complex* eik_x, Complex* eik_y, size_t i = blockIdx.x * blockDim.x + threadIdx.x; //number of threads = number of atoms in the system if(i < numberOfAtoms) { - //size_t atom_i = i; size_t atom_i = i; Complex tempcomplex; tempcomplex.real = 1.0; tempcomplex.imag = 0.0; - size_t comp = 0; size_t totsize = 0; + size_t comp = 0; for(size_t ijk = 0; ijk < NumberOfComponents; ijk++) { - size_t Atom_ijk = System[ijk].size; - totsize += Atom_ijk; - if(atom_i >= totsize) + //totalsize += d_a[ijk].size; + if(atom_i >= System[ijk].size) { - comp ++; - atom_i -= Atom_ijk; + comp++; + atom_i -= System[ijk].size; } + else + {break;} } if(UseOffSet) { @@ -755,7 +755,6 @@ __global__ void Setup_Ewald_Vector(Boxsize Box, Complex* eik_x, Complex* eik_y, { eik_x[i + kx * numberOfAtoms] = multiply(eik_x[i + (kx - 1) * numberOfAtoms], eik_x[i + 1 * numberOfAtoms]); } - //printf("BEFORE THE LOOP! eik_y[1] = %.5f %.5f\n", eik_y[1].real, eik_y[1].imag); for(size_t ky = 2; ky <= Box.kmax.y; ++ky) { @@ -771,14 +770,37 @@ __global__ void Setup_Ewald_Vector(Boxsize Box, Complex* eik_x, Complex* eik_y, //Zhao's note: Idea was that every block considers a grid point for Ewald (a set of kxyz)// //So the number of atoms each thread needs to consider = TotalAtoms / Nthreads per block (usually 128)// -__global__ void TotalEwald(Atoms* d_a, Boxsize Box, double* BlockSum, Complex* eik_x, Complex* eik_y, Complex* eik_z, Complex* Eik, size_t totAtom, size_t Ncomp, size_t NAtomPerThread, size_t residueAtoms) +__global__ void TotalEwald(Atoms* d_a, Boxsize Box, double* BlockSum, Complex* eik_x, Complex* eik_y, Complex* eik_z, Complex* FrameworkEik, Complex* Eik, size_t totAtom, int2 NAtomPerThread, int2 residueAtoms, int2 HostGuestthreads, int3 NComponents, size_t Nblock) { - __shared__ double3 sdata[128]; //maybe just need Complex// + __shared__ double3 sdata[256]; //maybe just need Complex// + //DEBUG + //__shared__ int count_data[128]; count_data[threadIdx.x] = 0; + int adsorbate_count = 0; + int cache_id = threadIdx.x; size_t total_ij = blockIdx.x * blockDim.x + threadIdx.x; size_t ij_within_block = total_ij - blockIdx.x * blockDim.x; size_t kxyz = blockIdx.x; //Each block takes over one grid point// + + size_t HostThreads = HostGuestthreads.x; + size_t GuestThreads= HostGuestthreads.y; + + int RealThreads = HostThreads; + + int RealNAtomPerThread = NAtomPerThread.x; + int RealresidueAtoms = residueAtoms.x; + + if(threadIdx.x >= HostThreads) + { + RealThreads = GuestThreads; + RealNAtomPerThread = NAtomPerThread.y; + RealresidueAtoms = residueAtoms.y; + } + + sdata[threadIdx.x] = {0.0, 0.0, 0.0}; + sdata[threadIdx.x + blockDim.x] = {0.0, 0.0, 0.0}; + //size_t kx_max = Box.kmax.x; size_t ky_max = Box.kmax.y; size_t kz_max = Box.kmax.z; @@ -821,26 +843,38 @@ __global__ void TotalEwald(Atoms* d_a, Boxsize Box, double* BlockSum, Complex* e const double kvecx = kx*ux; const double kvecy = kx*uy + ky*vy; const double kvecz = kx*uz + ky*vz + kz*wz; - ksqr = kvecx*kvecx + kvecy*kvecy + kvecz*kvecz; + ksqr = kvecx*kvecx + kvecy*kvecy + kvecz*kvecz; } + size_t offset = 0; + size_t atomoffset = 0; + //If adsorbate atom, offset number of atoms by number of framework atoms// + if(ij_within_block >= HostThreads) + { + offset = HostThreads;// * NAtomPerThread.x + residueAtoms.x; //offset in terms of # of thread + atomoffset = offset * NAtomPerThread.x + residueAtoms.x; //offset in terms of # of atoms + } + Complex cksum; cksum.real = 0.0; cksum.imag = 0.0; + if((ksqr > 1e-10) && (ksqr < Box.ReciprocalCutOff)) { temp = factor * std::exp((-0.25 / alpha_squared) * rksq) / rksq; - for(size_t a = 0; a < NAtomPerThread; a++) + for(size_t a = 0; a < RealNAtomPerThread; a++) { - size_t Atom = a + NAtomPerThread * ij_within_block; - size_t AbsoluteAtom = Atom; size_t comp = 0; size_t totsize = 0; - for(size_t it_comp = 0; it_comp < Ncomp; it_comp++) + size_t Atom = a + RealNAtomPerThread * (ij_within_block - offset) + atomoffset; + size_t AbsoluteAtom = Atom; size_t comp = 0; + for(size_t ijk = 0; ijk < NComponents.x; ijk++) { - size_t Atom_ijk = d_a[it_comp].size; - totsize += Atom_ijk; - if(Atom >= totsize) + //totalsize += d_a[ijk].size; + if(Atom >= d_a[ijk].size) { comp++; - Atom -= d_a[it_comp].size; + Atom -= d_a[ijk].size; } + else + {break;} } + Complex eik_temp = eik_y[AbsoluteAtom + totAtom * static_cast(std::abs(ky))]; eik_temp.imag = ky>=0 ? eik_temp.imag : -eik_temp.imag; Complex eik_xy = multiply(eik_x[AbsoluteAtom + totAtom * static_cast(kx)], eik_temp); @@ -852,24 +886,30 @@ __global__ void TotalEwald(Atoms* d_a, Boxsize Box, double* BlockSum, Complex* e Complex tempi = multiply(eik_xy, eik_temp); cksum.real += scaling * charge * tempi.real; cksum.imag += scaling * charge * tempi.imag; + if(comp >= NComponents.y) + adsorbate_count ++; } - if(residueAtoms > 0) + if(RealresidueAtoms > 0) { - if(ij_within_block < residueAtoms) //the thread will read one more atom in the residueAtoms// - //The thread from zero to residueAtoms will each take another atom// + if((ij_within_block-offset) < RealresidueAtoms) //the thread will read one more atom in the RealresidueAtoms// + //The thread from zero to RealresidueAtoms will each take another atom// { - //Zhao's note: blockDim = number of threads in a block, blockDim.x * NAtomPerThread = the last atom position if there is no residue// - size_t Atom = blockDim.x * NAtomPerThread + ij_within_block; - size_t AbsoluteAtom = Atom; size_t comp = 0; size_t totsize = 0; - for(size_t it_comp = 0; it_comp < Ncomp; it_comp++) + //Zhao's note: RealThreads = number of threads for framework/adsorbate in a block, RealThreads * RealNAtomPerThread = the last atom position if there is no residue// + //for adsorbate, offset number of atoms by number of framework atoms// + //size_t Atom = RealThreads * RealNAtomPerThread + (ij_within_block - offset) + offset * NAtomPerThread.x + residueAtoms.x; + size_t Atom = RealThreads * RealNAtomPerThread + (ij_within_block - offset) + atomoffset; + // - offset) + offset * NAtomPerThread.x + residueAtoms.x; + size_t AbsoluteAtom = Atom; size_t comp = 0; + for(size_t ijk = 0; ijk < NComponents.x; ijk++) { - size_t Atom_ijk = d_a[it_comp].size; - totsize += Atom_ijk; - if(Atom >= totsize) + //totalsize += d_a[ijk].size; + if(Atom >= d_a[ijk].size) { comp++; - Atom -= d_a[it_comp].size; + Atom -= d_a[ijk].size; } + else + {break;} } Complex eik_temp = eik_y[AbsoluteAtom + totAtom * static_cast(std::abs(ky))]; eik_temp.imag = ky>=0 ? eik_temp.imag : -eik_temp.imag; @@ -881,13 +921,29 @@ __global__ void TotalEwald(Atoms* d_a, Boxsize Box, double* BlockSum, Complex* e double scaling = d_a[comp].scaleCoul[Atom]; Complex tempi = multiply(eik_xy, eik_temp); cksum.real += scaling * charge * tempi.real; - cksum.imag += scaling * charge * tempi.imag; + cksum.imag += scaling * charge * tempi.imag; + //DEBUG + /* + if(blockIdx.x == 10) + { + printf("eikxyz locations: %lu, %lu, %lu\n", AbsoluteAtom + totAtom * static_cast(kx), AbsoluteAtom + totAtom * static_cast(std::abs(ky)), AbsoluteAtom + totAtom * static_cast(std::abs(kz))); + printf("RESIDUAL COMP: %lu, ATOM %lu, tempi: %.5f %.5f\n", comp, Atom, tempi.real, tempi.imag); + printf("eik_x: %.5f %.5f\n", eik_x[AbsoluteAtom + totAtom * static_cast(kx)].real, eik_x[AbsoluteAtom + totAtom * static_cast(kx)].imag); + printf("eik_y: %.5f %.5f\n", eik_y[AbsoluteAtom + totAtom * static_cast(std::abs(ky))].real, eik_y[AbsoluteAtom + totAtom * static_cast(std::abs(ky))].imag); + printf("eik_xy: %.5f %.5f\n", eik_xy.real, eik_xy.imag); + printf("eik_z: %.5f %.5f\n", eik_z[AbsoluteAtom + totAtom * static_cast(std::abs(kz))].real, eik_z[AbsoluteAtom + totAtom * static_cast(std::abs(kz))].imag); + } + */ } } - //double2 TEMP; TEMP.x = cksum.real; TEMP.y = cksum.imag; } - sdata[ij_within_block].x = cksum.real; - sdata[ij_within_block].y = cksum.imag; + size_t OFFSET = 0; + if(threadIdx.x >= HostThreads) + { + OFFSET = blockDim.x; + } + sdata[ij_within_block+OFFSET].x = cksum.real; + sdata[ij_within_block+OFFSET].y = cksum.imag; __syncthreads(); //Partial block sum// int i=blockDim.x / 2; @@ -897,6 +953,12 @@ __global__ void TotalEwald(Atoms* d_a, Boxsize Box, double* BlockSum, Complex* e { sdata[cache_id].x += sdata[cache_id + i].x; sdata[cache_id].y += sdata[cache_id + i].y; + + sdata[cache_id + blockDim.x].x += sdata[cache_id + i + blockDim.x].x; + sdata[cache_id + blockDim.x].y += sdata[cache_id + i + blockDim.x].y; + + //DEBUG + //count_data[cache_id] += count_data[cache_id + i]; } __syncthreads(); i /= 2; @@ -904,10 +966,84 @@ __global__ void TotalEwald(Atoms* d_a, Boxsize Box, double* BlockSum, Complex* e if(cache_id == 0) { Complex cksum; cksum.real = sdata[0].x; cksum.imag = sdata[0].y; + Complex cksum_ads = {sdata[blockDim.x].x, sdata[blockDim.x].y}; + //Complex cksum_ads; cksum_ads.real = sdata[blockDim.x].x - cksum.real; cksum_ads.imag = sdata[blockDim.x].y - cksum.imag; double NORM = ComplexNorm(cksum); - BlockSum[blockIdx.x] = temp * NORM; - Eik[blockIdx.x].real = sdata[0].x; - Eik[blockIdx.x].imag = sdata[0].y; + double NORM_ads = ComplexNorm(cksum_ads); + BlockSum[blockIdx.x] = temp * NORM; //framework-framework + BlockSum[blockIdx.x + Nblock] = temp * NORM_ads; //adsorbate-adsorbate + BlockSum[blockIdx.x + Nblock + Nblock] = temp * (cksum.real * cksum_ads.real + cksum.imag * cksum_ads.imag)*2.0; //framework-adsorbate, dont forget the 2.0!!!// + + /*//DEBUG + if(blockIdx.x == 200) + { + printf("COUNTED %u adsorbate atoms\n", count_data[0]); + printf("Block %u, HHFourier E: %.5f, GGFourier E: %.5f\n", blockIdx.x, BlockSum[blockIdx.x], BlockSum[blockIdx.x + Nblock]); + } + */ + + FrameworkEik[blockIdx.x].real = sdata[0].x; + FrameworkEik[blockIdx.x].imag = sdata[0].y; + Eik[blockIdx.x].real = sdata[blockDim.x].x; + Eik[blockIdx.x].imag = sdata[blockDim.x].y; + } +} + +__global__ void Framework_ComponentZero_Calculate_Intra_Self_Exclusion(Boxsize Box, Atoms* System, double* BlockSum, size_t IntraInteractions, size_t InteractionPerThread, size_t TotalThreadsNeeded) +{ + double E = 0.0; double prefactor_self = Box.Prefactor * Box.Alpha / std::sqrt(M_PI); + extern __shared__ double sdata[]; + size_t SelectedComponent = 0; + sdata[threadIdx.x] = 0.0; int cache_id = threadIdx.x; + //put all the framework atoms threads in one block// + size_t THREADIdx = blockIdx.x * blockDim.x + threadIdx.x; + size_t NAtoms = System[SelectedComponent].size; + for(size_t i = 0; i != InteractionPerThread; i++) + { + size_t InteractionIdx = THREADIdx * InteractionPerThread + i; + //Unwrap Atoms from interactions (upper triangle)// + size_t AtomA = NAtoms - 2 - std::floor(std::sqrt(-8*InteractionIdx + 4*NAtoms*(NAtoms-1)-7)/2.0 - 0.5); + size_t AtomB = InteractionIdx + AtomA + 1 - NAtoms*(NAtoms-1)/2 + (NAtoms-AtomA)*((NAtoms-AtomA)-1)/2; + + if(AtomA < NAtoms && AtomB < NAtoms) + { + double factorA = System[SelectedComponent].scaleCoul[AtomA] * System[SelectedComponent].charge[AtomA]; + double3 posA = System[SelectedComponent].pos[AtomA]; + + double factorB = System[SelectedComponent].scaleCoul[AtomB] * System[SelectedComponent].charge[AtomB]; + double3 posB = System[SelectedComponent].pos[AtomB]; + double3 posvec = posA - posB; + PBC(posvec, Box.Cell, Box.InverseCell, Box.Cubic); + double rr_dot = dot(posvec, posvec); + double r = std::sqrt(rr_dot); + E += Box.Prefactor * factorA * factorB * std::erf(Box.Alpha * r) / r; + //For self interactions/////////////////////////////////////////////////////////// + //find those where AtomB > AtomA, AtomB - AtomA = 1 (along the diagonal) // + //use AtomB for these // + //you will miss AtomB = 0, so if AtomB = 1 and AtomA = 0, use property of AtomA // + ////////////////////////////////////////////////////////////////////////////////// + if(AtomB - AtomA == 1) + { + E += prefactor_self * factorB * factorB; + if(AtomA == 0) + E += prefactor_self * factorA * factorA; + } + } + } + //if(THREADIdx == 0) printf("ThreadID 0, ThreadE: %.5f", E); + sdata[threadIdx.x] = -E; + __syncthreads(); + //Partial block sum// + int i=blockDim.x / 2; + while(i != 0) + { + if(cache_id < i) {sdata[cache_id] += sdata[cache_id + i];} + __syncthreads(); + i /= 2; + } + if(threadIdx.x == 0) + { + BlockSum[blockIdx.x] = sdata[0]; } } @@ -971,7 +1107,7 @@ __global__ void Calculate_Intra_Self_Exclusion(Boxsize Box, Atoms* System, doubl } if(threadIdx.x == 0) { - BlockSum[blockIdx.x] += sdata[0]; + BlockSum[blockIdx.x] = sdata[0]; } } @@ -987,12 +1123,29 @@ MoveEnergy Ewald_TotalEnergy(Simulations& Sim, Components& SystemComponents, boo Boxsize Box= Sim.Box; Atoms* d_a = Sim.d_a; - for(size_t i = 0; i < SystemComponents.Total_Components; i++) - NTotalAtom += SystemComponents.NumberOfMolecule_for_Component[i] * SystemComponents.Moleculesize[i]; + size_t NHostAtom = 0; size_t NGuestAtom = 0; + for(size_t i = 0; i < SystemComponents.NComponents.y; i++) + NHostAtom += SystemComponents.Moleculesize[i] * SystemComponents.NumberOfMolecule_for_Component[i]; + for(size_t i = SystemComponents.NComponents.y; i < SystemComponents.NComponents.x; i++) + NGuestAtom+= SystemComponents.Moleculesize[i] * SystemComponents.NumberOfMolecule_for_Component[i]; + + NTotalAtom = NHostAtom + NGuestAtom; + + int2 NHostGuestthread; + //Number of Host threads in a block// + NHostGuestthread.x = static_cast(static_cast(NHostAtom) / static_cast(NTotalAtom) * Nthread); + NHostGuestthread.y = Nthread - NHostGuestthread.x; + if(NTotalAtom > 0) { - size_t NAtomPerThread = NTotalAtom / Nthread; - size_t residueAtoms = NTotalAtom % Nthread; + int2 NAtomPerThread = {NHostAtom > 0 ? NHostAtom / NHostGuestthread.x : 0, NGuestAtom > 0 ? NGuestAtom / NHostGuestthread.y : 0}; + int2 residueAtoms = {NHostAtom > 0 ? NHostAtom % NHostGuestthread.x : 0, NGuestAtom > 0 ? NGuestAtom % NHostGuestthread.y : 0}; + + printf("GPU Ewald Summary: NHostAtom: %zu, NGuestAtom: %zu\n", NHostAtom, NGuestAtom); + printf("GPU Ewald Summary: Nthread: %zu, Host thread: %d, Guest thread: %d\n", Nthread, NHostGuestthread.x, NHostGuestthread.y); + printf("Host NAtomPerThread: %d, Guest NAtomPerThread: %d\n", NAtomPerThread.x, NAtomPerThread.y); + printf("Host residueAtoms: %d, Guest residueAtoms: %d\n", residueAtoms.x, residueAtoms.y); + //Setup eikx, eiky, and eikz// Setup_threadblock(NTotalAtom, &Nblock, &Nthread); @@ -1001,70 +1154,92 @@ MoveEnergy Ewald_TotalEnergy(Simulations& Sim, Components& SystemComponents, boo Complex* eikz; cudaMalloc(&eikz, NTotalAtom * (Box.kmax.z + 1) * sizeof(Complex)); Setup_Ewald_Vector<<>>(Box, eikx, eiky, eikz, d_a, NTotalAtom, SystemComponents.Total_Components, UseOffSet); + Complex* host_eikx; Complex* host_eiky; Complex* host_eikz; + host_eikx = (Complex*) malloc(NTotalAtom * (Box.kmax.x + 1)*sizeof(Complex)); + host_eiky = (Complex*) malloc(NTotalAtom * (Box.kmax.y + 1)*sizeof(Complex)); + host_eikz = (Complex*) malloc(NTotalAtom * (Box.kmax.z + 1)*sizeof(Complex)); + + cudaMemcpy(host_eikx, eikx, NTotalAtom * (Box.kmax.x + 1)*sizeof(Complex), cudaMemcpyDeviceToHost); + cudaMemcpy(host_eiky, eiky, NTotalAtom * (Box.kmax.y + 1)*sizeof(Complex), cudaMemcpyDeviceToHost); + cudaMemcpy(host_eikz, eikz, NTotalAtom * (Box.kmax.z + 1)*sizeof(Complex), cudaMemcpyDeviceToHost); + Nblock = (Box.kmax.x + 1) * (2 * Box.kmax.y + 1) * (2 * Box.kmax.z + 1); + Complex* tempFrameworkEik; cudaMalloc(&tempFrameworkEik, Nblock * sizeof(Complex)); + //printf("Nblocks for Ewald Total: %zu, allocated %zu blocks\n", Nblock, Sim.Nblocks); - if(Nblock > Sim.Nblocks) + if(Nblock*3 > Sim.Nblocks) { printf("Need to Allocate more space for blocksum\n"); cudaMalloc(&Sim.Blocksum, Nblock * sizeof(double)); } Nthread= 128; - //printf("Parallel Total Ewald (Calculation), Nblock: %zu, Nthread: %zu, NAtomPerThread: %zu, residue: %zu\n", Nblock, Nthread, NAtomPerThread, residueAtoms); - //printf("kmax: %d %d %d, RecipCutoff: %.5f\n", Box.kmax.x, Box.kmax.y, Box.kmax.z, Box.ReciprocalCutOff); - TotalEwald<<>>(d_a, Box, Sim.Blocksum, eikx, eiky, eikz, Box.tempEik, NTotalAtom, SystemComponents.Total_Components, NAtomPerThread, residueAtoms); + TotalEwald<<>>(d_a, Box, Sim.Blocksum, eikx, eiky, eikz, tempFrameworkEik, Box.tempEik, NTotalAtom, NAtomPerThread, residueAtoms, NHostGuestthread, SystemComponents.NComponents, Nblock); cudaFree(eikx); cudaFree(eiky); cudaFree(eikz); - double HostTotEwald[Nblock]; - /* - cudaMemcpy(HostTotEwald, Sim.Blocksum, Nblock * sizeof(double), cudaMemcpyDeviceToHost); - for(size_t i = 0; i < Nblock; i++) E.GGEwaldE += HostTotEwald[i]; - //printf("Total Fourier: %.10f\n", TotEwald); - //Add exclusion part // - double ExclusionE = 0.0; - for(size_t i = 0; i < SystemComponents.Total_Components; i++) - { - double Nfull = (double) SystemComponents.NumberOfMolecule_for_Component[i]; - if(SystemComponents.hasfractionalMolecule[i]) - { - Nfull--; - double delta = SystemComponents.Lambda[i].delta; - size_t Bin = SystemComponents.Lambda[i].currentBin; - double Lambda = delta * static_cast(Bin); - double2 Scale = SystemComponents.Lambda[i].SET_SCALE(Lambda); - Nfull += std::pow(Scale.y,2); - } - ExclusionE = (SystemComponents.ExclusionIntra[i] + SystemComponents.ExclusionAtom[i]) * Nfull; - E.GGEwaldE-= ExclusionE; - } - */ - //double GGFourier = 0.0; - cudaMemcpy(HostTotEwald, Sim.Blocksum, Nblock * sizeof(double), cudaMemcpyDeviceToHost); - //DEBUG// - //for(size_t i = 0; i < Nblock; i++) GGFourier += HostTotEwald[i]; - //printf("After fourier, GGFourier: %.5f,Fourier blocks: %zu\n", GGFourier, Nblock); + double HostTotEwald[Nblock*3]; //HH + HG + GG// + double HHFourier = 0.0; + double GGFourier = 0.0; + double HGFourier = 0.0; + + cudaMemcpy(HostTotEwald, Sim.Blocksum, 3*Nblock * sizeof(double), cudaMemcpyDeviceToHost); + for(size_t i = 0; i < Nblock; i++) HHFourier += HostTotEwald[i]; + for(size_t i = Nblock; i < Nblock*2; i++) GGFourier += HostTotEwald[i]; + for(size_t i = Nblock*2; i < Nblock*3; i++) HGFourier += HostTotEwald[i]; - //for(size_t i = 0; i < Nblock; i++) HostTotEwald[i] = 0.0; - //cudaMemcpy(Sim.Blocksum, HostTotEwald, Nblock * sizeof(double), cudaMemcpyHostToDevice); - //DEBUG END// + double TOTFourier = 0.0; + for(size_t i = 0; i < Nblock*3; i++) TOTFourier += HostTotEwald[i]; + + printf("GPU fourier, HHFourier: %.5f, GGFourier: %.5f, HGFourier: %.5f, TOTFourier: %.5f\n", HHFourier, GGFourier, HGFourier, TOTFourier); + E.HHEwaldE = HHFourier; + E.HGEwaldE = HGFourier; + E.GGEwaldE = GGFourier; //Recalculate exclusion part of Ewald summation// - size_t maxblock = Nblock; - for(size_t i = SystemComponents.NComponents.y; i < SystemComponents.NComponents.x; i++) + size_t Exclusion_Nblock = 0; size_t Exclusion_Nthread = 0; + //Framework, component zero, assume the backbone of framework has only 1 molecule// + //Parallelized over atoms// + //Each block handles the Intra + self for one atom in framework, component zero// + size_t FrameworkCompZeroAtoms = SystemComponents.Moleculesize[0] * SystemComponents.NumberOfMolecule_for_Component[0]; + if(FrameworkCompZeroAtoms > 0 && SystemComponents.NumberOfMolecule_for_Component[0] == 1) + { + size_t IntraInteractions = FrameworkCompZeroAtoms * (FrameworkCompZeroAtoms - 1) / 2; + size_t InteractionPerThread = 100; + size_t TotalThreadsNeeded = IntraInteractions / InteractionPerThread + (IntraInteractions % InteractionPerThread == 0 ? 0 : 1); + Setup_threadblock(TotalThreadsNeeded, &Exclusion_Nblock, &Exclusion_Nthread); + + //DEBUG//printf("Component %zu, Atoms: %zu, IntraInteractions: %zu, totalThreads: %zu, Nblock: %zu, Nthread: %zu\n", 0, FrameworkCompZeroAtoms, IntraInteractions, TotalThreadsNeeded, Exclusion_Nblock, Exclusion_Nthread); + + Framework_ComponentZero_Calculate_Intra_Self_Exclusion<<>>(Box, d_a, Sim.Blocksum, IntraInteractions, InteractionPerThread, TotalThreadsNeeded); + checkCUDAErrorEwald("error Calculating Intra Self Exclusion (FRAMEWORK) for Ewald Summation for Total Ewald summation!!!"); + + double FrameworkExclusion = 0.0; + cudaMemcpy(HostTotEwald, Sim.Blocksum, Exclusion_Nblock * sizeof(double), cudaMemcpyDeviceToHost); + for(size_t i = 0; i < Exclusion_Nblock; i++) FrameworkExclusion += HostTotEwald[i]; + printf("Framework Component 0 Exclusion: %.5f\n", FrameworkExclusion); + E.HHEwaldE += FrameworkExclusion; + } + //Framework component > 0 and Adsorbate// + //Parallelized over molecules// + for(size_t i = 1; i < SystemComponents.NComponents.x; i++) { if(SystemComponents.NumberOfMolecule_for_Component[i] == 0) continue; - size_t Exclusion_Nblock = 0; size_t Exclusion_Nthread = 0; Setup_threadblock(SystemComponents.NumberOfMolecule_for_Component[i], &Exclusion_Nblock, &Exclusion_Nthread); printf("Component %zu, Nblock: %zu, Nthread: %zu\n", i, Exclusion_Nblock, Exclusion_Nthread); - Calculate_Intra_Self_Exclusion<<>>(Box, d_a, Sim.Blocksum, i); checkCUDAErrorEwald("error Calculating Intra Self Exclusion for Ewald Summation for Total Ewald summation!!!"); - //if(Exclusion_Nblock > maxblock) maxblock = Exclusion_Nblock; //Zhao's note: you might run into special cases, but still there are special treatments that needs to be done (currently not done) + Calculate_Intra_Self_Exclusion<<>>(Box, d_a, Sim.Blocksum, i); + checkCUDAErrorEwald("error Calculating Intra Self Exclusion (ADSORBATE) for Ewald Summation for Total Ewald summation!!!"); //Curently we are assuming that the number of blocks for self+exclusion is smaller than total number of kspace points (99.99999% true) + //Zhao's note: assume that you use less blocks for intra-self exclusion + cudaMemcpy(HostTotEwald, Sim.Blocksum, Exclusion_Nblock * sizeof(double), cudaMemcpyDeviceToHost); + double Component_Exclusion = 0.0; + for(size_t ii = 0; ii < Exclusion_Nblock; ii++) Component_Exclusion += HostTotEwald[ii]; + printf("Component %zu, Exclusion (self + intra) = %.5f\n", i, Component_Exclusion); + if(i < SystemComponents.NComponents.y) + { + E.HHEwaldE += Component_Exclusion; + } + else E.GGEwaldE += Component_Exclusion; } - - //Zhao's note: assume that you use less blocks for intra-self exclusion - cudaMemcpy(HostTotEwald, Sim.Blocksum, maxblock * sizeof(double), cudaMemcpyDeviceToHost); - for(size_t i = 0; i < maxblock; i++) E.GGEwaldE += HostTotEwald[i]; - printf("GPU Ewald: %.5f\n", E.GGEwaldE); } return E; } diff --git a/src_clean/VDW_Coulomb.cu b/src_clean/VDW_Coulomb.cu index 50fa9a5..1179d26 100644 --- a/src_clean/VDW_Coulomb.cu +++ b/src_clean/VDW_Coulomb.cu @@ -8,6 +8,16 @@ #include "DNN_HostGuest_Energy_Functions.h" +inline void checkCUDAErrorVDW(const char *msg) +{ + cudaError_t err = cudaGetLastError(); + if( cudaSuccess != err) + { + printf("CUDA Error: %s: %s.\n", msg, cudaGetErrorString(err) ); + exit(EXIT_FAILURE); + } +} + //Zhao's note: There were a few variants of the same Setup_threadblock function, some of them are slightly different// //This might be a point where debugging is needed// void Setup_threadblock(size_t arraysize, size_t *Nblock, size_t *Nthread) @@ -83,6 +93,7 @@ void VDWReal_Total_CPU(Boxsize Box, Atoms* Host_System, Atoms* System, ForceFiel size_t selectedMol = 44; //size_t selectedMol = SystemComponents.NumberOfMolecule_for_Component[selectedComp] - 1; std::vector FBES; std::vector CHAINES; + std::vector ComponentEnergy(SystemComponents.NComponents.x * SystemComponents.NComponents.x, {0.0, 0.0}); int InteractionType; for(size_t compi=0; compi < SystemComponents.Total_Components; compi++) { @@ -141,6 +152,7 @@ void VDWReal_Total_CPU(Boxsize Box, Atoms* Host_System, Atoms* System, ForceFiel Total_VDW[InteractionType] += 0.5*result[0]; //if((compi > 0) && (compj > 0)) printf("Compi: %zu Mol[%zu], compj: %zu Mol[%zu], GG_E: %.5f\n", compi, MoleculeID, compj, MoleculeIDB, result[0]); VDW_energy += 0.5*result[0]; + ComponentEnergy[compi * SystemComponents.NComponents.x + compj].x += 0.5*result[0]; //if(std::abs(result[0]) > 10000) printf("Very High Energy (VDW), comps: %zu, %zu, MolID: %zu %zu, Atom: %zu %zu, E: %.5f\n", compi, compj, MoleculeID, MoleculeIDB, i, j, result[0]); //DEBUG// if(MoleculeID == selectedMol && (compi == selectedComp)) @@ -172,6 +184,7 @@ void VDWReal_Total_CPU(Boxsize Box, Atoms* Host_System, Atoms* System, ForceFiel CoulombReal(chargeA, chargeB, r, scalingCoul, resultCoul, Box.Prefactor, Box.Alpha); Total_Real[InteractionType] += 0.5*resultCoul[0]; Coul_energy += 0.5*resultCoul[0]; + ComponentEnergy[compi * SystemComponents.NComponents.x + compj].y += 0.5*resultCoul[0]; //if(std::abs(result[0]) > 10000) printf("Very High Energy (Coul), comps: %zu, %zu, MolID: %zu %zu, Atom: %zu %zu, E: %.5f\n", compi, compj, MoleculeID, MoleculeIDB, i, j, resultCoul[0]); //DEBUG// if(MoleculeID == selectedMol && (compi == selectedComp)) @@ -199,10 +212,20 @@ void VDWReal_Total_CPU(Boxsize Box, Atoms* Host_System, Atoms* System, ForceFiel printf("Host-Host VDW: %.5f; Real: %.5f\n", Total_VDW[HH], Total_Real[HH]); printf("Host-Guest VDW: %.5f; Real: %.5f\n", Total_VDW[HG], Total_Real[HG]); printf("Guest-Guest VDW: %.5f; Real: %.5f\n", Total_VDW[GG], Total_Real[GG]); + E.HHVDW = Total_VDW[HH]; E.HHReal= Total_Real[HH]; E.HGVDW = Total_VDW[HG]; E.HGReal= Total_Real[HG]; E.GGVDW = Total_VDW[GG]; E.GGReal= Total_Real[GG]; + printf("********** PRINTING COMPONENT ENERGIES**********\n"); + for(size_t i = 0; i < SystemComponents.NComponents.x; i++) + for(size_t j = i; j < SystemComponents.NComponents.x; j++) + { + double VDW = (i == j) ? ComponentEnergy[i * SystemComponents.NComponents.x + j].x : 2.0 * ComponentEnergy[i * SystemComponents.NComponents.x + j].x; + double Real = (i == j) ? ComponentEnergy[i * SystemComponents.NComponents.x + j].y : 2.0 * ComponentEnergy[i * SystemComponents.NComponents.x + j].y; + printf("Compoent [%zu-%zu], VDW: %.5f, Real: %.5f\n", i, j, VDW, Real); + + } textrestartFile.close(); } @@ -1288,7 +1311,8 @@ __global__ void Calculate_Multiple_Trial_Energy_SEPARATE_HostGuest_VDWReal(Boxsi */ } - if (FF.VDWRealBias && !FF.noCharges && rr_dot < FF.CutOffCoul) + //if (FF.VDWRealBias && !FF.noCharges && rr_dot < FF.CutOffCoul) + if (!FF.noCharges && rr_dot < FF.CutOffCoul) { const double chargeB = NewMol.charge[j]; const double scalingCoulombB = NewMol.scaleCoul[j]; @@ -1329,197 +1353,315 @@ __global__ void Calculate_Multiple_Trial_Energy_SEPARATE_HostGuest_VDWReal(Boxsi //} } -__device__ void VDWCoulEnergy_Total(Boxsize Box, Atoms ComponentA, Atoms ComponentB, size_t Aij, size_t Bij, ForceField FF, bool* flag, bool& Blockflag, double& tempy, size_t NA, size_t NB, bool UseOffset) +__device__ void VDWCoulEnergy_Total(Boxsize Box, Atoms ComponentA, Atoms ComponentB, ForceField FF, bool* flag, double2& tempy, size_t posA, size_t posB, size_t compA, size_t compB, bool UseOffset) +{ + //compA may go beyond the bound, if this happens, check if compA + 1 goes beyond endcompA// + size_t OffsetA = 0; + if(UseOffset) OffsetA = ComponentA.Allocate_size / 2; //Read the positions shifted to the later half of the storage// + const double scaleA = ComponentA.scale[posA]; + const double chargeA = ComponentA.charge[posA]; + const double scalingCoulombA = ComponentA.scaleCoul[posA]; + const size_t typeA = ComponentA.Type[posA]; + + const double3 PosA = ComponentA.pos[posA + OffsetA]; + + size_t OffsetB = 0; + if(UseOffset) OffsetB = ComponentB.Allocate_size / 2; //Read the positions shifted to the later half of the storage// + const double scaleB = ComponentB.scale[posB]; + const double chargeB = ComponentB.charge[posB]; + const double scalingCoulombB = ComponentB.scaleCoul[posB]; + const size_t typeB = ComponentB.Type[posB]; + const double3 PosB = ComponentB.pos[posB + OffsetB]; + + //printf("thread: %lu, i:%lu, j:%lu, comp: %lu, posi: %lu\n", ij,i,j,comp, posi); + double3 posvec = PosA - PosB; + PBC(posvec, Box.Cell, Box.InverseCell, Box.Cubic); + const double rr_dot = dot(posvec, posvec); + if(rr_dot < FF.CutOffVDW) + { + double result[2] = {0.0, 0.0}; + const double scaling = scaleA * scaleB; + const size_t row = typeA*FF.size+typeB; + const double FFarg[4] = {FF.epsilon[row], FF.sigma[row], FF.z[row], FF.shift[row]}; + VDW(FFarg, rr_dot, scaling, result); + if(result[0] > FF.OverlapCriteria){ flag[0]=true;} + if(rr_dot < 0.01) { flag[0]=true; } //DistanceCheck// + //if(result[0] > FF.OverlapCriteria || rr_dot < 0.01) printf("OVERLAP IN KERNEL!\n"); + tempy.x += result[0]; + } + //Coulombic (REAL)// + if (!FF.noCharges && rr_dot < FF.CutOffCoul) + { + const double r = sqrt(rr_dot); + const double scalingCoul = scalingCoulombA * scalingCoulombB; + double resultCoul[2] = {0.0, 0.0}; + CoulombReal(chargeA, chargeB, r, scalingCoul, resultCoul, Box.Prefactor, Box.Alpha); + tempy.y += resultCoul[0]; //prefactor merged in the CoulombReal function + } +} + + +__device__ void determine_comp_and_Atomindex_from_thread(Atoms* System, size_t& Atom, size_t& comp, size_t startComponent, size_t endComponent) { - for(size_t i = 0; i < NA; i++) - { - size_t OffsetA = 0; - size_t posi = i + Aij; - if(UseOffset) OffsetA = ComponentA.Allocate_size / 2; //Read the positions shifted to the later half of the storage// - //Zhao's note: add protection here// - if(posi >= ComponentA.size) continue; - const double scaleA = ComponentA.scale[posi]; - const double chargeA = ComponentA.charge[posi]; - const double scalingCoulombA = ComponentA.scaleCoul[posi]; - const size_t typeA = ComponentA.Type[posi]; - - const double3 PosA = ComponentA.pos[posi + OffsetA]; - for(size_t j = 0; j < NB; j++) + /* + //size_t count = Atom; + comp = startComponent; + for(size_t ijk = startComponent; ijk < endComponent; ijk++) + { + //totalsize += d_a[ijk].size; + if(Atom >= System[ijk].size) { - size_t OffsetB = 0; - size_t posj = j + Bij; - if(UseOffset) OffsetB = ComponentB.Allocate_size / 2; //Read the positions shifted to the later half of the storage// - //Zhao's note: add protection here// - //if(posj >= ComponentB.size) continue; - const double scaleB = ComponentB.scale[posj]; - const double chargeB = ComponentB.charge[posj]; - const double scalingCoulombB = ComponentB.scaleCoul[posj]; - const size_t typeB = ComponentB.Type[posj]; - //if(j == 6) printf("PAIR CHECK: i: %lu, j: %lu, MoleculeID: %lu, NewMol.MolID: %lu\n", i,j,MoleculeID, NewMol.MolID[0]); - const double3 PosB = ComponentB.pos[posj + OffsetB]; - double3 posvec = PosA - PosB; - //printf("thread: %lu, i:%lu, j:%lu, comp: %lu, posi: %lu\n", ij,i,j,comp, posi); - PBC(posvec, Box.Cell, Box.InverseCell, Box.Cubic); - const double rr_dot = dot(posvec, posvec); - if(rr_dot < FF.CutOffVDW) - { - double result[2] = {0.0, 0.0}; - const double scaling = scaleA * scaleB; - const size_t row = typeA*FF.size+typeB; - //printf("typeA: %lu, typeB: %lu, FF.size: %lu, row: %lu\n", typeA, typeB, FF.size, row); - const double FFarg[4] = {FF.epsilon[row], FF.sigma[row], FF.z[row], FF.shift[row]}; - VDW(FFarg, rr_dot, scaling, result); - if(result[0] > FF.OverlapCriteria){ flag[0]=true; Blockflag = true;} - if(rr_dot < 0.01) { flag[0]=true; Blockflag = true; } //DistanceCheck// - //if(result[0] > FF.OverlapCriteria || rr_dot < 0.01) printf("OVERLAP IN KERNEL!\n"); - tempy += result[0]; - } - //Coulombic (REAL)// - if (!FF.noCharges && rr_dot < FF.CutOffCoul) - { - const double r = sqrt(rr_dot); - const double scalingCoul = scalingCoulombA * scalingCoulombB; - double resultCoul[2] = {0.0, 0.0}; - CoulombReal(chargeA, chargeB, r, scalingCoul, resultCoul, Box.Prefactor, Box.Alpha); - tempy += resultCoul[0]; //prefactor merged in the CoulombReal function - } + Atom -= System[ijk].size; + comp ++; + } + else + { + //Atom = count; + //comp = ijk; + break; } } + */ + size_t count = Atom; + comp = startComponent; + for(size_t ijk = startComponent; ijk < endComponent; ijk++) + { + //totalsize += d_a[ijk].size; + if(count >= System[ijk].size) + { + count -= System[ijk].size; + //comp ++; + } + else + { + Atom = count; + comp = ijk; + break; + } + } + //return {(int) Atom, (int) comp}; } -__global__ void TotalVDWCoul(Boxsize Box, Atoms* System, ForceField FF, double* Blocksum, bool* flag, size_t totalthreads, size_t Host_threads, size_t NAds, size_t NFrameworkAtomsPerThread, bool HostHost, bool UseOffset) +__device__ void determine_comp_and_Molindex_from_thread(Atoms* System, size_t& Mol, size_t& comp, size_t startComponent, size_t endComponent) +{ + for(size_t ijk = startComponent; ijk < endComponent; ijk++) + { + size_t Mol_ijk = System[ijk].size / System[ijk].Molsize; + //totalsize += Mol_ijk; + if(Mol >= Mol_ijk) + { + comp++; + Mol -= Mol_ijk; + } + else + { + break; + } + } +} + +__global__ void TotalVDWCoul(Boxsize Box, Atoms* System, ForceField FF, double* Blocksum, bool* flag, size_t InteractionPerThread, bool UseOffset, int3 BLOCK, int3 NComponents, size_t NFrameworkAtoms, size_t NAdsorbateAtoms, size_t NFrameworkZero_ExtraFramework, bool ConsiderIntra) { extern __shared__ double sdata[]; //shared memory for partial sum// - int cache_id = threadIdx.x; - size_t total_ij = blockIdx.x * blockDim.x + threadIdx.x; + + size_t Nblock = BLOCK.x + BLOCK.y + BLOCK.z; + size_t HH_Nblock = BLOCK.x; + size_t HG_Nblock = BLOCK.y; + //size_t GG_Nblock = BLOCK.z; //currently not used// + + int cache_id = threadIdx.x; + + size_t THREADIdx = blockIdx.x * blockDim.x + threadIdx.x; if(THREADIdx > NFrameworkZero_ExtraFramework) - size_t ij_within_block = total_ij - blockIdx.x * blockDim.x; - sdata[ij_within_block] = 0.0; + sdata[threadIdx.x] = 0.0; + sdata[threadIdx.x + blockDim.x] = 0.0; //Initialize Blocksum// - if(cache_id == 0) Blocksum[blockIdx.x] = 0.0; - __shared__ bool Blockflag = false; + if(cache_id == 0) + {Blocksum[blockIdx.x] = 0.0; Blocksum[blockIdx.x + Nblock] = 0.0; } - if(total_ij < totalthreads) - { - size_t totalsize = 0; - const size_t NumberComp = 2; //Zhao's note: need to change here for multicomponent //Aij and Bij indicate the starting positions for the objects in the pairwise interaction// - size_t Aij = 0; size_t Bij = 0; - size_t MolA = 0; size_t MolB = 0; - size_t compA = 0; size_t compB = 0; - size_t NA = 0; size_t NB = 0; - if(total_ij < Host_threads) //This thread belongs to the Host_threads// + size_t AtomA = 0; size_t AtomB = 0; + size_t MolA = 0; size_t MolB = 0; + size_t compA = 0; size_t compB = 0; + double2 tempy = {0.0, 0.0}; + + size_t HH_Threads = HH_Nblock * blockDim.x; + size_t HG_Threads = HG_Nblock * blockDim.x; + //size_t GG_Threads = GG_Nblock * blockDim.x; //currently not used// + + for(size_t i = 0; i != InteractionPerThread; i++) { - MolA = 0; - Aij = total_ij / NAds * NFrameworkAtomsPerThread; - MolB = total_ij % NAds; - NA = NFrameworkAtomsPerThread; - if(total_ij == Host_threads - 1) - if(Host_threads % NFrameworkAtomsPerThread != 0) - NA = Host_threads % NFrameworkAtomsPerThread; - if(!HostHost) compB = 1; //If we do not consider host-host, start with host-guest - //Here we need to determine the Molecule ID and which component the molecule belongs to// - - for(size_t ijk = compB; ijk < NumberComp; ijk++) + if(blockIdx.x < HH_Nblock) { - size_t Mol_ijk = System[ijk].size / System[ijk].Molsize; - totalsize += Mol_ijk; - if(MolB >= totalsize) + size_t InteractionIdx = THREADIdx * InteractionPerThread + i; + if(ConsiderIntra) //All Framework atom vs. All Framework atom// { - compB++; - MolB -= Mol_ijk; + AtomA = NFrameworkAtoms - 2 - std::floor(std::sqrt(-8*InteractionIdx + 4*NFrameworkAtoms*(NFrameworkAtoms-1)-7)/2.0 - 0.5); + AtomB = InteractionIdx + AtomA + 1 - NFrameworkAtoms*(NFrameworkAtoms-1)/2 + (NFrameworkAtoms-AtomA)*((NFrameworkAtoms-AtomA)-1)/2; + determine_comp_and_Atomindex_from_thread(System, AtomA, compA, 0, NComponents.y); + determine_comp_and_Atomindex_from_thread(System, AtomB, compB, 0, NComponents.y); + } + //If you have more than 1 framework components, then the following two conditions will always be there// + else + { + if(InteractionIdx < NFrameworkZero_ExtraFramework) //Framework comp 0 vs. other framework atoms// + { + AtomA = InteractionIdx % System[0].size; //Framework Component 0 Atom// + AtomB = InteractionIdx / System[0].size; //Framework Component >0 Atom// + determine_comp_and_Atomindex_from_thread(System, AtomA, compA, 0, NComponents.y); + determine_comp_and_Atomindex_from_thread(System, AtomB, compB, 1, NComponents.y); + } + else + { + size_t NExtraFrameworkAtoms = NFrameworkAtoms - System[0].size; + size_t InteractionIdx = THREADIdx * InteractionPerThread + i - NFrameworkZero_ExtraFramework; + AtomA = NExtraFrameworkAtoms - 2 - std::floor(std::sqrt(-8*InteractionIdx + 4*NExtraFrameworkAtoms*(NExtraFrameworkAtoms-1)-7)/2.0 - 0.5); + AtomB = InteractionIdx + AtomA + 1 - NExtraFrameworkAtoms*(NExtraFrameworkAtoms-1)/2 + (NExtraFrameworkAtoms-AtomA)*((NExtraFrameworkAtoms-AtomA)-1)/2; + determine_comp_and_Atomindex_from_thread(System, AtomA, compA, 1, NComponents.y); + determine_comp_and_Atomindex_from_thread(System, AtomB, compB, 1, NComponents.y); + //DEBUG//printf("THERE IS NExtraFrameworkAtoms x NExtraFrameworkAtoms INTERACTIONS, THREADIdx: %lu, blockIdx.x: %lu, threadIdx.x: %lu\n", THREADIdx, blockIdx.x, threadIdx.x); + } } } - NB = System[compB].Molsize; - Bij = MolB * NB; - } - else //Adsorbate-Adsorbate// - { - compA = 1; compB = 1; - size_t Ads_i = total_ij - Host_threads; - //https://stackoverflow.com/questions/27086195/linear-index-upper-triangular-matrix - MolA = NAds - 2 - std::floor(std::sqrt(-8*Ads_i + 4*NAds*(NAds-1)-7)/2.0 - 0.5); - MolB = Ads_i + MolA + 1 - NAds*(NAds-1)/2 + (NAds-MolA)*((NAds- MolA)-1)/2; - totalsize = 0; - //Determine the Molecule IDs and the component of MolA and MolB// - for(size_t ijk = 1; ijk < NumberComp; ijk++) + else if(blockIdx.x < (HG_Nblock + HH_Nblock)) //Host-Guest// { - size_t Mol_ijk = System[ijk].size / System[ijk].Molsize; - totalsize += Mol_ijk; - if(MolA >= totalsize) - { - compA++; - MolA -= Mol_ijk; - } + //This thread belongs to the Host-Guest_threads// + size_t InteractionIdx = (THREADIdx - HH_Threads) * InteractionPerThread + i; + AtomA = InteractionIdx / NAdsorbateAtoms; //Framework Atom// + AtomB = InteractionIdx % NAdsorbateAtoms; //Adsorbate Atom// + + determine_comp_and_Atomindex_from_thread(System, AtomA, compA, 0, NComponents.y); + determine_comp_and_Atomindex_from_thread(System, AtomB, compB, NComponents.y, NComponents.x); } - NA = System[compA].Molsize; - totalsize = 0; - for(size_t ijk = 1; ijk < NumberComp; ijk++) + else //Guest-Guest// { - size_t Mol_ijk = System[ijk].size / System[ijk].Molsize; - totalsize += Mol_ijk; - if(MolB >= totalsize) - { - compB++; - MolB -= Mol_ijk; - } + size_t InteractionIdx = (THREADIdx - HH_Threads - HG_Threads) * InteractionPerThread + i; + AtomA = NAdsorbateAtoms - 2 - std::floor(std::sqrt(-8*InteractionIdx + 4*NAdsorbateAtoms*(NAdsorbateAtoms-1)-7)/2.0 - 0.5); + AtomB = InteractionIdx + AtomA + 1 - NAdsorbateAtoms*(NAdsorbateAtoms-1)/2 + (NAdsorbateAtoms-AtomA)*((NAdsorbateAtoms-AtomA)-1)/2; + + determine_comp_and_Atomindex_from_thread(System, AtomA, compA, NComponents.y, NComponents.x); + determine_comp_and_Atomindex_from_thread(System, AtomB, compB, NComponents.y, NComponents.x); } - NB = System[compB].Molsize; - Aij = MolA * NA; Bij = MolB * NB; + MolA = System[compA].MolID[AtomA]; + MolB = System[compB].MolID[AtomB]; + if(AtomA >= System[compA].size || AtomB >= System[compB].size) continue; + if(!ConsiderIntra && (MolA == MolB) && (compA == compB)) continue; + + const Atoms ComponentA = System[compA]; + const Atoms ComponentB = System[compB]; + VDWCoulEnergy_Total(Box, ComponentA, ComponentB, FF, flag, tempy, AtomA, AtomB, compA, compB, UseOffset); } - //printf("Thread: %lu, compA: %lu, compB: %lu, MolA: %lu, MolB: %lu, Aij: %lu, Bij: %lu, Molsizes: %lu %lu\n", total_ij, compA, compB, MolA, MolB, Aij, Bij, System[0].Molsize, System[1].Molsize); - - sdata[ij_within_block] = 0.0; - //Initialize Blocksum// - if(cache_id == 0) Blocksum[blockIdx.x] = 0.0; - // Manually fusing/collapsing the loop // + + sdata[threadIdx.x] = tempy.x; + sdata[threadIdx.x + blockDim.x] = tempy.y; - const Atoms ComponentA=System[compA]; - const Atoms ComponentB=System[compB]; - double tempy = 0.0; - VDWCoulEnergy_Total(Box, ComponentA, ComponentB, Aij, Bij, FF, flag, Blockflag, tempy, NA, NB, UseOffset); - sdata[ij_within_block] = tempy; - //printf("ThreadID: %lu, HostThread: %lu, compA: %lu, compB: %lu, Aij: %lu, Bij: %lu, NA: %lu, NB: %lu, tempy: %.5f\n", total_ij, Host_threads, compA, compB, Aij, Bij, NA, NB, tempy); - } __syncthreads(); //Partial block sum// - if(!Blockflag) + int reductionsize=blockDim.x / 2; + while(reductionsize != 0) { - int i=blockDim.x / 2; - while(i != 0) + if(cache_id < reductionsize) { - if(cache_id < i) {sdata[cache_id] += sdata[cache_id + i];} - __syncthreads(); - i /= 2; + sdata[cache_id] += sdata[cache_id + reductionsize]; + sdata[cache_id + blockDim.x] += sdata[cache_id + reductionsize + blockDim.x]; } - if(cache_id == 0) {Blocksum[blockIdx.x] = sdata[0];} + __syncthreads(); + reductionsize /= 2; + } + if(cache_id == 0) + { + Blocksum[blockIdx.x] = sdata[0]; + Blocksum[blockIdx.x + Nblock] = sdata[blockDim.x]; } - else - flag[0] = true; + } //Zhao's note: here the totMol does not consider framework atoms, ONLY Adsorbates// -MoveEnergy Total_VDW_Coulomb_Energy(Simulations& Sim, ForceField FF, size_t totMol, size_t Host_threads, size_t Guest_threads, size_t NFrameworkAtomsPerThread, bool ConsiderHostHost, bool UseOffset) +MoveEnergy Total_VDW_Coulomb_Energy(Simulations& Sim, Components& SystemComponents, ForceField FF, bool UseOffset) { + size_t NHostAtom = 0; size_t NGuestAtom = 0; + for(size_t i = 0; i < SystemComponents.NComponents.y; i++) + NHostAtom += SystemComponents.Moleculesize[i] * SystemComponents.NumberOfMolecule_for_Component[i]; + for(size_t i = SystemComponents.NComponents.y; i < SystemComponents.NComponents.x; i++) + NGuestAtom+= SystemComponents.Moleculesize[i] * SystemComponents.NumberOfMolecule_for_Component[i]; + + bool ConsiderIntra = false; + size_t HH_TotalThreads = 0; //if(ConsiderHostHost) HH_TotalThreads = NHostAtom * NHostAtom / 2; + size_t NFrameworkZero_ExtraFramework = 0; + if(ConsiderIntra) //Atom-Atom// + { + HH_TotalThreads = NHostAtom * (NHostAtom - 1) / 2; + } + else //if molecule-intra interactions are not considered, do component 0 x component 1-n_framework + component 1-n_framework x component 1-n_framework// + { + printf("THERE IS MORE THAN 1 FRAMEWORK COMPONENTS\n"); + size_t NFrameworkComponentZeroAtoms = SystemComponents.Moleculesize[0] * SystemComponents.NumberOfMolecule_for_Component[0]; + size_t NExtraFrameworkAtoms = NHostAtom - NFrameworkComponentZeroAtoms; + NFrameworkZero_ExtraFramework = NFrameworkComponentZeroAtoms * NExtraFrameworkAtoms; + HH_TotalThreads = NFrameworkZero_ExtraFramework; //component 0 x component 1-n_framework + + HH_TotalThreads+= NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2; //component 1-n_framework x component 1-n_framework// + printf("Framework Comp Zero Atoms: %zu, Other Comp Atoms: %zu\n", NFrameworkComponentZeroAtoms, NExtraFrameworkAtoms); + printf("NFrameworkZero_ExtraFramework interactions: %zu, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2: %zu\n", NFrameworkZero_ExtraFramework, NExtraFrameworkAtoms * (NExtraFrameworkAtoms - 1) / 2); + } + + size_t HG_TotalThreads = NHostAtom * NGuestAtom; + size_t GG_TotalThreads = NGuestAtom * (NGuestAtom - 1) / 2; //GG_TotalThreads = * NGuestAtom / 2; + size_t InteractionPerThread = 100; + + size_t HHThreadsNeeded = HH_TotalThreads / InteractionPerThread + (HH_TotalThreads % InteractionPerThread == 0 ? 0 : 1); + size_t HGThreadsNeeded = HG_TotalThreads / InteractionPerThread + (HG_TotalThreads % InteractionPerThread == 0 ? 0 : 1); + size_t GGThreadsNeeded = GG_TotalThreads / InteractionPerThread + (GG_TotalThreads % InteractionPerThread == 0 ? 0 : 1); + + size_t HH_Nthread=0; size_t HH_Nblock=0; Setup_threadblock(HHThreadsNeeded, &HH_Nblock, &HH_Nthread); + size_t HG_Nthread=0; size_t HG_Nblock=0; Setup_threadblock(HGThreadsNeeded, &HG_Nblock, &HG_Nthread); + size_t GG_Nthread=0; size_t GG_Nblock=0; Setup_threadblock(GGThreadsNeeded, &GG_Nblock, &GG_Nthread); MoveEnergy E; - if(Host_threads + Guest_threads == 0) return E; + + if((HH_Nblock + HG_Nblock + GG_Nblock) == 0) return E; size_t Nblock = 0; size_t Nthread = 0; - Setup_threadblock(Host_threads + Guest_threads, &Nblock, &Nthread); - if(Nblock > Sim.Nblocks) + //Setup_threadblock(Host_threads + Guest_threads, &Nblock, &Nthread); + Nthread = std::max(GG_Nthread, HG_Nthread); + if(HH_Nthread > Nthread) Nthread = HH_Nthread; + + if(Nblock*2 > Sim.Nblocks) { printf("More blocks for block sum is needed\n"); - cudaMalloc(&Sim.Blocksum, Nblock * sizeof(double)); + cudaMalloc(&Sim.Blocksum, 2*Nblock * sizeof(double)); } + int3 BLOCKS = {HH_Nblock, HG_Nblock, GG_Nblock}; + //Calculate the energy of the new systems// - TotalVDWCoul<<>>(Sim.Box, Sim.d_a, FF, Sim.Blocksum, Sim.device_flag, Host_threads + Guest_threads, Host_threads, totMol, NFrameworkAtomsPerThread, ConsiderHostHost, UseOffset); + //Host-Guest + Guest-Guest// + Nblock = HH_Nblock + HG_Nblock + GG_Nblock; + printf("Atoms: %zu %zu\n", NHostAtom, NGuestAtom); + printf("Interactions: %zu %zu %zu\n", HH_TotalThreads, HG_TotalThreads, GG_TotalThreads); + printf("Nblock %zu, blocks: %zu %zu %zu, threads needed: %zu %zu %zu, Nthread: %zu\n", Nblock, HH_Nblock, HG_Nblock, GG_Nblock, HHThreadsNeeded, HGThreadsNeeded, GGThreadsNeeded, Nthread); + + + TotalVDWCoul<<>>(Sim.Box, Sim.d_a, FF, Sim.Blocksum, Sim.device_flag, InteractionPerThread, UseOffset, BLOCKS, SystemComponents.NComponents, NHostAtom, NGuestAtom, NFrameworkZero_ExtraFramework, ConsiderIntra); + checkCUDAErrorEwald("WRONG TOTAL VDW+REAL ENERGY\n"); + + cudaDeviceSynchronize(); + //printf("Total VDW + Real, Nblock = %zu, Nthread = %zu, Host: %zu, Guest: %zu, Allocated size: %zu\n", Nblock, Nthread, Host_threads, Guest_threads, Sim.Nblocks); //Zhao's note: consider using the flag to check for overlap here// //printf("Total Thread: %zu, Nblock: %zu, Nthread: %zu\n", Host_threads + Guest_threads, Nblock, Nthread); - double BlockE[Nblock]; cudaMemcpy(BlockE, Sim.Blocksum, Nblock * sizeof(double), cudaMemcpyDeviceToHost); - for(size_t id = 0; id < Nblock; id++) E.GGVDW += BlockE[id]; + double BlockE[Nblock*2]; cudaMemcpy(BlockE, Sim.Blocksum, Nblock*2 * sizeof(double), cudaMemcpyDeviceToHost); + + for(size_t id = 0; id < HH_Nblock; id++) E.HHVDW += BlockE[id]; + for(size_t id = HH_Nblock; id < HH_Nblock + HG_Nblock; id++) E.HGVDW += BlockE[id]; + for(size_t id = HH_Nblock + HG_Nblock; id < Nblock; id++) E.GGVDW += BlockE[id]; + + for(size_t id = Nblock; id < Nblock + HH_Nblock; id++) E.HHReal += BlockE[id]; + for(size_t id = Nblock + HH_Nblock; id < Nblock + HH_Nblock + HG_Nblock; id++) E.HGReal += BlockE[id]; + for(size_t id = Nblock + HH_Nblock + HG_Nblock; id < Nblock+Nblock; id++) E.GGReal += BlockE[id]; + + printf("GPU VDW REAL ENERGY:\n"); E.print(); + return E; } diff --git a/src_clean/VDW_Coulomb.cuh b/src_clean/VDW_Coulomb.cuh index 3a78f2c..1c4bb15 100644 --- a/src_clean/VDW_Coulomb.cuh +++ b/src_clean/VDW_Coulomb.cuh @@ -126,11 +126,11 @@ void Check_WaveVector_CPUGPU(Boxsize& Box, Components& SystemComponents); // Total energies // //////////////////// -__global__ void TotalEwald(Atoms* d_a, Boxsize Box, double* BlockSum, Complex* eik_x, Complex* eik_y, Complex* eik_z, Complex* Eik, size_t totAtom, size_t Ncomp, size_t NAtomPerThread, size_t residueAtoms); +//__global__ void TotalEwald(Atoms* d_a, Boxsize Box, double* BlockSum, Complex* eik_x, Complex* eik_y, Complex* eik_z, Complex* Eik, size_t totAtom, size_t Ncomp, size_t NAtomPerThread, size_t residueAtoms); MoveEnergy Ewald_TotalEnergy(Simulations& Sim, Components& SystemComponents, bool UseOffSet); -MoveEnergy Total_VDW_Coulomb_Energy(Simulations& Sim, ForceField FF, size_t totMol, size_t Host_threads, size_t Guest_threads, size_t NFrameworkAtomsPerThread, bool ConsiderHostHost, bool UseOffset); +MoveEnergy Total_VDW_Coulomb_Energy(Simulations& Sim, Components& SystemComponents, ForceField FF, bool UseOffset); ////////////////////// // Tail Corrections // diff --git a/src_clean/axpy.cu b/src_clean/axpy.cu index fe31329..822af92 100644 --- a/src_clean/axpy.cu +++ b/src_clean/axpy.cu @@ -137,6 +137,7 @@ inline void RunMoves(int Cycle, Components& SystemComponents, Simulations& Sims, ////////////////////////////////// //printf(" Widom Insertion\n"); double2 newScale = SystemComponents.Lambda[comp].SET_SCALE(1.0); //Set scale for full molecule (lambda = 1.0)// + /* size_t SelectedTrial=0; bool SuccessConstruction = false; MoveEnergy energy; double StoredR = 0.0; double Rosenbluth=Widom_Move_FirstBead_PARTIAL(SystemComponents, Sims, FF, Random, Widom, SelectedMolInComponent, comp, CBMC_INSERTION, StoredR, &SelectedTrial, &SuccessConstruction, &energy, newScale); if(SystemComponents.Moleculesize[comp] > 1 && Rosenbluth > 1e-150) @@ -145,6 +146,9 @@ inline void RunMoves(int Cycle, Components& SystemComponents, Simulations& Sims, Rosenbluth*=Widom_Move_Chain_PARTIAL(SystemComponents, Sims, FF, Random, Widom, SelectedMolInComponent, comp, CBMC_INSERTION, &SelectedTrial, &SuccessConstruction, &energy, SelectedFirstBeadTrial, newScale); //Zhao's note: need to add widom insertion data back// } + */ + double Rosenbluth = WidomMove(SystemComponents, Sims, FF, Random, Widom, SelectedMolInComponent, comp, newScale); + SystemComponents.Moves[comp].RecordRosen(Rosenbluth, WIDOM); } else if(RANDOMNUMBER < SystemComponents.Moves[comp].ReinsertionProb) { @@ -221,7 +225,7 @@ inline void RunMoves(int Cycle, Components& SystemComponents, Simulations& Sims, } } } - /* + /* //DEBUG// if(Cycle == 4) { printf("Cycle [%d], Printing DeltaE\n", Cycle); @@ -621,8 +625,10 @@ double Run_Simulation_ForOneBox(int Cycles, Components& SystemComponents, Simula if(SimulationMode == EQUILIBRATION) printf("Sampled %zu WangLandau, Adjusted WL %zu times\n", WLSampled, WLAdjusted); PrintAllStatistics(SystemComponents, Sims, Cycles, SimulationMode, BlockAverageSize); if(SimulationMode == PRODUCTION) - Calculate_Overall_Averages_MoveEnergy(SystemComponents, BlockAverageSize); - //Print_Widom_Statistics(SystemComponents, Sims.Box, Constants, 1); + { + Calculate_Overall_Averages_MoveEnergy(SystemComponents, BlockAverageSize); + Print_Widom_Statistics(SystemComponents, Sims.Box, Constants, 1); + } } //At the end of the sim, print a last-step restart and last-step movie GenerateRestartMovies(SystemComponents, Sims, SystemComponents.PseudoAtoms, 0, SimulationMode); diff --git a/src_clean/data_struct.h b/src_clean/data_struct.h index ce323bf..9d98d84 100644 --- a/src_clean/data_struct.h +++ b/src_clean/data_struct.h @@ -14,7 +14,7 @@ #define DEFAULTTHREAD 128 double Get_Uniform_Random(); -enum MoveTypes {TRANSLATION = 0, ROTATION, SINGLE_INSERTION, SINGLE_DELETION, SPECIAL_ROTATION, INSERTION, DELETION, REINSERTION, CBCF_LAMBDACHANGE, CBCF_INSERTION, CBCF_DELETION, IDENTITY_SWAP}; +enum MoveTypes {TRANSLATION = 0, ROTATION, SINGLE_INSERTION, SINGLE_DELETION, SPECIAL_ROTATION, INSERTION, DELETION, REINSERTION, CBCF_LAMBDACHANGE, CBCF_INSERTION, CBCF_DELETION, IDENTITY_SWAP, WIDOM}; enum CBMC_Types {CBMC_INSERTION = 0, CBMC_DELETION, REINSERTION_INSERTION, REINSERTION_RETRACE, IDENTITY_SWAP_NEW, IDENTITY_SWAP_OLD}; @@ -33,7 +33,7 @@ enum INTERACTION_TYPES {HH = 0, HG, GG}; enum RESTART_FILE_TYPES {RASPA_RESTART = 0, LAMMPS_DATA}; //Zhao's note: For the stage of evaluating total energy of the system// -enum ENERGYEVALSTAGE {INITIAL = 0, CREATEMOL, FINAL, CREATEMOL_DELTA, DELTA, CREATEMOL_DELTA_CHECK, DELTA_CHECK, DRIFT, AVERAGE, AVERAGE_ERR}; +enum ENERGYEVALSTAGE {INITIAL = 0, CREATEMOL, FINAL, CREATEMOL_DELTA, DELTA, CREATEMOL_DELTA_CHECK, DELTA_CHECK, DRIFT, GPU_DRIFT, AVERAGE, AVERAGE_ERR}; struct EnergyComplex { @@ -55,6 +55,8 @@ struct Units double LengthUnit = {1e-10}; double energy_to_kelvin = {1.2027242847}; double BoltzmannConstant = {1.38e-23}; + double Avogadro = {6.02214076e23}; // NIST standards [1/mol] + double gas_constant = {8.314462618}; // NIST standards [J/mol/K] }; struct Gibbs @@ -520,7 +522,7 @@ struct Move_Statistics } void RecordRosen(double R, int MoveType) { - if(MoveType != INSERTION && MoveType != DELETION) return; + if(MoveType != INSERTION && MoveType != DELETION && MoveType != WIDOM) return; double R2 = R * R; Rosen[BlockID].Total.x += R; Rosen[BlockID].Total.y += R * R; @@ -537,6 +539,12 @@ struct Move_Statistics Rosen[BlockID].Deletion.y += R * R; Rosen[BlockID].Deletion.z += 1.0; } + else if(MoveType == WIDOM) + { + Rosen[BlockID].WidomInsertion.x += R; + Rosen[BlockID].WidomInsertion.y += R * R; + Rosen[BlockID].WidomInsertion.z += 1.0; + } } void ClearRosen(size_t BlockID) { @@ -867,6 +875,7 @@ struct Components MoveEnergy Initial_Energy; MoveEnergy CreateMol_Energy; MoveEnergy Final_Energy; + MoveEnergy GPU_Energy; //Zhao's note: for average and standard deviations for energies std::vector BookKeepEnergy; std::vector BookKeepEnergy_SQ; diff --git a/src_clean/ewald_preparation.h b/src_clean/ewald_preparation.h index ce44c40..c5ad022 100644 --- a/src_clean/ewald_preparation.h +++ b/src_clean/ewald_preparation.h @@ -175,7 +175,7 @@ void Ewald_Total(Boxsize& Box, Atoms*& Host_System, ForceField& FF, Components& kxcount++; } - printf("Guest-Guest Fourier: %.5f, Host-Host Fourier: %.5f, Framework-Guest Fourier: %.5f\n", E.GGEwaldE, E.HHEwaldE, E.HGEwaldE); + printf("CPU Guest-Guest Fourier: %.5f, Host-Host Fourier: %.5f, Framework-Guest Fourier: %.5f\n", E.GGEwaldE, E.HHEwaldE, E.HGEwaldE); if(Box.ExcludeHostGuestEwald) E.GGEwaldE += E.HHEwaldE; // Subtract self-energy diff --git a/src_clean/fxn_main.h b/src_clean/fxn_main.h index acc87b5..5f4956e 100644 --- a/src_clean/fxn_main.h +++ b/src_clean/fxn_main.h @@ -266,7 +266,7 @@ inline void Allocate_Copy_Ewald_Vector(Boxsize& device_Box, Components SystemCom printf("****** DONE Allocating Ewald WaveVectors (INITIAL STAGE ONLY) ******\n"); } -inline void Check_Simulation_Energy(Boxsize& Box, Atoms* System, ForceField FF, ForceField device_FF, Components& SystemComponents, int SIMULATIONSTAGE, size_t Numsim, Simulations& Sim) +inline void Check_Simulation_Energy(Boxsize& Box, Atoms* System, ForceField FF, ForceField device_FF, Components& SystemComponents, int SIMULATIONSTAGE, size_t Numsim, Simulations& Sim, bool UseGPU) { std::string STAGE; switch(SIMULATIONSTAGE) @@ -280,6 +280,7 @@ inline void Check_Simulation_Energy(Boxsize& Box, Atoms* System, ForceField FF, } printf("======================== CALCULATING %s STAGE ENERGY ========================\n", STAGE.c_str()); MoveEnergy ENERGY; + Atoms device_System[SystemComponents.Total_Components]; cudaMemcpy(device_System, Sim.d_a, SystemComponents.Total_Components * sizeof(Atoms), cudaMemcpyDeviceToHost); cudaMemcpy(Box.Cell, Sim.Box.Cell, 9 * sizeof(double), cudaMemcpyDeviceToHost); @@ -290,77 +291,35 @@ inline void Check_Simulation_Energy(Boxsize& Box, Atoms* System, ForceField FF, Box.Cubic = Sim.Box.Cubic; Box.kmax = Sim.Box.kmax; - MoveEnergy GPU_Energy; - double start = omp_get_wtime(); VDWReal_Total_CPU(Box, System, device_System, FF, SystemComponents, ENERGY); double end = omp_get_wtime(); double CPUSerialTime = end - start; start = omp_get_wtime(); - double* xxx; xxx = (double*) malloc(sizeof(double)*2); - double* device_xxx; device_xxx = CUDA_copy_allocate_array(xxx, 2); - //Zhao's note: if the serial GPU energy test is too slow, comment it out// - //one_thread_GPU_test<<<1,1>>>(Sim.Box, Sim.d_a, device_FF, device_xxx); - cudaMemcpy(xxx, device_xxx, sizeof(double), cudaMemcpyDeviceToHost); - end = omp_get_wtime(); - cudaDeviceSynchronize(); - - double SerialGPUTime = end - start; - //For total energy, divide the parallelization into several parts// - //For framework, every thread treats the interaction between one framework atom with an adsorbate molecule// - //For adsorbate/adsorbate, every thread treats one adsorbate molecule with an adsorbate molecule// - start = omp_get_wtime(); - size_t Host_threads = 0; - size_t Guest_threads = 0; - size_t NFrameworkAtomsPerThread = 4; - size_t NAdsorbate = 0; - for(size_t i = 1; i < SystemComponents.Total_Components; i++) NAdsorbate += SystemComponents.NumberOfMolecule_for_Component[i]; - Host_threads = SystemComponents.Moleculesize[0] / NFrameworkAtomsPerThread; //Per adsorbate molecule// - if(SystemComponents.Moleculesize[0] % NFrameworkAtomsPerThread != 0) Host_threads ++; - Host_threads *= NAdsorbate; //Total = Host_thread_per_molecule * number of Adsorbate molecule - Guest_threads = NAdsorbate * (NAdsorbate-1)/2; - if(Host_threads + Guest_threads > 0) - { - bool ConsiderHostHost = false; - bool UseOffset = false; - GPU_Energy += Total_VDW_Coulomb_Energy(Sim, device_FF, NAdsorbate, Host_threads, Guest_threads, NFrameworkAtomsPerThread, ConsiderHostHost, UseOffset); - } - end = omp_get_wtime(); - //Do Parallel Total Ewald// - double CPUEwaldTime = 0.0; - double GPUEwaldTime = 0.0; if(!device_FF.noCharges) { - cudaDeviceSynchronize(); double EwStart = omp_get_wtime(); CPU_GPU_EwaldTotalEnergy(Box, Sim.Box, System, Sim.d_a, FF, device_FF, SystemComponents, ENERGY); ENERGY.GGEwaldE -= SystemComponents.FrameworkEwald; - double EwEnd = omp_get_wtime(); + printf("Ewald Summation (total energy) on the CPU took %.5f secs\n", EwEnd - EwStart); //Zhao's note: if it is in the initial stage, calculate the intra and self exclusion energy for ewald summation// if(SIMULATIONSTAGE == INITIAL) Calculate_Exclusion_Energy_Rigid(Box, System, FF, SystemComponents); - CPUEwaldTime = EwEnd - EwStart; cudaDeviceSynchronize(); //Zhao's note: if doing initial energy, initialize and copy host Ewald to device// if(SIMULATIONSTAGE == INITIAL) Allocate_Copy_Ewald_Vector(Sim.Box, SystemComponents); Check_WaveVector_CPUGPU(Sim.Box, SystemComponents); //Check WaveVector on the CPU and GPU// cudaDeviceSynchronize(); - EwStart = omp_get_wtime(); - bool UseOffset = false; - GPU_Energy += Ewald_TotalEnergy(Sim, SystemComponents, UseOffset); - GPU_Energy.GGEwaldE -= SystemComponents.FrameworkEwald; - cudaDeviceSynchronize(); - EwEnd = omp_get_wtime(); - GPUEwaldTime = EwEnd - EwStart; } - printf("Ewald Summation (total energy) on the CPU took %.5f secs\n", CPUEwaldTime); - printf("Ewald Summation (total energy) on the GPU took %.5f secs\n", GPUEwaldTime); //Calculate Tail Correction Energy// - ENERGY.TailE = TotalTailCorrection(SystemComponents, FF.size, Sim.Box.Volume); - if(SystemComponents.UseDNNforHostGuest) ENERGY.DNN_E = DNN_Prediction_Total(SystemComponents, Sim); + //This is only on CPU, not GPU// + ENERGY.TailE = TotalTailCorrection(SystemComponents, FF.size, Sim.Box.Volume); + + //This energy uses GPU, but lets copy it as well, no need to compute 2times// + if(SystemComponents.UseDNNforHostGuest) ENERGY.DNN_E = DNN_Prediction_Total(SystemComponents, Sim); if(SystemComponents.UseDNNforHostGuest) double Correction = ENERGY.DNN_Correction(); if(SIMULATIONSTAGE == INITIAL) SystemComponents.Initial_Energy = ENERGY; @@ -372,6 +331,44 @@ inline void Check_Simulation_Energy(Boxsize& Box, Atoms* System, ForceField FF, { SystemComponents.Final_Energy = ENERGY; } + + if(UseGPU) + { + MoveEnergy GPU_Energy; + bool UseOffset = false; + double start = omp_get_wtime(); + GPU_Energy += Total_VDW_Coulomb_Energy(Sim, SystemComponents, device_FF, UseOffset); + cudaDeviceSynchronize(); + double end = omp_get_wtime(); + printf("VDW + Real on the GPU took %.5f secs\n", end - start); + + /* + //SINGLE-THREAD GPU VDW + Real, use just for debugging!!!// + double* xxx; xxx = (double*) malloc(sizeof(double)*2); + double* device_xxx; device_xxx = CUDA_copy_allocate_array(xxx, 2); + //Zhao's note: if the serial GPU energy test is too slow, comment it out// + //one_thread_GPU_test<<<1,1>>>(Sim.Box, Sim.d_a, device_FF, device_xxx); + cudaMemcpy(xxx, device_xxx, sizeof(double), cudaMemcpyDeviceToHost); + end = omp_get_wtime(); + cudaDeviceSynchronize(); + */ + + if(!device_FF.noCharges) + { + start = omp_get_wtime(); + GPU_Energy += Ewald_TotalEnergy(Sim, SystemComponents, UseOffset); + end = omp_get_wtime(); + double GPUEwaldTime = end - start; + printf("Ewald Summation (total energy) on the GPU took %.5f secs\n", GPUEwaldTime); + } + GPU_Energy.TailE = TotalTailCorrection(SystemComponents, FF.size, Sim.Box.Volume); + if(SystemComponents.UseDNNforHostGuest) GPU_Energy.DNN_E = ENERGY.DNN_E; + if(SystemComponents.UseDNNforHostGuest) double GPU_Correction = GPU_Energy.DNN_Correction(); + + printf("Total GPU Energy: \n"); GPU_Energy.print(); + if(SIMULATIONSTAGE == FINAL) SystemComponents.GPU_Energy = GPU_Energy; + } + printf("====================== DONE CALCULATING %s STAGE ENERGY ======================\n", STAGE.c_str()); } @@ -418,8 +415,9 @@ inline void PRINT_ENERGY_AT_STAGE(Components& SystemComponents, int stage, Units case CREATEMOL_DELTA: {stage_name = "RUNNING DELTA_E (CREATE MOLECULE - INITIAL)"; E = SystemComponents.CreateMoldeltaE; break;} case DELTA: {stage_name = "RUNNING DELTA_E (FINAL - CREATE MOLECULE)"; E = SystemComponents.deltaE; break;} case CREATEMOL_DELTA_CHECK: {stage_name = "CHECK DELTA_E (CREATE MOLECULE - INITIAL)"; E = SystemComponents.CreateMol_Energy - SystemComponents.Initial_Energy; break;} - case DELTA_CHECK: {stage_name = "CHECK DELTA_E (FINAL - CREATE MOLECULE)"; E = SystemComponents.Final_Energy - SystemComponents.CreateMol_Energy; break;} - case DRIFT: {stage_name = "ENERGY DRIFT"; E = SystemComponents.CreateMol_Energy + SystemComponents.deltaE - SystemComponents.Final_Energy; break;} + case DELTA_CHECK: {stage_name = "CHECK DELTA_E (RUNNING FINAL - CREATE MOLECULE)"; E = SystemComponents.Final_Energy - SystemComponents.CreateMol_Energy; break;} + case DRIFT: {stage_name = "ENERGY DRIFT (CPU FINAL - RUNNING FINAL)"; E = SystemComponents.CreateMol_Energy + SystemComponents.deltaE - SystemComponents.Final_Energy; break;} + case GPU_DRIFT: {stage_name = "GPU DRIFT (GPU FINAL - CPU FINAL)"; E = SystemComponents.Final_Energy - SystemComponents.GPU_Energy; break;} case AVERAGE: {stage_name = "PRODUCTION PHASE AVERAGE ENERGY"; E = SystemComponents.AverageEnergy;break;} case AVERAGE_ERR: {stage_name = "PRODUCTION PHASE AVERAGE ENERGY ERRORBAR"; E = SystemComponents.AverageEnergy_Errorbar; break;} } @@ -462,6 +460,7 @@ inline void ENERGY_SUMMARY(std::vector& SystemComponents, Units& Con PRINT_ENERGY_AT_STAGE(SystemComponents[i], DELTA, Constants); PRINT_ENERGY_AT_STAGE(SystemComponents[i], DELTA_CHECK, Constants); PRINT_ENERGY_AT_STAGE(SystemComponents[i], DRIFT, Constants); + PRINT_ENERGY_AT_STAGE(SystemComponents[i], GPU_DRIFT, Constants); printf("================================================================================\n"); printf("======================== PRODUCTION PHASE AVERAGE ENERGIES (Simulation %zu) =========================\n", i); PRINT_ENERGY_AT_STAGE(SystemComponents[i], AVERAGE, Constants); diff --git a/src_clean/main.cpp b/src_clean/main.cpp index 9291f38..4e8ba88 100644 --- a/src_clean/main.cpp +++ b/src_clean/main.cpp @@ -266,6 +266,7 @@ int main(void) Prepare_Widom(WidomArray[a], Box[a], Sims[a], SystemComponents[a], SystemComponents[a].HostSystem); Setup_Box_Temperature_Pressure(Constants, SystemComponents[a], Box[a]); + Sims[a].Box.UseLAMMPSEwald = Box[a].UseLAMMPSEwald; Sims[a].Box.Pressure = Box[a].Pressure; Sims[a].Box.Volume = Box[a].Volume; Sims[a].Box.Cubic = Box[a].Cubic; Sims[a].Box.ReciprocalCutOff = Box[a].ReciprocalCutOff; Sims[a].Box.Alpha = Box[a].Alpha; Sims[a].Box.Prefactor = Box[a].Prefactor; @@ -314,13 +315,13 @@ int main(void) /////////////////////////////////////////////////////////////////// // Calculate & Initialize Ewald for the Initial state of the box // /////////////////////////////////////////////////////////////////// - Check_Simulation_Energy(Box[a], SystemComponents[a].HostSystem, FF, device_FF, SystemComponents[a], INITIAL, a, Sims[a]); + Check_Simulation_Energy(Box[a], SystemComponents[a].HostSystem, FF, device_FF, SystemComponents[a], INITIAL, a, Sims[a], true); ////////////////////////////////////////////////////////// // CREATE MOLECULES IN THE BOX BEFORE SIMULAITON STARTS // ////////////////////////////////////////////////////////// Energy[a].running_energy = CreateMolecule_InOneBox(SystemComponents[a], Sims[a], device_FF, Random, Widom, AlreadyHasFractionalMolecule); - Check_Simulation_Energy(Box[a], SystemComponents[a].HostSystem, FF, device_FF, SystemComponents[a], CREATEMOL, a, Sims[a]); + Check_Simulation_Energy(Box[a], SystemComponents[a].HostSystem, FF, device_FF, SystemComponents[a], CREATEMOL, a, Sims[a], true); } //////////////// @@ -392,7 +393,7 @@ int main(void) printf("======================================\n"); printf("CHECKING FINAL ENERGY FOR SYSTEM [%zu]\n", i); printf("======================================\n"); - Check_Simulation_Energy(Box[i], SystemComponents[i].HostSystem, FF, device_FF, SystemComponents[i], FINAL, i, Sims[i]); + Check_Simulation_Energy(Box[i], SystemComponents[i].HostSystem, FF, device_FF, SystemComponents[i], FINAL, i, Sims[i], true); printf("======================================\n"); } ///////////////////////////////////////////////////////// diff --git a/src_clean/mc_box.h b/src_clean/mc_box.h index cebadd4..23a67a9 100644 --- a/src_clean/mc_box.h +++ b/src_clean/mc_box.h @@ -221,11 +221,8 @@ void NVTGibbsMove(std::vector& SystemComponents, Simulations*& Sims, // TOTAL VDW + REAL // ////////////////////// size_t Host_threads = 0; //In this move, there should be NO Framework Atom (Framework (component 0) should be an empty box)// - size_t Guest_threads = totMol * (totMol - 1) / 2; - bool ConsiderHostHost = false; bool UseOffset = true; - size_t NFrameworkAtomsPerThread = 1; - NewE[sim] = Total_VDW_Coulomb_Energy(Sims[sim], FF, totMol, Host_threads, Guest_threads, NFrameworkAtomsPerThread, ConsiderHostHost, UseOffset); + NewE[sim] = Total_VDW_Coulomb_Energy(Sims[sim], SystemComponents[sim], FF, UseOffset); //Check for Overlaps// cudaMemcpy(SystemComponents[sim].flag, Sims[sim].device_flag, sizeof(bool), cudaMemcpyDeviceToHost); if(SystemComponents[sim].flag[0]) diff --git a/src_clean/mc_swap_moves.h b/src_clean/mc_swap_moves.h index 008bc2b..0f0ab2d 100644 --- a/src_clean/mc_swap_moves.h +++ b/src_clean/mc_swap_moves.h @@ -185,6 +185,20 @@ static inline MoveEnergy Reinsertion(Components& SystemComponents, Simulations& } } +//Zhao's note: added feature for creating fractional molecules// +static inline double WidomMove(Components& SystemComponents, Simulations& Sims, ForceField& FF, RandomNumber& Random, WidomStruct& Widom, size_t SelectedMolInComponent, size_t SelectedComponent, double2 newScale) +{ + bool SuccessConstruction = false; + double Rosenbluth = 0.0; + size_t SelectedTrial = 0; + double preFactor = 0.0; + + //Zhao's note: For creating the fractional molecule, there is no previous step, so set the flag to false// + MoveEnergy energy = Insertion_Body(SystemComponents, Sims, FF, Random, Widom, SelectedMolInComponent, SelectedComponent, Rosenbluth, SuccessConstruction, SelectedTrial, preFactor, false, newScale); + return Rosenbluth; +} + + //Zhao's note: added feature for creating fractional molecules// static inline MoveEnergy CreateMolecule(Components& SystemComponents, Simulations& Sims, ForceField& FF, RandomNumber& Random, WidomStruct& Widom, size_t SelectedMolInComponent, size_t SelectedComponent, double2 newScale) { diff --git a/src_clean/mc_widom.h b/src_clean/mc_widom.h index b1abded..73aadaa 100644 --- a/src_clean/mc_widom.h +++ b/src_clean/mc_widom.h @@ -31,7 +31,7 @@ static inline size_t SelectTrialPosition(std::vector LogBoltzmannFactor } template -inline void Host_sum_Widom_HGGG_SEPARATE(size_t NumberWidomTrials, double Beta, T* energy_array, bool* flag, size_t HG_Nblock, size_t HGGG_Nblock, std::vector& energies, std::vector& Trialindex, std::vector& Rosen, size_t Cycle) +inline void Host_sum_Widom_HGGG_SEPARATE(size_t NumberWidomTrials, double Beta, T* energy_array, bool* flag, size_t HG_Nblock, size_t HGGG_Nblock, std::vector& energies, std::vector& Trialindex, std::vector& Rosen, size_t Cycle, bool VDWRealBiasing) { std::vectorreasonable_trials; for(size_t i = 0; i < NumberWidomTrials; i++){ @@ -53,7 +53,8 @@ inline void Host_sum_Widom_HGGG_SEPARATE(size_t NumberWidomTrials, double Beta, for(size_t ijk=HGGG_Nblock; ijk < HG_Nblock + HGGG_Nblock; ijk++) HG_real+=host_array[ijk]; for(size_t ijk=HG_Nblock + HGGG_Nblock; ijk < HGGG_Nblock + HGGG_Nblock; ijk++) GG_real+=host_array[ijk]; - double tot = static_cast(HG_vdw + GG_vdw + HG_real + GG_real); + double tot = static_cast(HG_vdw + GG_vdw); + if(VDWRealBiasing) tot += static_cast(HG_real + GG_real); MoveEnergy E; E.HGVDW = static_cast(HG_vdw); @@ -319,7 +320,7 @@ static inline double Widom_Move_FirstBead_PARTIAL(Components& SystemComponents, //printf("OldNBlock: %zu, HG_Nblock: %zu, GG_Nblock: %zu, HGGG_Nblock: %zu\n", Nblock, HG_Nblock, GG_Nblock, HGGG_Nblock); //printf("FIRST BEAD ENERGIES\n"); - Host_sum_Widom_HGGG_SEPARATE(NumberOfTrials, SystemComponents.Beta, Sims.Blocksum, SystemComponents.flag, HG_Nblock, HGGG_Nblock, energies, Trialindex, Rosen, SystemComponents.CURRENTCYCLE); + Host_sum_Widom_HGGG_SEPARATE(NumberOfTrials, SystemComponents.Beta, Sims.Blocksum, SystemComponents.flag, HG_Nblock, HGGG_Nblock, energies, Trialindex, Rosen, SystemComponents.CURRENTCYCLE, FF.VDWRealBias); double averagedRosen = 0.0; size_t REALselected = 0; @@ -366,6 +367,13 @@ static inline double Widom_Move_FirstBead_PARTIAL(Components& SystemComponents, if(MoveType != IDENTITY_SWAP_OLD && MoveType != IDENTITY_SWAP_NEW) averagedRosen /= double(Widom.NumberWidomTrials); + //Calculate Rosenbluth correction if real-charge is not included when selecting the trials// + if(!FF.VDWRealBias) + { + double Real_Energy = energies[SelectedTrial].HGReal + energies[SelectedTrial].GGReal; + averagedRosen*=std::exp(-SystemComponents.Beta*Real_Energy); + } + *REAL_Selected_Trial = REALselected; *SuccessConstruction = Goodconstruction; *energy = energies[SelectedTrial]; @@ -444,7 +452,7 @@ static inline double Widom_Move_Chain_PARTIAL(Components& SystemComponents, Simu } //printf("CHAIN ENERGIES\n"); - Host_sum_Widom_HGGG_SEPARATE(Widom.NumberWidomTrialsOrientations, SystemComponents.Beta, Sims.Blocksum, SystemComponents.flag, HG_Nblock, HGGG_Nblock, energies, Trialindex, Rosen, SystemComponents.CURRENTCYCLE); + Host_sum_Widom_HGGG_SEPARATE(Widom.NumberWidomTrialsOrientations, SystemComponents.Beta, Sims.Blocksum, SystemComponents.flag, HG_Nblock, HGGG_Nblock, energies, Trialindex, Rosen, SystemComponents.CURRENTCYCLE, FF.VDWRealBias); double averagedRosen= 0.0; size_t REALselected = 0; @@ -475,8 +483,13 @@ static inline double Widom_Move_Chain_PARTIAL(Components& SystemComponents, Simu if(!Goodconstruction) return 0.0; REALselected = Trialindex[SelectedTrial]; - averagedRosen = Rosenbluth/double(Widom.NumberWidomTrialsOrientations); + //Calculate Rosenbluth correction if real-charge is not included when selecting the trials// + if(!FF.VDWRealBias) + { + double Real_Energy = energies[SelectedTrial].HGReal + energies[SelectedTrial].GGReal; + averagedRosen*=std::exp(-SystemComponents.Beta*Real_Energy); + } *REAL_Selected_Trial = REALselected; *SuccessConstruction = Goodconstruction; *energy = energies[SelectedTrial]; diff --git a/src_clean/print_statistics.cuh b/src_clean/print_statistics.cuh index 2b963c8..74e48c7 100644 --- a/src_clean/print_statistics.cuh +++ b/src_clean/print_statistics.cuh @@ -44,10 +44,44 @@ static inline void Print_SpecialRotation_Statistics(Move_Statistics MoveStats, d printf("===========================================================\n"); } -static inline void ComputeFugacity(double& AverageWr, double& AverageMu, double& Fugacity, Boxsize& Box, Components& SystemComponents, double3 Stats, Units Constants) +// Framework density +static inline double FrameworkDensity(Components& SystemComponents, Boxsize& Box, Units Constants) +{ + // Number of components in the framework + int FrameworkComponents = SystemComponents.NComponents.y; + + // Initialize the mass of the unit cell + double CellMass = 0.0; + + // Loop through each framework component + for(size_t j = 0; j < FrameworkComponents; j++) + { + + // Calculate the total number of molecules in all unit cells + size_t NCell = SystemComponents.NumberofUnitCells.x * SystemComponents.NumberofUnitCells.y * SystemComponents.NumberofUnitCells.z; + + // Incrementally sum up the molecular weight for each component + // The molecular weight here for framework components are per unit cell + CellMass += SystemComponents.MolecularWeight[j] * NCell; + //printf("Framework component %zu, molar mass: %.5f\n", j, SystemComponents.MolecularWeight[j]); + } + //printf("Framework total mass: %.5f\n", CellMass); + + // Calculate framework density [kg/m^3] + double rho = CellMass * 1.0e-3 / (Constants.Avogadro * Box.Volume * 1.0e-30); + printf("Framework Density: %.5f [kg/m^3]\n", rho); + + // Return density + return rho; +} + +static inline void ComputeFugacity(double& AverageWr, double& AverageMu, double& AverageHenry, double& Fugacity, Boxsize& Box, Components& SystemComponents, double3 Stats, Units Constants) { AverageWr = Stats.x/Stats.z; AverageMu = Constants.energy_to_kelvin*-(1.0/SystemComponents.Beta)*std::log(AverageWr); + // Adsorption Henry's constant, assuming rigid molecule, WIG = 1.0 + double rho_framework = FrameworkDensity(SystemComponents, Box, Constants); + AverageHenry = AverageWr/(Constants.gas_constant*SystemComponents.Temperature*rho_framework); // units [mol/Pa/kg] double WIG = 1.0; //Assume it is rigid molecule, so 1.0// size_t adsorbate = 1; Fugacity = WIG * Constants.BoltzmannConstant * SystemComponents.Temperature * (double) SystemComponents.NumberOfMolecule_for_Component[adsorbate] / (Box.Volume * 1.0e-30 * AverageWr); @@ -58,6 +92,7 @@ static inline void Print_Widom_Statistics(Components& SystemComponents, Boxsize Move_Statistics MoveStats = SystemComponents.Moves[comp]; double2 totRosen = {0.0, 0.0}; double2 totMu = {0.0, 0.0}; + double2 totHenry = {0.0, 0.0}; double2 totFuga = {0.0, 0.0}; printf("=====================Rosenbluth Summary=====================\n"); printf("There are %zu blocks\n", SystemComponents.Nblock); @@ -67,27 +102,29 @@ static inline void Print_Widom_Statistics(Components& SystemComponents, Boxsize printf("Widom Performed: %.1f\n", MoveStats.Rosen[i].Total.z); if(MoveStats.Rosen[i].Total.z > 0) { - double AverageWr = 0.0; double AverageMu = 0.0; double Fugacity = 0.0; - ComputeFugacity(AverageWr, AverageMu, Fugacity, Box, SystemComponents, MoveStats.Rosen[i].Total, Constants); + double AverageWr = 0.0; double AverageMu = 0.0; double AverageHenry = 0.0; double Fugacity = 0.0; + ComputeFugacity(AverageWr, AverageMu, AverageHenry, Fugacity, Box, SystemComponents, MoveStats.Rosen[i].Total, Constants); printf("(Total) Averaged Rosenbluth Weight: %.10f\n", AverageWr); printf("(Total) Averaged Excess Mu: %.10f\n", AverageMu); + printf("(Total) Averaged Henry Coefficient: %.10f\n", AverageHenry); printf("(Total) Converted to Fugacity: %.10f [Pascal], Temp: %.5f [K]\n", Fugacity, SystemComponents.Temperature); totRosen.x += AverageWr; totRosen.y += AverageWr * AverageWr; totMu.x += AverageMu; totMu.y += AverageMu * AverageMu; + totHenry.x += AverageHenry; totHenry.y += AverageHenry * AverageHenry; totFuga.x += Fugacity; totFuga.y += Fugacity * Fugacity; } if(MoveStats.Rosen[i].Insertion.z > 0) { - double AverageWr = 0.0; double AverageMu = 0.0; double Fugacity = 0.0; - ComputeFugacity(AverageWr, AverageMu, Fugacity, Box, SystemComponents, MoveStats.Rosen[i].Insertion, Constants); + double AverageWr = 0.0; double AverageMu = 0.0; double AverageHenry = 0.0; double Fugacity = 0.0; + ComputeFugacity(AverageWr, AverageMu, AverageHenry, Fugacity, Box, SystemComponents, MoveStats.Rosen[i].Insertion, Constants); printf("(Insertion) Averaged Rosenbluth Weight: %.10f\n", AverageWr); printf("(Insertion) Averaged Excess Mu: %.10f\n", AverageMu); printf("(Insertion) Converted to Fugacity: %.10f [Pascal], Temp: %.5f [K]\n", Fugacity, SystemComponents.Temperature); } if(MoveStats.Rosen[i].Deletion.z > 0) { - double AverageWr = 0.0; double AverageMu = 0.0; double Fugacity = 0.0; - ComputeFugacity(AverageWr, AverageMu, Fugacity, Box, SystemComponents, MoveStats.Rosen[i].Deletion, Constants); + double AverageWr = 0.0; double AverageMu = 0.0; double AverageHenry = 0.0; double Fugacity = 0.0; + ComputeFugacity(AverageWr, AverageMu, AverageHenry, Fugacity, Box, SystemComponents, MoveStats.Rosen[i].Deletion, Constants); printf("(Deletion) Averaged Rosenbluth Weight: %.10f\n", AverageWr); printf("(Deletion) Averaged Excess Mu: %.10f\n", AverageMu); printf("(Deletion) Converted to Fugacity: %.10f [Pascal], Temp: %.5f [K]\n", Fugacity, SystemComponents.Temperature); @@ -104,14 +141,20 @@ static inline void Print_Widom_Statistics(Components& SystemComponents, Boxsize AvgBlockMu.y = totMu.y / (double) SystemComponents.Nblock; double MuError = 2.0 * pow((AvgBlockMu.y - AvgBlockMu.x * AvgBlockMu.x), 0.5); + double2 AvgBlockHenry; + AvgBlockHenry.x = totHenry.x / (double) SystemComponents.Nblock; + AvgBlockHenry.y = totHenry.y / (double) SystemComponents.Nblock; + double HenryError = 2.0 * pow((AvgBlockHenry.y - AvgBlockHenry.x * AvgBlockHenry.x), 0.5); + double2 AvgBlockFuga; AvgBlockFuga.x = totFuga.x / (double) SystemComponents.Nblock; AvgBlockFuga.y = totFuga.y / (double) SystemComponents.Nblock; double FugaError = 2.0 * pow((AvgBlockFuga.y - AvgBlockFuga.x * AvgBlockFuga.x), 0.5); printf("=========================AVERAGE========================\n"); - printf("Averaged Rosenbluth Weight: %.5f +/- %.5f\n", AvgBlockRosen.x, RosenError); - printf("Averaged Excess Chemical Potential: %.5f +/- %.5f\n", AvgBlockMu.x, MuError); - printf("Averaged Fugacity: %.5f +/- %.5f\n", AvgBlockFuga.x, FugaError); + printf("Averaged Rosenbluth Weight: %.10f +/- %.10f\n", AvgBlockRosen.x, RosenError); + printf("Averaged Excess Chemical Potential: %.10f +/- %.10f\n", AvgBlockMu.x, MuError); + printf("Averaged Henry Coefficient [mol/kg/Pa]: %.10g +/- %.10g\n", AvgBlockHenry.x, HenryError); + printf("Averaged Fugacity: %.10f +/- %.10f\n", AvgBlockFuga.x, FugaError); } static inline void Print_Swap_Statistics(Move_Statistics MoveStats)