mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-12-21 11:53:32 +01:00
Added touch query
This commit is contained in:
parent
777c893967
commit
d3f76c4580
@ -38,8 +38,9 @@ options['i'] = [ 'init' , 'Initialize current directory', 0 ]
|
|||||||
options['D'] = [ 'define' , 'Define variable', 1 ]
|
options['D'] = [ 'define' , 'Define variable', 1 ]
|
||||||
options['o'] = [ 'checkopt' , 'Show where optimization may be required', 0 ]
|
options['o'] = [ 'checkopt' , 'Show where optimization may be required', 0 ]
|
||||||
options['p'] = [ 'preprocess' , 'Preprocess file', 1 ]
|
options['p'] = [ 'preprocess' , 'Preprocess file', 1 ]
|
||||||
options['t'] = [ 'openmp' , 'Task Auto-parallelization', 0 ]
|
options['t'] = [ 'touch' , 'Display which entities are touched', 1 ]
|
||||||
options['m'] = [ 'memory' , 'Debug memory info', 0 ]
|
options['m'] = [ 'memory' , 'Debug memory info', 0 ]
|
||||||
|
options['z'] = [ 'openmp' , 'Automatic openMP tasks (may not work)', 0 ]
|
||||||
|
|
||||||
class CommandLine(object):
|
class CommandLine(object):
|
||||||
|
|
||||||
@ -67,6 +68,15 @@ class CommandLine(object):
|
|||||||
return self._preprocessed
|
return self._preprocessed
|
||||||
preprocessed = property(fget=preprocessed)
|
preprocessed = property(fget=preprocessed)
|
||||||
|
|
||||||
|
def touched(self):
|
||||||
|
if '_touched' not in self.__dict__:
|
||||||
|
self._touched = []
|
||||||
|
for o,a in self.opts:
|
||||||
|
if o in [ "-t", options['t'][0] ]:
|
||||||
|
self._touched.append(a)
|
||||||
|
return self._touched
|
||||||
|
touched = property(fget=touched)
|
||||||
|
|
||||||
def usage(self):
|
def usage(self):
|
||||||
t = """
|
t = """
|
||||||
$EXE - $DESCR
|
$EXE - $DESCR
|
||||||
|
@ -47,6 +47,7 @@ def main():
|
|||||||
for line in text:
|
for line in text:
|
||||||
print line.text
|
print line.text
|
||||||
|
|
||||||
|
|
||||||
if not command_line.do_run:
|
if not command_line.do_run:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -69,5 +70,17 @@ def main():
|
|||||||
import create_man
|
import create_man
|
||||||
create_man.run()
|
create_man.run()
|
||||||
|
|
||||||
|
if command_line.do_touch:
|
||||||
|
from variables import variables
|
||||||
|
for var in command_line.touched:
|
||||||
|
if var not in variables:
|
||||||
|
print "%s is not an IRP entity"%(var,)
|
||||||
|
else:
|
||||||
|
print "%s touches the following entities:"%(var,)
|
||||||
|
parents = variables[var].parents
|
||||||
|
parents.sort()
|
||||||
|
for x in parents:
|
||||||
|
print "- %s"%(x,)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user