Skip to content

Commit

Permalink
Updated gotocand.py for current nimrod
Browse files Browse the repository at this point in the history
  • Loading branch information
scottransom committed May 22, 2019
1 parent 321e1c0 commit 1d93ea8
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions bin/gotocand.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def find_node(DM):
nodefiles = glob.glob("node*")
for nodefile in nodefiles:
for line in open(nodefile):
if line[:4]=="node":
if line[:4]=="nimr":
if DM in line.split():
return line.split()[0]
return None
Expand All @@ -68,7 +68,7 @@ def find_local_datfile(basename, DM):
return datfile

def find_datfile(nodename, basename, DM):
i,o = os.popen4("rsh %s find /scratch1 -name \*%s\*DM%s\*dat"%\
i,o = os.popen4("ssh %s find -L /scratch -name \*%s\*DM%s\*dat"%\
(nodename, basename, DM))
datfile = ''
for line in o:
Expand All @@ -78,25 +78,13 @@ def find_datfile(nodename, basename, DM):
if line.endswith(".dat"):
datfile = line
print "'%s'"%datfile
if datfile!='' and datfile.startswith("/scratch1"):
return datfile
i,o = os.popen4("rsh %s find /scratch2 -name \*%s\*DM%s\*dat"%\
(nodename, basename, DM))
datfile = ''
for line in o:
line = line.strip()
if line.startswith("find:"):
line = line.join(line.split()[1:])
if line.endswith(".dat"):
datfile = line
print "'%s'"%datfile
if datfile!='' and datfile.startswith("/scratch2"):
if datfile!='' and datfile.startswith("/scratch"):
return datfile
return None

def get_datfile_len(nodename, datfile):
if nodename:
i,o = os.popen4("rsh %s ls -l %s | awk '{ print $5 };'"%(nodename, datfile))
i,o = os.popen4("ssh %s ls -l %s | awk '{ print $5 };'"%(nodename, datfile))
else:
i,o = os.popen4("ls -l %s | awk '{ print $5 };'"%(datfile))
filelen = o.readline()
Expand Down

0 comments on commit 1d93ea8

Please sign in to comment.