diff --git a/src/command_line.py b/src/command_line.py index f3c50b2..5922840 100644 --- a/src/command_line.py +++ b/src/command_line.py @@ -38,8 +38,9 @@ options['i'] = [ 'init' , 'Initialize current directory', 0 ] options['D'] = [ 'define' , 'Define variable', 1 ] options['o'] = [ 'checkopt' , 'Show where optimization may be required', 0 ] 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['z'] = [ 'openmp' , 'Automatic openMP tasks (may not work)', 0 ] class CommandLine(object): @@ -67,6 +68,15 @@ class CommandLine(object): return self._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): t = """ $EXE - $DESCR diff --git a/src/irpf90.py b/src/irpf90.py index fba054a..96db9b7 100644 --- a/src/irpf90.py +++ b/src/irpf90.py @@ -47,6 +47,7 @@ def main(): for line in text: print line.text + if not command_line.do_run: return @@ -69,5 +70,17 @@ def main(): import create_man 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__': main()