Commit d488dd39 authored by cmaffeo2's avatar cmaffeo2
Browse files

Ordered GPUs according to PCI_BUS_ID in arbd/namd calls

parent 06fa752c
......@@ -1466,6 +1466,8 @@ if {$nLast == 0} {
## $bindir/charmrun +p$procs $bindir/namd2 +netpoll +idlepoll +devices $gpus $config &> $log
gpus = ','.join([str(gpu) for gpu in gpus])
# cmd = (charmrun, "+p%d" % numprocs, namd, '+netpoll',
env = os.environ.copy()
env["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
cmd = (namd,
"+ppn", numprocs,
'+netpoll','+idlepoll',
......@@ -1476,4 +1478,4 @@ if {$nLast == 0} {
logfile = "%s/%s.log" % (outputDirectory, outputPrefix)
print("Running NAMD with: %s >& %s" % (" ".join(cmd), logfile) )
with open(logfile,'w') as fh:
subprocess.call(cmd, stdout=fh, stderr=subprocess.STDOUT)
subprocess.call(cmd, env=env, stdout=fh, stderr=subprocess.STDOUT)
......@@ -315,6 +315,9 @@ class beadModel():
self.writePsf( outputPrefix + ".psf" )
self.writeArbdFiles( outputPrefix, numSteps=numSteps, timestep=timestep )
env = os.environ.copy()
env["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
## http://stackoverflow.com/questions/18421757/live-output-from-subprocess-command
# cmd = "%s -g %d %s.bd %s/%s" % (arbd, gpu, outputPrefix, outputDirectory, outputPrefix)
# cmd = (arbd, (-g %d %s.bd %s/%s" % (gpu, outputPrefix, outputDirectory, outputPrefix))
......@@ -322,7 +325,7 @@ class beadModel():
cmd = tuple(str(x) for x in cmd)
print("Running ARBD with: %s" % " ".join(cmd))
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True)
process = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE, universal_newlines=True)
for line in process.stdout:
# for line in iter(process.stdout.readline, b''):
sys.stdout.write(line)
......
......@@ -384,6 +384,9 @@ class beadModelTwist():
self.writePsf( outputPrefix + ".psf" )
self.writeArbdFiles( outputPrefix, numSteps=numSteps, timestep=timestep )
env = os.environ.copy()
env["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
## http://stackoverflow.com/questions/18421757/live-output-from-subprocess-command
# cmd = "%s -g %d %s.bd %s/%s" % (arbd, gpu, outputPrefix, outputDirectory, outputPrefix)
# cmd = (arbd, (-g %d %s.bd %s/%s" % (gpu, outputPrefix, outputDirectory, outputPrefix))
......@@ -391,7 +394,7 @@ class beadModelTwist():
cmd = tuple(str(x) for x in cmd)
print("Running ARBD with: %s" % " ".join(cmd))
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True)
process = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE, universal_newlines=True)
for line in process.stdout:
# for line in iter(process.stdout.readline, b''):
sys.stdout.write(line)
......
......@@ -52,6 +52,7 @@ def readAvgArbdCoords(psf,pdb,dcd,rmsdThreshold=3.5):
# r0 = ref.xyz[0,ids,:]
r0 = sel.xyz[-1,ids,:]
t = -1 # in case dcd_frames < 3
for t in range(len(sel.xyz)-2,-1,-1):
# print(t)
R,comA,comB = minimizeRmsd(sel.xyz[t,ids,:],r0)
......
Supports Markdown
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