diff --git a/src/entity.py b/src/entity.py index ca9c97b..adc9eb4 100644 --- a/src/entity.py +++ b/src/entity.py @@ -647,7 +647,7 @@ class Entity(object): text.append(([], Declaration(line_prototype.i, " double precision :: irp_rdtsc, irp_rdtsc1, irp_rdtsc2", line_prototype.filename))) - text.append(([], Simple_line(lline_prototype.i, " irp_rdtsc1 = irp_rdtsc()", + text.append(([], Simple_line(line_prototype.i, " irp_rdtsc1 = irp_rdtsc()", line_prototype.filename))) for vars, line in ps_text[begin + 1:end]: diff --git a/src/irpf90.py b/src/irpf90.py index f5573b2..99632f9 100644 --- a/src/irpf90.py +++ b/src/irpf90.py @@ -99,7 +99,7 @@ def main(): if command_line.do_profile: import profile - profile.run() + profile.run(comm_world.d_entity) if command_line.do_openmp: comm_world.create_lock() diff --git a/src/profile.py b/src/profile.py index 4b3dbce..02094e2 100644 --- a/src/profile.py +++ b/src/profile.py @@ -52,15 +52,8 @@ def build_rdtsc(): file = open(filename,'w') file.write(rdtsc) file.close() -# def t(): -# p = subprocess.Popen(["gcc","-O2",filename,"-c","-o","irp_rdtsc.o"]) -# p.communicate() -# os.remove(filename) -# -# threading.Thread(target=t).start() -def build_module(): - from irpy_files import variables +def build_module(variables): data = """ module irp_timer double precision :: irp_profile(3,%(n)d) @@ -176,9 +169,7 @@ end file.write(data) file.close() -def run(): - build_module() +def run(d_entity): + build_module(d_entity) build_rdtsc() -if __name__ == "__main__": - build_rdtsc()