-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path\
71 lines (64 loc) · 1.46 KB
/
\
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//Graph format: Json based format
//Storage format:
//struct{
// int: src_ver
// Arr: [ver_0|ver_1|ver_2|...]
// Int: num_conn_ver
// }
/* main.cu */
#include "graph.h"
#include <sstream>
#include <iostream>
#include <fstream>
#include <pthread.h>
#define N 256*256
using namespace std;
int main(int args, char *argv[]) {
// pthread_t thd1;
//pthread_t *thd = new pthread_t[GPU_NUM];
std::cout<<"Input format: ./exe graph-file-name"
<<" (json formated file)\n";
if(args != 2) return -1;
string json_file = argv[1];
graph *graph_d
= new graph (json_file);
cout<<"no edge reduction\n";
// mygraph=graph_d;
// test sort part!
// graph_d->sort();
// cout<<"naive reduce\n";
// graph_d->reduce();
// graph_d->reverse_rank_by_degree();
// cout<<"rank by degree\n";
// graph_d->rank_by_degree();
// cout<<"heap\n";
// graph_d->reheap();
cout<<"calculate\n";
double time = 0;
for(int i=0;i<3;i++){
double t0=wtime();
graph_d->validation();
// graph_d->bs();
// graph_d->tc();
double t1=wtime();
time+=t1-t0;
cout<<"total time = "<<t1-t0<<" secondes"<<endl;
}
time = time/3;
cout<<"average time of 3 round = "<<time<<" secondes"<<endl;
/*
graph_d->triangle_count();
graph_d->validation();
int err=0;
int count1=graph_d->count[0];
int count2=0;
for(int i=0; i<graph_d->vert_count; i++){
count2+= graph_d->valid[i];
}
err = count1-count2;
printf("count1 = %d, count2 = %d\n",count1,count2);
printf("err number = %d\n",err);
*/
// test scan part!'
return 0;
}