[PVFS2-CVS] commit by pcarns in pvfs2/test/correctness/pts: pts.c

CVS commit program cvs at parl.clemson.edu
Sun Oct 3 16:00:55 EDT 2004


Update of /projects/cvsroot/pvfs2/test/correctness/pts
In directory parlweb:/tmp/cvs-serv1289/test/correctness/pts

Modified Files:
	pts.c 
Log Message:
added some little utility functions for determining elapsed wall, user, and 
system times between two specified points; demo in pts.


Index: pts.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/test/correctness/pts/pts.c,v
diff -p -u -r1.13 -r1.14
--- pts.c	18 Mar 2004 20:59:02 -0000	1.13
+++ pts.c	3 Oct 2004 19:00:55 -0000	1.14
@@ -16,6 +16,7 @@
 
 /*pvfs2 functions we're calling (mostly gossip args)*/
 #include "pvfs2-debug.h"
+#include "pint-util.h"
 
 /* this is where all of the individual test prototypes are */
 #include "test-protos.h"
@@ -26,6 +27,8 @@ static config pts_config;
 int main(int argc, char **argv) {
   
   int numprocs, myid, rc, status;
+  PINT_time_marker marker1, marker2;
+  double wtime, stime, utime;
 
   MPI_Init(&argc,&argv);
   MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
@@ -77,10 +80,21 @@ int main(int argc, char **argv) {
   
   /* need to learn how to dup communicators ... should do that here*/
   
+  PINT_time_mark(&marker1);
   rc = run_tests(&pts_config);
+  PINT_time_mark(&marker2);
   
   fprintf(stderr, "%d: DONE RUNNING TESTS!\n", myid);
   //   MPI_Barrier(MPI_COMM_WORLD);
+  if(numprocs == 1)
+  {
+    PINT_time_diff(marker1, marker2, &wtime, &utime, &stime);
+    fprintf(stderr, "Elapsed time:\n");
+    fprintf(stderr, "----------------------\n");
+    fprintf(stderr, "   wall: %f\n", wtime);
+    fprintf(stderr, "   user: %f\n", utime);
+    fprintf(stderr, "   system: %f\n", stime);
+  }
   MPI_Finalize();
 
   exit(0);



More information about the PVFS2-CVS mailing list