[llvm-commits] [test-suite] r42665 - in /test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft: ft.c graph.c
Anton Korobeynikov
asl at math.spbu.ru
Fri Oct 5 16:37:11 PDT 2007
Author: asl
Date: Fri Oct 5 18:37:11 2007
New Revision: 42665
URL: http://llvm.org/viewvc/llvm-project?rev=42665&view=rev
Log:
Time reporting is useless here, remove it. This unbreaks mingw32 also :)
Modified:
test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft/ft.c
test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft/graph.c
Modified: test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft/ft.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft/ft.c?rev=42665&r1=42664&r2=42665&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft/ft.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft/ft.c Fri Oct 5 18:37:11 2007
@@ -40,7 +40,6 @@
#include <assert.h>
#include <sys/time.h>
-#include <sys/resource.h>
#include "Fheap.h"
#include "graph.h"
@@ -51,12 +50,15 @@
#define DEFAULT_N_VERTEX 10
#define DEFAULT_N_EDGE 9
+#ifdef __MINGW32__
+#define srandom(x) srand(x)
+#endif
+
/*
* Local functions.
*/
void PrintMST(Vertices * graph);
Vertices * MST(Vertices * graph);
-void PrintRUsage(struct rusage * rUBuf1, struct rusage * rUBuf2);
/*
* Local variables.
@@ -69,8 +71,6 @@
int nVertex;
int nEdge;
Vertices * graph;
- struct rusage * rUBuf1;
- struct rusage * rUBuf2;
nVertex = DEFAULT_N_VERTEX;
nEdge = DEFAULT_N_EDGE;
@@ -88,11 +88,6 @@
}
}
- rUBuf1 = (struct rusage *)malloc(sizeof(struct rusage));
- assert(rUBuf1 != NULL);
- rUBuf2 = (struct rusage *)malloc(sizeof(struct rusage));
- assert(rUBuf1 != NULL);
-
if(debug)
{
printf("Generating a connected graph ... ");
@@ -105,12 +100,8 @@
printf("done\nFinding the mininmum spanning tree ... ");
}
- getrusage(RUSAGE_SELF, rUBuf1);
-
graph = MST(graph);
- getrusage(RUSAGE_SELF, rUBuf2);
-
if(debug)
{
printf("done\nThe graph:\n");
@@ -123,7 +114,6 @@
{
printf("Time spent in finding the mininum spanning tree:\n");
}
- PrintRUsage(rUBuf1, rUBuf2);
#ifdef PLUS_STATS
PrintDerefStats(stderr);
PrintHeapSize(stderr);
@@ -200,34 +190,3 @@
}
-void
-PrintRUsage(struct rusage * rUBuf1, struct rusage * rUBuf2)
-{
- long sec;
- long usec;
-
- sec = (*rUBuf2).ru_utime.tv_sec - (*rUBuf1).ru_utime.tv_sec;
- usec = (*rUBuf2).ru_utime.tv_usec - (*rUBuf1).ru_utime.tv_usec;
- if(usec < 0)
- {
- sec--;
- usec += 1000000;
- }
- assert(sec >= 0);
- assert(usec >= 0);
-
- /*fprintf(stderr, "User time: %d%06d usec\n", sec, usec); */
-
- sec = (*rUBuf2).ru_stime.tv_sec - (*rUBuf1).ru_stime.tv_sec;
- usec = (*rUBuf2).ru_stime.tv_usec - (*rUBuf1).ru_stime.tv_usec;
-
- if(usec < 0)
- {
- sec--;
- usec += 1000000;
- }
- assert(sec >= 0);
- assert(usec >= 0);
-
- /*fprintf(stderr, "Sys time: %d%06d usec\n", sec, usec); */
-}
Modified: test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft/graph.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft/graph.c?rev=42665&r1=42664&r2=42665&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft/graph.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Ptrdist/ft/graph.c Fri Oct 5 18:37:11 2007
@@ -36,6 +36,10 @@
#define TRUE 1
#define FALSE 0
+#ifdef __MINGW32__
+#define random() rand()
+#endif
+
#define GET_WEIGHT (random() + 1) % MAX_WEIGHT
/*
More information about the llvm-commits
mailing list