diff --git a/example/Makefile b/example/Makefile index 860b446..08bfe3a 100644 --- a/example/Makefile +++ b/example/Makefile @@ -1,7 +1,12 @@ -IRPF90= ../bin/irpf90 -d -IRPF90FLAGS= -I input/ -# Make | Ninja -BUILD_SYSTEM= make +# make | ninja +############## + +BUILD_SYSTEM= ninja + +####### + +IRPF90= ../bin/irpf90 +IRPF90FLAGS= -I input --codelet=v:100 .EXPORT_ALL_VARIABLES: @@ -10,8 +15,8 @@ SRC = OBJ = # Compiler ! Will be overwriten by the ENV one if avalaible. -FC ?= gfortran-6 -FCFLAGS ?= -O2 +FC =ifort +FCFLAGS ?= -O2 CC ?= gcc CFLAGS ?= -O2 @@ -33,17 +38,18 @@ CXXFLAGS ?= -O2 # | | I _________ # | | I c(` ')o # | l I \. ,/ -# _/j L l\_! _// +# _/j L l\_! _// \\_ #Misc AR ?= RANLIB ?= # Variable need by IRPF90 -ifeq ($(BUILD_SYSTEM),ninja) +BUILD_SYSTEM_stripped=$(strip $(BUILD_SYSTEM)) +ifeq ($(BUILD_SYSTEM_stripped),ninja) BUILD_FILE=IRPF90_temp/build.ninja IRPF90FLAGS += -j -else ifeq ($(BUILD_SYSTEM),make) +else ifeq ($(BUILD_SYSTEM_stripped),make) BUILD_FILE=IRPF90_temp/build.make BUILD_SYSTEM += -j else @@ -60,7 +66,7 @@ ARCH = $(addprefix $(CURDIR)/,IRPF90_temp/irpf90.a) all: $(EXE) define run - $(BUILD_SYSTEM) -C $(dir $(BUILD_FILE) ) -f $(notdir $(BUILD_FILE) ) $(1) + $(BUILD_SYSTEM_stripped) -C $(dir $(BUILD_FILE) ) -f $(notdir $(BUILD_FILE) ) $(1) endef #We allow for the user to ask for 'relative' path diff --git a/example/irp_example2.irp.f b/example/irp_example2.irp.f index 2d0d23b..a5299b6 100644 --- a/example/irp_example2.irp.f +++ b/example/irp_example2.irp.f @@ -1,6 +1,6 @@ program irp_example2 print *, "Example 2" - print *, 't = ', t + print *, 'v = ', v IRP_WRITE t diff --git a/example/uvwt.irp.f b/example/uvwt.irp.f index 859cd09..365a577 100644 --- a/example/uvwt.irp.f +++ b/example/uvwt.irp.f @@ -27,5 +27,5 @@ END_PROVIDER INTEGER function fu(x,y) INTEGER, INTENT(in) :: x,y - fu = int(x+y+1+3) + fu = x+y+1 END FUNCTION diff --git a/src/build_file.py b/src/build_file.py index b62a63e..bc2e446 100644 --- a/src/build_file.py +++ b/src/build_file.py @@ -413,9 +413,13 @@ def run(d_module, ninja): l_irp_sup_o += ["irp_locks.irp.o"] l_irp_sup_s += ["irp_locks.irp.F90"] + if command_line.do_profile or command_line.do_codelet: + l_irp_sup_o += ["irp_rdtsc.o"] + l_irp_sup_s += ["irp_rdtsc.c"] + if command_line.do_profile: - l_irp_sup_o += ["irp_profile.irp.o", "irp_rdtsc.o"] - l_irp_sup_s += ["irp_profile.irp.F90", "irp_rdtsc.c"] + l_irp_sup_o += ["irp_profile.irp.o"] + l_irp_sup_s += ["irp_profile.irp.F90"] l_irp_sup_o = map(dress, l_irp_sup_o) l_irp_sup_s = map(dress, l_irp_sup_s) diff --git a/src/irpy_files.py b/src/irpy_files.py index cf21007..b438d31 100644 --- a/src/irpy_files.py +++ b/src/irpy_files.py @@ -294,7 +294,7 @@ class Irpy_comm_world(object): from util import lazy_write_file from util import ashes_env - str_ = ashes_env.render('irp_stack.F90', { + str_ = ashes_env.render('irp_stack.f90', { 'do_debug': command_line.do_debug, 'do_openmp': command_line.do_openmp, 'do_memory': command_line.do_memory @@ -318,6 +318,6 @@ class Irpy_comm_world(object): from util import lazy_write_file from util import ashes_env - str_ = ashes_env.render('irp_lock.F90', {'entity': sorted(self.d_entity)}) + str_ = ashes_env.render('irp_lock.f90', {'entity': sorted(self.d_entity)}) filename = os.path.join(irpf90_t.irpdir, 'irp_locks.irp.F90') lazy_write_file(filename, str_) diff --git a/src/lib/__init__.pyc b/src/lib/__init__.pyc index bf8d3fd..b58c681 100644 Binary files a/src/lib/__init__.pyc and b/src/lib/__init__.pyc differ diff --git a/src/lib/manager.pyc b/src/lib/manager.pyc index fd18840..1d835e9 100644 Binary files a/src/lib/manager.pyc and b/src/lib/manager.pyc differ diff --git a/src/lib/static_ashes.pyc b/src/lib/static_ashes.pyc index 14f6f75..6eabe59 100644 Binary files a/src/lib/static_ashes.pyc and b/src/lib/static_ashes.pyc differ diff --git a/src/templates/general.make b/src/templates/general.make index 8e1ebb0..e3668fe 100644 --- a/src/templates/general.make +++ b/src/templates/general.make @@ -1,7 +1,12 @@ +# make | ninja +############## + +BUILD_SYSTEM= {BUILD_SYSTEM} + +####### + IRPF90= irpf90 IRPF90FLAGS= {irpf90_flags} -# Make | Ninja -BUILD_SYSTEM= {BUILD_SYSTEM} .EXPORT_ALL_VARIABLES: @@ -33,17 +38,18 @@ CXXFLAGS ?= {CXXFLAGS} # | | I _________ # | | I c(` ')o # | l I \. ,/ -# _/j L l\_! _// +# _/j L l\_! _// \\_ #Misc AR ?= {ar} RANLIB ?= {ranlib} # Variable need by IRPF90 -ifeq ($(BUILD_SYSTEM),ninja) +BUILD_SYSTEM_stripped=$(strip $(BUILD_SYSTEM)) +ifeq ($(BUILD_SYSTEM_stripped),ninja) BUILD_FILE=IRPF90_temp/build.ninja IRPF90FLAGS += -j -else ifeq ($(BUILD_SYSTEM),make) +else ifeq ($(BUILD_SYSTEM_stripped),make) BUILD_FILE=IRPF90_temp/build.make BUILD_SYSTEM += -j else @@ -60,7 +66,7 @@ ARCH = $(addprefix $(CURDIR)/,IRPF90_temp/irpf90.a) all: $(EXE) define run - $(BUILD_SYSTEM) -C $(dir $(BUILD_FILE) ) -f $(notdir $(BUILD_FILE) ) $(1) + $(BUILD_SYSTEM_stripped) -C $(dir $(BUILD_FILE) ) -f $(notdir $(BUILD_FILE) ) $(1) endef #We allow for the user to ask for 'relative' path diff --git a/src/templates/ioer.f90 b/src/templates/ioer.f90 index a00789a..2fde02c 100644 --- a/src/templates/ioer.f90 +++ b/src/templates/ioer.f90 @@ -59,12 +59,12 @@ SUBROUTINE reader_{name}(irp_num) END DO {#group_entity} - OPEN(UNIT=irp_iunit,file='irpf90_{name}_'//trim(irp_num),FORM='FORMATTED',STATUS='UNKNOWN',ACTION='WRITE') + OPEN(UNIT=irp_iunit,file='irpf90_{name}_'//trim(irp_num),FORM='FORMATTED',STATUS='OLD',ACTION='READ') READ(irp_iunit,*) {name}{dim} CLOSE(irp_iunit) {/group_entity} - CALL touch_{name} + CALL touch_{same_as} {?do_debug} CALL irp_leave(irp_here) {/do_debug} END SUBROUTINE reader_{name}