some improvements in fortran api implementation file,
authorGengbin Zheng <gzheng@illinois.edu>
Fri, 20 Feb 2004 06:17:07 +0000 (06:17 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Fri, 20 Feb 2004 06:17:07 +0000 (06:17 +0000)
and added an fortran interface subroutine module file.

src/ck-perf/tracef.C
src/ck-perf/tracef_f.f90 [new file with mode: 0644]

index 02b1fdabfb56761ade3b7397cb1f427e87b8e121..cf4c8583f2537bbd4b8011a66592a2685f9192d7 100644 (file)
@@ -5,11 +5,11 @@
 #include<charm++.h>
 #include<charm-api.h>
                                                                                 
-CpvDeclare(int, a);
+CpvStaticDeclare(int, a);
                                                                                 
 static int isInitialized=0;
                                                                                 
-void checkInit(void) {
+static void checkInit(void) {
         if (isInitialized) return;
         isInitialized=1;
         CpvInitialize(int,a);
@@ -17,7 +17,13 @@ void checkInit(void) {
 }
 
 FDECL {
-void FTN_NAME(FTRACEBEGIN, ftracebegin)()
+
+#define ftracebegin              FTN_NAME(FTRACEBEGIN, ftracebegin)
+#define ftraceend               FTN_NAME(FTRACEEND, ftraceend)
+#define ftraceregisteruserevent  FTN_NAME(FTRACEREGISTERUSEREVENT, ftraceregisteruserevent)
+#define ftraceuserbracketevent   FTN_NAME(FTRACEUSERBRACKETEVENT, ftraceuserbracketevent)
+
+void ftracebegin()
 {
           checkInit();
           if ( CpvAccess(a) ==0)
@@ -42,7 +48,7 @@ void FTN_NAME(FTRACEEND, ftraceend)()
                                                                                 
 }
 
-void FTN_NAME(FTRACEREGISTERUSEREVENT, ftraceregisteruserevent)(char *x, int *ein, int *eout, int len)
+void ftraceregisteruserevent(char *x, int *ein, int *eout, int len)
 {
   char *newstr = new char[len + 1];
   _MEMCHECK(newstr);
@@ -52,15 +58,10 @@ void FTN_NAME(FTRACEREGISTERUSEREVENT, ftraceregisteruserevent)(char *x, int *ei
   *eout = newe;
 }
 
-void FTN_NAME(FTRACEUSERBRACKETEVENT, ftraceuserbracketevent)(int *e, double *begint, double *endt)
+void ftraceuserbracketevent(int *e, double *begint, double *endt)
 {
   traceUserBracketEvent(*e, *begint, *endt);
 }
 
-void FTN_NAME(FCMIWALLTIMER, fcmiwalltimer)(double *t)
-{
-  *t = CmiWallTimer();
-}
-
 }  // FDECL
 
diff --git a/src/ck-perf/tracef_f.f90 b/src/ck-perf/tracef_f.f90
new file mode 100644 (file)
index 0000000..fd34079
--- /dev/null
@@ -0,0 +1,22 @@
+      module tracemod
+      implicit none
+      external fpup_int
+      interface
+        subroutine ftraceBegin()
+        end subroutine
+        subroutine ftraceEnd()
+        end subroutine
+        subroutine ftraceregisteruserevent(str, ein, eout)
+          character(*), intent(in) :: str
+          integer, intent(in) :: ein
+          integer, intent(out) :: eout
+        end subroutine
+        subroutine ftraceuserbracketevent(ein, bt, et)
+          integer, intent(in) :: ein
+          double precision, intent(in) :: bt, et
+        end subroutine
+      end interface
+      end module
+
+
+