<p><b>dwj07@fsu.edu</b> 2012-09-06 14:28:27 -0600 (Thu, 06 Sep 2012)</p><p><br>
        -- TRUNK COMMIT --<br>
<br>
        Committing hooks for TAU usage.<br>
        Now (assuming you have TAU built), you can build with something like...<br>
        "make gfortran CORE=ocean TAU=true" and it will link against the tau libraries.<br>
<br>
        This way hardware counters can be used for the timer sections.<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/Makefile
===================================================================
--- trunk/mpas/Makefile        2012-09-05 14:53:12 UTC (rev 2141)
+++ trunk/mpas/Makefile        2012-09-06 20:28:27 UTC (rev 2142)
@@ -267,6 +267,15 @@
        PAPI_MESSAGE="Papi libraries are off."
endif # USE_PAPI IF
+ifeq "$(TAU)" "true"
+        LINKER=tau_f90.sh
+        CPPINCLUDES += -DMPAS_TAU
+        TAU_MESSAGE="TAU Hooks are on."
+else
+        LINKER=$(FC)
+        TAU_MESSAGE="TAU Hooks are off."
+endif
+
ifneq ($(wildcard $(NETCDF)/lib/libnetcdff.*), ) # CHECK FOR NETCDF4
        LIBS += -lnetcdff
endif # CHECK FOR NETCDF4
@@ -291,6 +300,7 @@
CC="$(CC)" \
SFC="$(SFC)" \
SCC="$(SCC)" \
+ LINKER="$(LINKER)" \
CFLAGS="$(CFLAGS)" \
FFLAGS="$(FFLAGS)" \
LDFLAGS="$(LDFLAGS)" \
@@ -306,6 +316,7 @@
        @echo $(DEBUG_MESSAGE)
        @echo $(SERIAL_MESSAGE)
        @echo $(PAPI_MESSAGE)
+        @echo $(TAU_MESSAGE)
clean:
        cd src; $(MAKE) clean RM="$(RM)" CORE="$(CORE)"
        $(RM) $(CORE)_model.exe
Modified: trunk/mpas/src/Makefile
===================================================================
--- trunk/mpas/src/Makefile        2012-09-05 14:53:12 UTC (rev 2141)
+++ trunk/mpas/src/Makefile        2012-09-06 20:28:27 UTC (rev 2142)
@@ -3,7 +3,7 @@
all: mpas
mpas: reg_includes externals frame ops dycore drver
-        $(FC) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time
+        $(LINKER) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time
reg_includes:
        ( cd registry; $(MAKE) CC="$(SCC)" )
Modified: trunk/mpas/src/framework/mpas_timer.F
===================================================================
--- trunk/mpas/src/framework/mpas_timer.F        2012-09-05 14:53:12 UTC (rev 2141)
+++ trunk/mpas/src/framework/mpas_timer.F        2012-09-06 20:28:27 UTC (rev 2142)
@@ -46,6 +46,10 @@
integer :: clock, hz, usecs
+#ifdef MPAS_TAU
+ call tau_start(timer_name)
+#endif
+
timer_added = .false.
timer_found = .false.
@@ -170,6 +174,10 @@
real (kind=RKIND) :: time_temp
logical :: timer_found, string_equal, check_flag
integer :: clock, hz, usecs
+
+#ifdef MPAS_TAU
+ call tau_stop(timer_name)
+#endif
timer_found = .false.
</font>
</pre>