mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-12-22 04:13:33 +01:00
IRP_ALIGN introduced
This commit is contained in:
parent
017cbcb43f
commit
91ac0ac940
@ -43,7 +43,7 @@ options['g'] = [ 'profile' , 'Generate profile code', 0 ]
|
|||||||
options['t'] = [ 'touch' , 'Display which entities are touched', 1 ]
|
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 ]
|
options['z'] = [ 'openmp' , 'Automatic openMP tasks (may not work)', 0 ]
|
||||||
options['l'] = [ 'align' , 'Align arrays using compiler directives', 1 ]
|
options['l'] = [ 'align' , 'Align arrays using compiler directives. Sets the $IRP_ALIGN variable', 1 ]
|
||||||
options['s'] = [ 'substitute' , 'Substitute values for loop max values', 1 ]
|
options['s'] = [ 'substitute' , 'Substitute values for loop max values', 1 ]
|
||||||
options['r'] = [ 'no_directives', 'Ignore compiler directives !DEC$ and !DIR$', 0 ]
|
options['r'] = [ 'no_directives', 'Ignore compiler directives !DEC$ and !DIR$', 0 ]
|
||||||
options['n'] = [ 'inline' , 'all|providers|builders : Force inlining of providers or builders', 1 ]
|
options['n'] = [ 'inline' , 'all|providers|builders : Force inlining of providers or builders', 1 ]
|
||||||
@ -106,10 +106,10 @@ class CommandLine(object):
|
|||||||
|
|
||||||
def align(self):
|
def align(self):
|
||||||
if '_align' not in self.__dict__:
|
if '_align' not in self.__dict__:
|
||||||
self._align = 0
|
self._align = '1'
|
||||||
for o,a in self.opts:
|
for o,a in self.opts:
|
||||||
if o in [ "-l", '--'+options['l'][0] ]:
|
if o in [ "-l", '--'+options['l'][0] ]:
|
||||||
self._align = int(a)
|
self._align = a
|
||||||
return self._align
|
return self._align
|
||||||
align = property(fget=align)
|
align = property(fget=align)
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ def perform_loop_substitutions():
|
|||||||
result = []
|
result = []
|
||||||
append = result.append
|
append = result.append
|
||||||
for vars,line in text:
|
for vars,line in text:
|
||||||
if type(line) in [ Do, If, Elseif] :
|
if type(line) in [ Do, If, Elseif ] :
|
||||||
for k,v in command_line.substituted.items():
|
for k,v in command_line.substituted.items():
|
||||||
reg = v[1]
|
reg = v[1]
|
||||||
while reg.search(line.text) is not None:
|
while reg.search(line.text) is not None:
|
||||||
|
@ -96,6 +96,7 @@ def get_type (i, filename, line, is_doc):
|
|||||||
assert type(is_doc) == bool
|
assert type(is_doc) == bool
|
||||||
|
|
||||||
line = line.rstrip()
|
line = line.rstrip()
|
||||||
|
line = line.replace("$IRP_ALIGN",command_line.align)
|
||||||
lower_line0 = line.lstrip().lower()
|
lower_line0 = line.lstrip().lower()
|
||||||
lower_line = lower_line0.replace("!"," ! ")
|
lower_line = lower_line0.replace("!"," ! ")
|
||||||
|
|
||||||
@ -106,6 +107,7 @@ def get_type (i, filename, line, is_doc):
|
|||||||
lower_line = re_endmodule.sub("endmodule",lower_line)
|
lower_line = re_endmodule.sub("endmodule",lower_line)
|
||||||
lower_line = re_endif.sub("endif",lower_line)
|
lower_line = re_endif.sub("endif",lower_line)
|
||||||
lower_line = re_endselect.sub("endselect",lower_line)
|
lower_line = re_endselect.sub("endselect",lower_line)
|
||||||
|
|
||||||
for c in """()'"[]""":
|
for c in """()'"[]""":
|
||||||
lower_line = lower_line.replace(c," "+c+" ")
|
lower_line = lower_line.replace(c," "+c+" ")
|
||||||
|
|
||||||
|
@ -233,8 +233,8 @@ class Variable(object):
|
|||||||
if '_header' not in self.__dict__:
|
if '_header' not in self.__dict__:
|
||||||
name = self.name
|
name = self.name
|
||||||
self._header = [ " %s :: %s %s"%(self.type, name, build_dim_colons(self) ) ]
|
self._header = [ " %s :: %s %s"%(self.type, name, build_dim_colons(self) ) ]
|
||||||
if self.dim != [] and command_line.align > 0:
|
if self.dim != [] and command_line.align != '1':
|
||||||
self._header += [" !DIR$ ATTRIBUTES ALIGN: %d :: %s"%(command_line.align,name)]
|
self._header += [" !DIR$ ATTRIBUTES ALIGN: %s :: %s"%(command_line.align,name)]
|
||||||
if self.is_main:
|
if self.is_main:
|
||||||
self._header += [ " logical :: %s_is_built = .False."%(name) ]
|
self._header += [ " logical :: %s_is_built = .False."%(name) ]
|
||||||
return self._header
|
return self._header
|
||||||
|
Loading…
Reference in New Issue
Block a user