Commit ca0cda9b authored by cmaffeo2's avatar cmaffeo2
Browse files

Removed os.sync() lines prior to running arbd/oxDNA simulations because they...

Removed os.sync() lines prior to running arbd/oxDNA simulations because they can hang indefinitely; needs testing
parent d00d4bcf
......@@ -815,7 +815,7 @@ class ArbdModel(PdbModel):
self.writePdb( output_name + ".pdb" )
self.writePsf( output_name + ".psf" )
self.writeArbdFiles( output_name, numSteps=num_steps, outputPeriod=output_period, restart_file=restart_file )
os.sync()
# os.sync()
## http://stackoverflow.com/questions/18421757/live-output-from-subprocess-command
......@@ -833,7 +833,10 @@ class ArbdModel(PdbModel):
fd = sys.stdout if log_file is None else log_file
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True)
for line in process.stdout:
fd.write(line)
try:
fd.write(line)
except:
print("WARNING: could not encode line; your locale might not be set correctly")
fd.flush()
else:
with open(log_file,'w') as fd:
......@@ -1339,7 +1342,7 @@ run {num_steps:d}
self.writePdb( output_name + ".fixed.pdb", beta_from_fixed=True )
self.writePsf( output_name + ".psf" )
self.write_namd_configuration( output_name, output_directory = output_directory )
os.sync()
# os.sync()
if not dry_run:
if namd2 is None:
......
import pdb
import subprocess
from pathlib import Path
import numpy as np
import random
......@@ -3803,7 +3804,7 @@ external_forces = 0
last_conf_file = last_conf_file,
log_file="{}/{}.log".format(output_directory,output_name),
**oxdna_args)
os.sync()
# os.sync()
## TODO: call oxdna
cmd = [oxDNA, input_file]
......
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