Skip to content

Commit

Permalink
Merge pull request #31 from bc118/checkpoint_change
Browse files Browse the repository at this point in the history
The checkpoint commands call was changed in GOMC, and the changes required were added in this PR.
  • Loading branch information
bc118 authored Mar 20, 2022
2 parents 020be8e + 71df3f4 commit 17a4198
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 110 deletions.
2 changes: 2 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ This Python code is currently compatible only with `NAMD version 2.14 <https://w

**NOTE: A bug exists when running the NAMD simulations in GPU mode with the hybrid GEMC ensemble. It is currently unclear if this is an issue with NAMD, CUDA, or a precision error since the NAMD simulations run perfectly in CPU mode. A temporary workaround when using the hybrid GEMC ensemble is to run GOMC in GPU mode and NAMD in CPU mode.**

**NOTE: ONLY run NAMD in the NVT ensemble, as running NAMD in the NPT ensemble will cause errors in the box positioning since NAMD and GOMC have different box centering algorithms when centering the box during box size changes.**

**NOTE:** GOMC does not currently use improper or Urey—Bradley potentials, so if the hybrid simulations contain impropers or Urey—Bradleys, the NAMD simulation energies will be different. In a protein simulation, it should be OK not to use impropers or Urey-Bradleys in GOMC and utilize them in NAMD since the protein will not move in the GOMC simulation due to its size. Each simulation will need to be individually evaluated to determine if not having the impropers or Urey-Bradleys in GOMC is irrelevant or significant to the simulation results.**
3 changes: 2 additions & 1 deletion docs/running_the_simulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Running the Simulation

The hybrid NAMD/GOMC simulation can be conducted once the *"user_input_NAMD_GOMC.json"* file is properly filled out to the user's specifications, including generating or obtaining the proper PSF, PDB, and force field (.inp or .par files) and specifying their proper paths.

**WARNING:** Any hybrid simulation that encounters a NAMD simulation with zero atoms or non-fixed atoms will fail. This failure will likely appear as a seg-fault in GOMC. Currently, these types of simulations are not possible with this software.

Example # 1: GEMC Ensemble
---------------
Expand Down Expand Up @@ -43,4 +44,4 @@ The flags for running the *run_NAMD_GOMC.py* file user_input_variables_NAMD_GOMC

-namd_sims_order *or* --namd_simulation_order : default='series', (options: 'series' or 'parallel')
This sets the NAMD simulation to be run in series or parallel. The data is entered only as series or parallel (default = series). This is only relevant for the GEMC ensemble when utilizing two (2) NAMD simulation boxes (i.e., only_use_box_0_for_namd_for_gemc = False --> both box 0 and box 1). The GCMC, NVT, NPT, or the GEMC ensembles when using only one (1) NAMD simulation box (i.e., only_use_box_0_for_namd_for_gemc = True --> only box 0) are always run in series, since there is nothing to run in parallel. Note: This feature was added so the user can minimize the load on the GPU by running both NAMD simulations in parallel.


13 changes: 12 additions & 1 deletion docs/simulation_parameters_files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,19 @@ The MD/MC Hybrid input file is in the `json <https://developer.mozilla.org/en-US
chemical potential (ChemPot) or fugacity (Fugacity).
GCMC_ChemPot_or_Fugacity_dict = {str (Residue name): int or float
(ChemPots in unit GOMC K units or Fugacity in unit bar)}
NOTE: For a protein, the general residue name of 'PROTA' should be used, which accounts for the whole protein.
NOTE: For a residue that should not be removed, the residue should have the beta value in the PDB file set to 2,
and have the ChemPot set to be -99999999999999999999999999999999999999.
Example Chempot: GCMC_ChemPot_or_Fugacity_dict = {'TIP3': 1000, 'Cl' : -1000, 'Na' : -900}
Example Fugacity (values >=0): GCMC_ChemPot_or_Fugacity_dict = {'TIP3': 1000, 'Cl' : 10, 'Na' : 0}
Example Chempot with a protein: GCMC_ChemPot_or_Fugacity_dict =
{
"TIP3": -4166,
"PROTA":-99999999999999999999999999999999999999,
"POPC":-99999999999999999999999999999999999999,
"POT":-99999999999999999999999999999999999999,
"CLA":-99999999999999999999999999999999999999
}

namd_minimize_mult_scalar : int (>=0)
The scalar multiple used to get the number of NAMD minimization steps for this
Expand Down Expand Up @@ -248,4 +259,4 @@ The MD/MC Hybrid input file is in the `json <https://developer.mozilla.org/en-US
NOTE: THIS WAS ONLY TESTED ON THE GOMC DEVELOPMENT AFTER VERSION 2.70,
SO IT MAY NOT WORK ON OTHER GOMC VERSIONS WITHOUT SOME CODE MODIFICATION,
AND SOME ADDITIONAL FUNCTIONALLITY IS NOT IN PREVIOUS GOMC VERSIONS.
Example: "required_data/bin"
Example: "required_data/bin"
21 changes: 11 additions & 10 deletions required_data/config_files/GOMC_GCMC.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#########################
Restart restart_true_or_false

RestartCheckpoint Restart_Checkpoint_file
Checkpoint Restart_Checkpoint_file
####################################
# kind {RESTART, RANDOM, INTSEED} (DO NOT MODIFY or the hybrid simulation and combine files may not work)
####################################
Expand Down Expand Up @@ -86,9 +86,10 @@ PressureCalc true GOMC_console_BLKavg_Hist_Steps
################################
# STEPS (DO NOT MODIFY or the hybrid simulation and combine files may not work)
################################
RunSteps GOMC_Run_Steps
EqSteps GOMC_Equilb_Steps
AdjSteps GOMC_Adj_Steps
InitStep 0
RunSteps GOMC_Run_Steps
EqSteps GOMC_Equilb_Steps
AdjSteps GOMC_Adj_Steps



Expand Down Expand Up @@ -149,11 +150,11 @@ DCDFreq true GOMC_RST_Coor_CKpoint_Steps
################################
# OutHistSettings (DO NOT MODIFY or the hybrid simulation and combine files may not work)
################################
DistName dis
HistName his
RunNumber 1
RunLetter a
SampleFreq GOMC_Hist_sample_Steps
DistName dis
HistName his
RunNumber 1
RunLetter a
SampleFreq GOMC_Hist_sample_Steps

##################################
# enable: blk avg., fluct. (DO NOT MODIFY or the hybrid simulation and combine files may not work)
Expand All @@ -163,5 +164,5 @@ OutPressure true true
OutMolNum true true
OutDensity true true
OutVolume true true
OutSurfaceTention false false
OutSurfaceTension false false

59 changes: 30 additions & 29 deletions required_data/config_files/GOMC_GEMC.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#########################
Restart restart_true_or_false

RestartCheckpoint Restart_Checkpoint_file
Checkpoint Restart_Checkpoint_file
####################################
# kind {RESTART, RANDOM, INTSEED} (DO NOT MODIFY or the hybrid simulation and combine files may not work)
####################################
Expand All @@ -26,26 +26,26 @@ all_parameter_files
####################################
# INPUT PDB FILES (DO NOT MODIFY or the hybrid simulation and combine files may not work)
####################################
Coordinates 0 pdb_file_box_0_file
Coordinates 0 pdb_file_box_0_file
Coordinates 1 pdb_file_box_1_file

####################################
# INPUT PSF FILES (DO NOT MODIFY or the hybrid simulation and combine files may not work)
####################################
Structure 0 psf_file_box_0_file
Structure 1 psf_file_box_1_file
Structure 0 psf_file_box_0_file
Structure 1 psf_file_box_1_file

####################################
# INPUT BINARY coodinatd, XSC, velocity files (DO NOT MODIFY or the hybrid simulation and combine files may not work)
####################################

binCoordinates 0 coor_box_0_file
binCoordinates 0 coor_box_0_file
extendedSystem 0 xsc_box_0_file
binVelocities 0 vel_box_0_file
binVelocities 0 vel_box_0_file

binCoordinates 1 coor_box_1_file
binCoordinates 1 coor_box_1_file
extendedSystem 1 xsc_box_1_file
binVelocities 1 vel_box_1_file
binVelocities 1 vel_box_1_file



Expand All @@ -61,20 +61,20 @@ Temperature System_temp_set
#############################
# SIMULATION CONDITION
#############################
Potential SWITCH
Potential SWITCH
Rswitch 10.0
LRC false
Rcut 12
RcutLow 1.0
Exclude 1-3
Exclude 1-3
1-4scaling 1.0


#############################
# ELECTROSTATIC
#############################
Ewald true
ElectroStatic true
ElectroStatic true
CachedFourier false
Tolerance 0.00001

Expand All @@ -87,9 +87,10 @@ PressureCalc true GOMC_console_BLKavg_Hist_Steps
################################
# STEPS (DO NOT MODIFY or the hybrid simulation and combine files may not work)
################################
RunSteps GOMC_Run_Steps
EqSteps GOMC_Equilb_Steps
AdjSteps GOMC_Adj_Steps
InitStep 0
RunSteps GOMC_Run_Steps
EqSteps GOMC_Equilb_Steps
AdjSteps GOMC_Adj_Steps



Expand All @@ -98,11 +99,11 @@ AdjSteps GOMC_Adj_Steps
################################

VolFreq 0.01
SwapFreq 0.99
DisFreq 0.00
RotFreq 0.00
RegrowthFreq 0.00
IntraSwapFreq 0.00
SwapFreq 0.99
DisFreq 0.00
RotFreq 0.00
RegrowthFreq 0.00
IntraSwapFreq 0.00


################################
Expand Down Expand Up @@ -143,26 +144,26 @@ RestartFreq true GOMC_RST_Coor_CKpoint_Steps
CheckpointFreq true GOMC_RST_Coor_CKpoint_Steps
CoordinatesFreq false GOMC_RST_Coor_CKpoint_Steps
ConsoleFreq true GOMC_console_BLKavg_Hist_Steps
BlockAverageFreq true GOMC_console_BLKavg_Hist_Steps
BlockAverageFreq true GOMC_console_BLKavg_Hist_Steps
HistogramFreq true GOMC_console_BLKavg_Hist_Steps

DCDFreq true GOMC_RST_Coor_CKpoint_Steps

################################
# OutHistSettings (DO NOT MODIFY or the hybrid simulation and combine files may not work)
################################
DistName dis
HistName his
DistName dis
HistName his
RunNumber 1
RunLetter a
SampleFreq GOMC_Hist_sample_Steps

##################################
# enable: blk avg., fluct. (DO NOT MODIFY or the hybrid simulation and combine files may not work)
##################################
OutEnergy true true
OutPressure true true
OutMolNum true true
OutDensity true true
OutVolume true true
OutSurfaceTention false false
OutEnergy true true
OutPressure true true
OutMolNum true true
OutDensity true true
OutVolume true true
OutSurfaceTension false false

51 changes: 26 additions & 25 deletions required_data/config_files/GOMC_NPT.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#########################
Restart restart_true_or_false

RestartCheckpoint Restart_Checkpoint_file
Checkpoint Restart_Checkpoint_file
####################################
# kind {RESTART, RANDOM, INTSEED} (DO NOT MODIFY or the hybrid simulation and combine files may not work)
####################################
Expand All @@ -26,7 +26,7 @@ all_parameter_files
####################################
# INPUT PDB FILES (DO NOT MODIFY or the hybrid simulation and combine files may not work)
####################################
Coordinates 0 pdb_file_box_0_file
Coordinates 0 pdb_file_box_0_file

####################################
# INPUT PSF FILES (DO NOT MODIFY or the hybrid simulation and combine files may not work)
Expand All @@ -37,9 +37,9 @@ Structure 0 psf_file_box_0_file
# INPUT BINARY coodinatd, XSC, velocity files (DO NOT MODIFY or the hybrid simulation and combine files may not work)
####################################

binCoordinates 0 coor_box_0_file
binCoordinates 0 coor_box_0_file
extendedSystem 0 xsc_box_0_file
binVelocities 0 vel_box_0_file
binVelocities 0 vel_box_0_file



Expand All @@ -50,26 +50,26 @@ binVelocities 0 vel_box_0_file
##################################
# Pressure and Temp (DO NOT MODIFY or the hybrid simulation and combine files may not work)
##################################
Pressure System_press_set
Pressure System_press_set
Temperature System_temp_set

#############################
# SIMULATION CONDITION
#############################
Potential SWITCH
Potential SWITCH
Rswitch 10.0
LRC false
Rcut 12
RcutLow 1.0
Exclude 1-3
Exclude 1-3
1-4scaling 1.0


#############################
# ELECTROSTATIC
#############################
Ewald true
ElectroStatic true
ElectroStatic true
CachedFourier false
Tolerance 0.00001

Expand All @@ -82,9 +82,10 @@ PressureCalc true GOMC_console_BLKavg_Hist_Steps
################################
# STEPS (DO NOT MODIFY or the hybrid simulation and combine files may not work)
################################
RunSteps GOMC_Run_Steps
EqSteps GOMC_Equilb_Steps
AdjSteps GOMC_Adj_Steps
InitStep 0
RunSteps GOMC_Run_Steps
EqSteps GOMC_Equilb_Steps
AdjSteps GOMC_Adj_Steps



Expand All @@ -93,10 +94,10 @@ AdjSteps GOMC_Adj_Steps
################################

VolFreq 0.01
IntraSwapFreq 0.99
DisFreq 0.00
RotFreq 0.00
RegrowthFreq 0.00
IntraSwapFreq 0.99
DisFreq 0.00
RotFreq 0.00
RegrowthFreq 0.00



Expand Down Expand Up @@ -135,27 +136,27 @@ RestartFreq true GOMC_RST_Coor_CKpoint_Steps
CheckpointFreq true GOMC_RST_Coor_CKpoint_Steps
CoordinatesFreq false GOMC_RST_Coor_CKpoint_Steps
ConsoleFreq true GOMC_console_BLKavg_Hist_Steps
BlockAverageFreq true GOMC_console_BLKavg_Hist_Steps
BlockAverageFreq true GOMC_console_BLKavg_Hist_Steps
HistogramFreq true GOMC_console_BLKavg_Hist_Steps

DCDFreq true GOMC_RST_Coor_CKpoint_Steps

################################
# OutHistSettings (DO NOT MODIFY or the hybrid simulation and combine files may not work)
################################
DistName dis
HistName his
DistName dis
HistName his
RunNumber 1
RunLetter a
SampleFreq GOMC_Hist_sample_Steps

##################################
# enable: blk avg., fluct. (DO NOT MODIFY or the hybrid simulation and combine files may not work)
##################################
OutEnergy true true
OutPressure true true
OutMolNum true true
OutDensity true true
OutVolume true true
OutSurfaceTention false false
OutEnergy true true
OutPressure true true
OutMolNum true true
OutDensity true true
OutVolume true true
OutSurfaceTension false false


Loading

0 comments on commit 17a4198

Please sign in to comment.