diff --git a/mrdna/arbdmodel/__init__.py b/mrdna/arbdmodel/__init__.py index b5d894beb4364d551ffdc536790cb548496a657c..63d03973478890c63bd7e1c84400326a16edd439 100644 --- a/mrdna/arbdmodel/__init__.py +++ b/mrdna/arbdmodel/__init__.py @@ -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: diff --git a/mrdna/segmentmodel.py b/mrdna/segmentmodel.py index 54a0b82d19ceb026abe1bb807cf903ce6156798f..7a563620a36850063107479f86ff9e4d4bb2979a 100644 --- a/mrdna/segmentmodel.py +++ b/mrdna/segmentmodel.py @@ -1,4 +1,5 @@ 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]