Commit c873cb1c authored by cmaffeo2's avatar cmaffeo2
Browse files

Added box_type=orthogonal and CUDA_DEVICE={gpu} to oxDNA input file; thanks to...

Added box_type=orthogonal and CUDA_DEVICE={gpu} to oxDNA input file; thanks to Elija Feigl for bringing the issue to our attention
parent 7cb74455
...@@ -3755,7 +3755,7 @@ proc calcforces {} { ...@@ -3755,7 +3755,7 @@ proc calcforces {} {
for s in self.strands: for s in self.strands:
s.generate_oxdna_model() s.generate_oxdna_model()
def _write_oxdna_configuration(self, filename): def _write_oxdna_configuration(self, filename, gpu=0):
_angstroms_to_oxdna = 0.11739845 ## units "AA" "8.518e-10 m" _angstroms_to_oxdna = 0.11739845 ## units "AA" "8.518e-10 m"
with open(filename,'w') as fh: with open(filename,'w') as fh:
...@@ -3838,7 +3838,8 @@ E = 0 0 0 ...@@ -3838,7 +3838,8 @@ E = 0 0 0
verlet_skin = 0.5, verlet_skin = 0.5,
max_backbone_force = 100, max_backbone_force = 100,
external_forces_file = None, external_forces_file = None,
seq_dep_file = None seq_dep_file = None,
gpu = 0
): ):
if seed is None: if seed is None:
...@@ -3911,6 +3912,7 @@ interaction_type = {interaction_type} ...@@ -3911,6 +3912,7 @@ interaction_type = {interaction_type}
{salt_concentration} {salt_concentration}
sim_type = {sim_type} sim_type = {sim_type}
backend = {backend} backend = {backend}
CUDA_device = {gpu}
backend_precision = {backend_precision} backend_precision = {backend_precision}
#debug = 1 #debug = 1
seed = {seed} seed = {seed}
...@@ -3939,6 +3941,7 @@ verlet_skin = {verlet_skin} ...@@ -3939,6 +3941,7 @@ verlet_skin = {verlet_skin}
############################## ##############################
#### INPUT / OUTPUT #### #### INPUT / OUTPUT ####
############################## ##############################
box_type = orthogonal
topology = {topology} topology = {topology}
conf_file = {conf_file} conf_file = {conf_file}
lastconf_file = {last_conf_file} lastconf_file = {last_conf_file}
...@@ -3953,7 +3956,7 @@ print_energy_every = {print_energy_every} ...@@ -3953,7 +3956,7 @@ print_energy_every = {print_energy_every}
time_scale = linear time_scale = linear
""".format( **locals() )) """.format( **locals() ))
def simulate_oxdna(self, output_name, directory='.', output_directory='output', topology=None, configuration=None, oxDNA=None, **oxdna_args): def simulate_oxdna(self, output_name, directory='.', output_directory='output', topology=None, configuration=None, oxDNA=None, gpu=0, **oxdna_args):
if output_directory == '': output_directory='.' if output_directory == '': output_directory='.'
d_orig = os.getcwd() d_orig = os.getcwd()
......
...@@ -29,6 +29,7 @@ def minimize_and_simulate_oxdna( model, ...@@ -29,6 +29,7 @@ def minimize_and_simulate_oxdna( model,
num_min_steps = 5e2, num_min_steps = 5e2,
num_steps = 1e7, num_steps = 1e7,
output_period = None, output_period = None,
gpu = 0,
**oxdna_args **oxdna_args
): ):
...@@ -52,6 +53,7 @@ def minimize_and_simulate_oxdna( model, ...@@ -52,6 +53,7 @@ def minimize_and_simulate_oxdna( model,
num_steps = num_min_steps, num_steps = num_min_steps,
print_conf_interval = 100, print_conf_interval = 100,
print_energy_every = 10, print_energy_every = 10,
gpu = gpu,
**min_args) **min_args)
top,conf = model.simulate_oxdna(output_name = "{}-oxdna".format(output_name), top,conf = model.simulate_oxdna(output_name = "{}-oxdna".format(output_name),
...@@ -60,6 +62,7 @@ def minimize_and_simulate_oxdna( model, ...@@ -60,6 +62,7 @@ def minimize_and_simulate_oxdna( model,
num_steps = num_steps, num_steps = num_steps,
print_conf_interval = output_period, print_conf_interval = output_period,
print_energy_every = output_period, print_energy_every = output_period,
gpu = gpu,
**oxdna_args) **oxdna_args)
finally: finally:
os.chdir(d_orig) os.chdir(d_orig)
...@@ -184,7 +187,8 @@ def multiresolution_simulation( model, output_name, ...@@ -184,7 +187,8 @@ def multiresolution_simulation( model, output_name,
output_name = output_name, output_name = output_name,
num_min_steps = 1e3, num_min_steps = 1e3,
num_steps = oxdna_steps, num_steps = oxdna_steps,
output_period = oxdna_output_period ) output_period = oxdna_output_period,
gpu = gpu)
else: else:
""" Atomic simulation """ """ Atomic simulation """
model.generate_atomic_model(scale=backbone_scale) model.generate_atomic_model(scale=backbone_scale)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment