Skip to content

Commit

Permalink
See ChangeLog for gptl1_4
Browse files Browse the repository at this point in the history
  • Loading branch information
rosinski committed Aug 23, 2005
1 parent 61f2110 commit 520f817
Show file tree
Hide file tree
Showing 16 changed files with 504 additions and 60 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
gptl1_4: - Added NUMERIC_TIMERS (configure --enable-numeric) for speedup.
If enabled, user args to start/stop MUST be numeric tags rather
than character strings. Intended primarily to be used with
automatic code instrumentation (g++ -finstrument-functions),
and tests/jr-resolve.pl to back out a name.
- Added "numeric" to tests/ in order to test --enable-numeric.
- Remove HASH as an option (it is now assumed) for readability.
- Moved some OMP code from threadutil.c to gptl.c strictly for
efficiency (inlining). Hated to do it because the code really
doesn't belong there.
- Added jr-resolve.pl to tests/ to back out symbol name from
address.
gpt1_2: Changed GPT to GPTL to avoid overlap with other utilities named GPT...
gpt1_1: Added README and man pages. Better commenting. Fixed bug in min
calcs in GPTstop.
Expand Down
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ uninstall:
rm $(LIBDIR)/$(LIBNAME) $(INCDIR)/gptl.h $(INCDIR)/gptl.inc

tests/all:
(cd tests; $(MAKE) all)
(cd tests && $(MAKE) all)

clean:
rm $(OBJS) gptl_papi.o $(LIBNAME)
(cd tests; $(MAKE) clean)
(cd tests && $(MAKE) clean)

camwrappers.o: gptl.h private.h
f_wrappers.o: gptl.h private.h
Expand Down
21 changes: 20 additions & 1 deletion camwrappers.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: camwrappers.c,v 1.7 2004-12-25 00:06:39 rosinski Exp $
** $Id: camwrappers.c,v 1.8 2005-08-23 02:21:27 rosinski Exp $
**
** Fortran wrappers for timing library routines as called from CAM
*/
Expand Down Expand Up @@ -39,8 +39,13 @@

#endif

#ifdef NUMERIC_TIMERS
int t_startf (unsigned long);
int t_stopf (unsigned long);
#else
int t_startf (char *, int);
int t_stopf (char *, int);
#endif

int t_initializef ()
{
Expand Down Expand Up @@ -68,6 +73,19 @@ int t_stampf (double *wall, double *usr, double *sys)
return GPTLstamp (wall, usr, sys);
}

#ifdef NUMERIC_TIMERS
int t_startf (unsigned long tag)
{
return GPTLstart (tag);
}

int t_stopf (unsigned long tag)
{
return GPTLstop (tag);
}

#else

int t_startf (char *name, int nc1)
{
char cname[MAX_CHARS+1];
Expand All @@ -89,3 +107,4 @@ int t_stopf (char *name, int nc1)
cname[numchars] = '\0';
return GPTLstop (cname);
}
#endif
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,24 @@ AC_ARG_ENABLE(debug,[--enable-debug Enable debugging],
LDFLAGS="$LDFLAGS -g"
FLDFLAGS="$FLDFLAGS -g"],)

dnl Add GNU-specific options

if test "$CC" = gcc ; then
CFLAGS="$CFLAGS -finline-functions -Winline"
fi

if test "$CC" = g++ ; then
CFLAGS="$CFLAGS -finline-functions -Winline"
fi

dnl Whether to enable optimization
AC_ARG_ENABLE(opt,[--enable-opt Optimize for speed],
[CFLAGS="$CFLAGS -O";FFLAGS="$FFLAGS -O"],)

dnl Whether to use numeric rather than character timers
AC_ARG_ENABLE(numeric,[--enable-numeric Numeric rather than character timers],
[CFLAGS="$CFLAGS -DNUMERIC_TIMERS"],)

dnl need to add -qfixed to FFLAGS for Fortran tests on AIX
if test "$F77" = xlf90 ; then
FFLAGS="$FFLAGS -qfixed"
Expand Down
23 changes: 22 additions & 1 deletion f_wrappers.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: f_wrappers.c,v 1.10 2004-12-25 00:06:39 rosinski Exp $
** $Id: f_wrappers.c,v 1.11 2005-08-23 02:21:27 rosinski Exp $
**
** Fortran wrappers for timing library routines
*/
Expand Down Expand Up @@ -45,8 +45,13 @@

#endif

#ifdef NUMERIC_TIMERS
int gptlstart (unsigned long);
int gptlstop (unsigned long);
#else
int gptlstart (char *, int);
int gptlstop (char *, int);
#endif

int gptlinitialize ()
{
Expand Down Expand Up @@ -74,6 +79,20 @@ int gptlstamp (double *wall, double *usr, double *sys)
return GPTLstamp (wall, usr, sys);
}

#ifdef NUMERIC_TIMERS

int gptlstart (unsigned long tag)
{
return GPTLstart (tag);
}

int gptlstop (unsigned long tag)
{
return GPTLstop (tag);
}

#else

int gptlstart (char *name, int nc1)
{
char cname[MAX_CHARS+1];
Expand All @@ -96,6 +115,8 @@ int gptlstop (char *name, int nc1)
return GPTLstop (cname);
}

#endif

int gptlsetoption (int *option, int *val)
{
return GPTLsetoption (*option, (bool) *val);
Expand Down
Loading

0 comments on commit 520f817

Please sign in to comment.