From 98c8fa268cccfc0f3666e2a0d9e0890b2047a427 Mon Sep 17 00:00:00 2001 From: rosinski Date: Thu, 24 May 2007 19:46:31 +0000 Subject: [PATCH] Get rid of CAM stuff. The latest CAM model doesn't need it. --- Makefile.in | 26 +++----- camgptl.inc | 69 -------------------- camwrappers.c | 160 ----------------------------------------------- configure | 39 +++++++++++- configure.ac | 3 + ctests/scale.c | 2 +- ftests/camtest.F | 45 ------------- ftests/ugex.F | 2 +- 8 files changed, 52 insertions(+), 294 deletions(-) delete mode 100644 camgptl.inc delete mode 100644 camwrappers.c delete mode 100644 ftests/camtest.F diff --git a/Makefile.in b/Makefile.in index 85cc9c0a..319ad26a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,35 +1,29 @@ CC = @CC@ -CFLAGS = @CAMFLAGS@ @CFLAGS@ @THREADFLAGS@ @FDEFS@ @THREADDEFS@ @DEFS@ @PAPIPREP@ @BITFLAGS@ +CFLAGS = @CFLAGS@ @THREADFLAGS@ @FDEFS@ @THREADDEFS@ @DEFS@ @PAPIPREP@ @BITFLAGS@ LIBNAME = libgptl.a -CAMLIB = libcamgptl.a LIBDIR = @prefix@/lib INCDIR = @prefix@/include MANDIR = @prefix@/man/man3 OBJS = f_wrappers.o gptl.o util.o threadutil.o get_memusage.o \ print_memusage.o gptl_papi.o -CAMOBJS = camwrappers.o gptl.o util.o threadutil.o get_memusage.o \ - print_memusage.o gptl_papi.o +AR = @AR@ + @SET_MAKE@ -all: $(LIBNAME) $(CAMLIB) ctests/all ftests/all +all: $(LIBNAME) ctests/all ftests/all $(LIBNAME): $(OBJS) - ar @ARFLAGS@ $@ $(OBJS) - rm -f ctests/*.o ftests/*.o - -$(CAMLIB): $(CAMOBJS) - ar @ARFLAGS@ $@ $(CAMOBJS) + $(AR) @ARFLAGS@ $@ $(OBJS) rm -f ctests/*.o ftests/*.o -install: $(LIBNAME) $(CAMLIB) +install: $(LIBNAME) cp $(LIBNAME) $(LIBDIR) - cp $(CAMLIB) $(LIBDIR) - cp gptl.h gptl.inc camgptl.inc $(INCDIR) + cp gptl.h gptl.inc $(INCDIR) cp man/man3/*.3 $(MANDIR) uninstall: - rm -f $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(CAMLIB) $(INCDIR)/gptl.h $(INCDIR)/gptl.inc + rm -f $(LIBDIR)/$(LIBNAME) $(INCDIR)/gptl.h $(INCDIR)/gptl.inc ctests/all: (cd ctests && $(MAKE) all) @@ -38,12 +32,10 @@ ftests/all: (cd ftests && $(MAKE) all) clean: - rm -f $(OBJS) camwrappers.o $(CAMOBJS) $(LIBNAME) $(CAMLIB) + rm -f $(OBJS) $(LIBNAME) (cd ctests && $(MAKE) clean) (cd ftests && $(MAKE) clean) -camwrappers.o: camwrappers.c gptl.h private.h cfort.h - $(CC) -c @BITFLAGS@ @CAMFLAGS@ -o $@ $*.c f_wrappers.o: f_wrappers.c gptl.h private.h gptl.o: gptl.c gptl.h private.h util.o: util.c gptl.h private.h diff --git a/camgptl.inc b/camgptl.inc deleted file mode 100644 index ee7f96e2..00000000 --- a/camgptl.inc +++ /dev/null @@ -1,69 +0,0 @@ - integer GPTLwall - integer GPTLcpu - integer GPTLabort_on_error - integer GPTLoverhead - integer GPTLdepthlimit - integer GPTLverbose - integer GPTLnarrowprint - integer GPTLparentchild - - integer GPTLnanotime - integer GPTLrtc - integer GPTLmpiwtime - integer GPTLclockgettime - integer GPTLgettimeofday - integer GPTLpapitime - - parameter (GPTLwall = 1) - parameter (GPTLcpu = 2) - parameter (GPTLabort_on_error = 3) - parameter (GPTLoverhead = 4) - parameter (GPTLdepthlimit = 5) - parameter (GPTLverbose = 6) - parameter (GPTLnarrowprint = 7) - parameter (GPTLparentchild = 8) - - parameter (GPTLgettimeofday = 9) - parameter (GPTLnanotime = 10) - parameter (GPTLrtc = 11) - parameter (GPTLmpiwtime = 12) - parameter (GPTLclockgettime = 13) - parameter (GPTLpapitime = 14) - -! Externals - - integer gptlsetoption - integer gptlinitialize - integer t_startf - integer t_stopf - integer t_stampf - integer gptlpr - integer gptlreset - integer gptlfinalize - integer gptlenable - integer gptldisable - integer gptlsetutr - integer gptlquery - integer gptlquerycounters - integer gptlget_nregions - integer gptlget_regionname - integer gptl_papiprinttable - integer gptl_papiname2id - - external gptlsetoption - external gptlinitialize - external t_startf - external t_stopf - external t_stampf - external gptlpr - external gptlreset - external gptlfinalize - external gptlenable - external gptldisable - external gptlsetutr - external gptlquery - external gptlquerycounters - external gptlget_nregions - external gptlget_regionname - external gptl_papiprinttable - external gptl_papiname2id diff --git a/camwrappers.c b/camwrappers.c deleted file mode 100644 index 056f0f98..00000000 --- a/camwrappers.c +++ /dev/null @@ -1,160 +0,0 @@ -/* -** $Id: camwrappers.c,v 1.19 2007-02-20 22:39:18 rosinski Exp $ -** -** Fortran wrappers for timing library routines used by CAM -*/ -#include "cfort.h" - -#include -#include "private.h" /* MAX_CHARS, bool */ -#include "gptl.h" /* function prototypes */ - -#if ( defined FORTRANCAPS ) - -#define gptlinitialize GPTLINITIALIZE -#define gptlfinalize GPTLFINALIZE -#define gptlpr GPTLPR -#define gptlreset GPTLRESET -#define t_stampf T_STAMPF -#define t_startf T_STARTF -#define t_stopf T_STOPF -#define gptlsetoption GPTLSETOPTION -#define gptlenable GPTLENABLE -#define gptldisable GPTLDISABLE -#define gptlsetutr GPTLSETUTR -#define gptlquery GPTLQUERY -#define gptl_papiprinttable GPTL_PAPIPRINTTABLE -#define gptl_papiname2id GPTL_PAPINAME2ID - -#elif ( defined FORTRANUNDERSCORE ) - -#define gptlinitialize gptlinitialize_ -#define gptlfinalize gptlfinalize_ -#define gptlpr gptlpr_ -#define gptlreset gptlreset_ -#define t_stampf t_stampf_ -#define t_startf t_startf_ -#define t_stopf t_stopf_ -#define gptlsetoption gptlsetoption_ -#define gptlenable gptlenable_ -#define gptldisable gptldisable_ -#define gptlsetutr gptlsetutr_ -#define gptlquery gptlquery_ -#define gptl_papiprinttable gptl_papiprinttable_ -#define gptl_papiname2id gptl_papiname2id_ - -#elif ( defined FORTRANDOUBLEUNDERSCORE ) - -#define gptlinitialize gptlinitialize_ -#define gptlfinalize gptlfinalize_ -#define gptlpr gptlpr_ -#define gptlreset gptlreset_ -#define t_stampf t_stampf__ -#define t_startf t_startf__ -#define t_stopf t_stopf__ -#define gptlsetoption gptlsetoption_ -#define gptlenable gptlenable_ -#define gptldisable gptldisable_ -#define gptlsetutr gptlsetutr_ -#define gptlquery gptlquery_ -#define gptl_papiprinttable gptl_papiprinttable__ -#define gptl_papiname2id gptl_papiname2id__ - -#endif - -int gptlinitialize () -{ - return GPTLinitialize (); -} - -int gptlfinalize () -{ - return GPTLfinalize (); -} - -int gptlpr (int *procid) -{ - return GPTLpr (*procid); -} - -void gptlreset () -{ - GPTLreset(); - return; -} - -int t_stampf (double *wall, double *usr, double *sys) -{ - return GPTLstamp (wall, usr, sys); -} - -int t_startf (char *name, int nc1) -{ - char cname[MAX_CHARS+1]; - int numchars; - - numchars = MIN (nc1, MAX_CHARS); - strncpy (cname, name, numchars); - cname[numchars] = '\0'; - return GPTLstart (cname); -} - -int t_stopf (char *name, int nc1) -{ - char cname[MAX_CHARS+1]; - int numchars; - - numchars = MIN (nc1, MAX_CHARS); - strncpy (cname, name, numchars); - cname[numchars] = '\0'; - return GPTLstop (cname); -} - -int gptlsetoption (int *option, int *val) -{ - return GPTLsetoption (*option, *val); -} - -int gptlenable () -{ - return GPTLenable (); -} - -int gptldisable () -{ - return GPTLdisable (); -} - -int gptlsetutr (int *option) -{ - return GPTLsetutr (*option); -} - -int gptlquery (const char *name, int *t, int *count, int *onflg, double *wallclock, - double *usr, double *sys, long long *papicounters_out, int *maxcounters, - int nc) -{ - char cname[MAX_CHARS+1]; - int numchars; - - numchars = MIN (nc, MAX_CHARS); - strncpy (cname, name, numchars); - cname[numchars] = '\0'; - return GPTLquery (cname, *t, count, onflg, wallclock, usr, sys, papicounters_out, *maxcounters); -} - -void gptl_papiprinttable () -{ - GPTL_PAPIprinttable (); - return; -} - -int gptl_papiname2id (const char *name, int nc) -{ - char cname[16+1]; - int numchars = MIN (nc, 16); - - strncpy (cname, name, numchars); - cname[numchars] = '\0'; - return GPTL_PAPIname2id (cname); -} diff --git a/configure b/configure index 3481c23c..1fef3dad 100755 --- a/configure +++ b/configure @@ -272,7 +272,7 @@ PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="private.h" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT F77 FFLAGS ac_ct_F77 FLIBS FDEFS THREADDEFS THREADFLAGS FTHREADFLAGS PAPIPREP ARFLAGS BITFLAGS FORTDEFS INSTRFLAGS CAMFLAGS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT F77 FFLAGS ac_ct_F77 FLIBS AR FDEFS THREADDEFS THREADFLAGS FTHREADFLAGS PAPIPREP ARFLAGS BITFLAGS FORTDEFS INSTRFLAGS CAMFLAGS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -4636,6 +4636,42 @@ done +# Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + @@ -5296,6 +5332,7 @@ s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@FLIBS@,$FLIBS,;t t +s,@AR@,$AR,;t t s,@FDEFS@,$FDEFS,;t t s,@THREADDEFS@,$THREADDEFS,;t t s,@THREADFLAGS@,$THREADFLAGS,;t t diff --git a/configure.ac b/configure.ac index ce06fabe..a912b201 100644 --- a/configure.ac +++ b/configure.ac @@ -178,6 +178,9 @@ AC_C_INLINE dnl Checks for library functions. AC_FUNC_VPRINTF +dnl Checks for AR +AC_CHECK_PROG(AR,ar) + AC_SUBST(FDEFS) AC_SUBST(THREADDEFS) AC_SUBST(THREADFLAGS) diff --git a/ctests/scale.c b/ctests/scale.c index fba3a22a..7fe3a766 100644 --- a/ctests/scale.c +++ b/ctests/scale.c @@ -130,7 +130,7 @@ int main (int argc, char **argv) GPTLsetoption (GPTLverbose, 0); #ifdef HAVE_PAPI - GPTLsetoption (PAPI_FP_OPS, 1); +// GPTLsetoption (PAPI_FP_OPS, 1); #endif /* diff --git a/ftests/camtest.F b/ftests/camtest.F deleted file mode 100644 index 65511e26..00000000 --- a/ftests/camtest.F +++ /dev/null @@ -1,45 +0,0 @@ - program camtest - implicit none - - include "../camgptl.inc" - double precision wall, usr, sys - integer size, rss, share, text, datastack - integer id - integer ret - - ret = gptlsetoption (gptlwall, 0) - ret = gptlsetoption (gptlcpu, 1) - ret = gptlsetutr (gptlclockgettime) - - ret = gptlinitialize () - ret = t_stampf (wall, usr, sys) - write (6,*)'wall,usr,sys=', wall,usr,sys - ret = t_startf ('total') - ret = gptldisable () - ret = t_startf ('sub1') - call sub1 () - ret = t_stopf ('sub1') - ret = gptlenable () - ret = t_stopf ('total') - ret = gptlpr (0) - ret = gptlreset () - ret = gptlfinalize () - ret = gptl_papiprinttable () - id = gptl_papiname2id ('PAPI_TOT_CYC') - write(6,*)'id=',id - - stop 0 - end - - subroutine sub1 - implicit none - - integer i - real x - - x = 0. - do i=1,1000000 - x = x + sqrt (0.1*i) - end do - return - end diff --git a/ftests/ugex.F b/ftests/ugex.F index 3d4bf202..5630f9ed 100644 --- a/ftests/ugex.F +++ b/ftests/ugex.F @@ -1,7 +1,7 @@ program ugex implicit none -#include "gptl.inc" +#include "../gptl.inc" #include "f90papi.h" integer, parameter :: nompiter = 128 ! iteration count for threaded loop