10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-12-21 11:53:32 +01:00

Parallelized parsed_text

Version:1.1.50
This commit is contained in:
Anthony Scemama 2010-10-02 20:53:22 +02:00
parent 86f281f5ab
commit 999093aedb
5 changed files with 117 additions and 93 deletions

View File

@ -96,14 +96,20 @@ def do_print(var):
######################################################################
def run():
import parsed_text
file = open("irpf90_entities","w")
import os,sys
l = variables.keys()
if os.fork() == 0:
for v in l:
do_print(variables[v])
sys.exit(0)
if os.fork() == 0:
file = open("irpf90_entities","w")
l.sort()
for v in l:
do_print_short(file,variables[v])
file.close()
for v in l:
do_print(variables[v])
sys.exit(0)
######################################################################
if __name__ == '__main__':

View File

@ -63,6 +63,7 @@ def main():
if not command_line.do_run:
return
init()
import irp_stack

View File

@ -25,6 +25,7 @@
# scemama@irsamc.ups-tlse.fr
import os,sys
import irpf90_t
irpdir = irpf90_t.irpdir
mandir = irpf90_t.mandir
@ -60,6 +61,7 @@ irpf90.make: $(wildcard *.irp.f)
######################################################################
def run():
from modules import modules
if os.fork() == 0:
mod = []
for m in modules.keys():
mod.append(modules[m])
@ -149,4 +151,5 @@ def run():
print >>file, "\t- rm -rf "+irpdir+" "+mandir+" irpf90.make irpf90_variables dist\n"
file.close()
sys.exit(0)

View File

@ -87,9 +87,8 @@ def check_touch(line,vars,main_vars):
error.fail(line,message)
def get_parsed_text():
main_result = []
def func(filename, text):
varlist = []
for filename, text in preprocessed_text:
result = []
for line in filter(
lambda x: type(x) not in [ Doc, Begin_doc, End_doc ],
@ -203,12 +202,19 @@ def get_parsed_text():
l = find_variables_in_line(line)
l = filter(lambda x: x not in varlist, l)
result.append( (l,line) )
main_result.append( (filename, result) )
return main_result
return result
#main_result = []
#for filename,text in preprocessed_text:
# main_result.append( (filename, func(filename,text)) )
#return main_result
return parallel_loop(func,preprocessed_text)
parsed_text = get_parsed_text()
######################################################################
def move_to_top(text,t):
@ -240,6 +246,7 @@ for filename,text in parsed_text:
result.append ( (filename,text) )
parsed_text = result
######################################################################
def move_variables():
@ -329,9 +336,14 @@ def move_variables():
result.append( (vars,line) )
return result
return parallel_loop(func,parsed_text)
main_result = []
for filename,text in parsed_text:
main_result.append( (filename, func(filename,text)) )
return main_result
#return parallel_loop(func,parsed_text)
parsed_text = move_variables()
######################################################################
def build_sub_needs():
# Needs
@ -366,6 +378,7 @@ def add_subroutine_needs():
parsed_text = add_subroutine_needs()
######################################################################
def build_needs():
# Needs
@ -428,6 +441,7 @@ for filename,text in parsed_text:
result.append ( (filename,text) )
parsed_text = result
######################################################################
from command_line import command_line

View File

@ -1 +1 @@
version = "1.1.49"
version = "1.1.50"