70 printf(
"To run: %s [graphfile] [options]\n", argv[0]);
71 printf(
"\t Use -h for list of options\n\n");
76 printf(
"To run: %s [graphfile] [options]\n\n", argv[0]);
79 printf(
"\t\tRun all analytics\n");
81 printf(
"\t\tRun weakly connected components\n");
83 printf(
"\t\tRun strongly connected components\n");
85 printf(
"\t\tRun label propagation\n");
87 printf(
"\t\tRun PageRank\n");
89 printf(
"\t\tRun harmonic centrality\n");
91 printf(
"\t\tRun approximate k-core\n");
92 printf(
"\t-o [outfile]\n");
93 printf(
"\t\tAdjust output file [default: 'out.algorithm']\n");
94 printf(
"\t-i [comma separated input vertex id list]\n");
95 printf(
"\t\tVertex ids to analyze for harmonic centrality [default: none]\n");
96 printf(
"\t-p [part file]\n");
97 printf(
"\t\tPartition file to use for mapping vertices to tasks\n");
99 printf(
"\t\tAdjust iteration count for label prop, PageRank, k-core [default: 20]\n");
101 printf(
"\t\tRun verification routines\n");
103 printf(
"\t\tRun verification routines\n");
105 printf(
"\t\tRun verification routines\n");
119 MPI_Init(&argc, &argv);
120 MPI_Comm_rank(MPI_COMM_WORLD, &
procid);
121 MPI_Comm_size(MPI_COMM_WORLD, &
nprocs);
126 MPI_Barrier(MPI_COMM_WORLD);
127 MPI_Abort(MPI_COMM_WORLD, 1);
130 char* input_filename = strdup(argv[1]);
132 bool run_wcc =
false;
133 bool run_scc =
false;
136 bool run_harmonic_centrality =
false;
137 bool run_degree_centrality =
false;
139 bool run_approx_kcore =
false;
143 char* output_file = NULL;
144 char* temp_out = NULL;
145 char* input_list_str = NULL;
147 char* part_list = NULL;
150 while ((c = getopt (argc, argv,
"awsrlckt:n:p:o:i:hfvd")) != -1) {
157 run_harmonic_centrality =
true;
160 case 'w': run_wcc =
true;
break;
161 case 's': run_scc =
true;
break;
164 case 'c': run_harmonic_centrality =
true;
break;
166 case 'f':
verify =
true;
break;
167 case 'v':
verbose =
true;
break;
168 case 'd':
debug =
true;
break;
171 num_iter = strtoul(optarg, NULL, 10);
break;
172 run_approx_kcore =
true;
174 part_list = (
char*)malloc((strlen(optarg)+8)*
sizeof(char));
176 strcat(part_list, optarg);
180 output_file = (
char*)malloc((strlen(optarg)+128)*
sizeof(char));
181 output_file[0] =
'\0';
182 strcat(output_file, optarg);
185 input_list_str = (
char*)malloc((strlen(optarg)+8)*
sizeof(char));
186 input_list_str[0] =
'\0';
187 strcat(input_list_str, optarg);
191 MPI_Barrier(MPI_COMM_WORLD);
192 MPI_Abort(MPI_COMM_WORLD, 1);
195 throw_err(
"Input argument format error, use '-h' for options");
213 if (part_list != NULL)
223 if (input_list_str != NULL)
225 input_list =
str_to_array(input_list_str, &num_to_output);
233 if (num_to_output < 0)
235 if (output_file == NULL)
236 output_file = strdup(
"out");
237 temp_out = (
char*)malloc((strlen(output_file)+128)*
sizeof(char));
242 strcat(temp_out, output_file);
243 strcat(temp_out,
".wcc");
249 strcat(temp_out, output_file);
250 strcat(temp_out,
".scc");
256 strcat(temp_out, output_file);
257 strcat(temp_out,
".pagerank");
263 strcat(temp_out, output_file);
264 strcat(temp_out,
".labelprop");
267 if (run_harmonic_centrality)
270 strcat(temp_out, output_file);
271 strcat(temp_out,
".harmonic");
272 harmonic_dist(&g, &comm, &
q, temp_out, num_to_output, input_list);
277 strcat(temp_out, output_file);
278 strcat(temp_out,
".kcore");
279 kcore_dist(&g, &comm, &
q, num_iter, temp_out, run_approx_kcore);
286 free(input_filename);
289 if (input_list != NULL)
291 if (input_list_str != NULL)
292 free(input_list_str);
294 MPI_Barrier(MPI_COMM_WORLD);
void print_usage_full(char **argv)
int main(int argc, char **argv)
void print_usage(char **argv)
Mac OS X ATTR com apple quarantine q
void clear_comm_data(mpi_data_t *comm)
void clear_queue_data(queue_data_t *q)
void init_queue_data(dist_graph_t *g, queue_data_t *q)
void init_comm_data(mpi_data_t *comm)
int clear_graph(dist_graph_t *g)
int repart_graph(dist_graph_t *g, mpi_data_t *comm, char *part_file)
int relabel_edges(dist_graph_t *g)
int create_graph(graph_gen_data_t *ggi, dist_graph_t *g)
int create_graph_serial(graph_gen_data_t *ggi, dist_graph_t *g)
int get_max_degree_vert(dist_graph_t *g)
int harmonic_dist(dist_graph_t *g, mpi_data_t *comm, queue_data_t *q, char *output_file, uint64_t num_to_output, uint64_t *input_list)
int load_graph_edges_64(char *input_filename, graph_gen_data_t *ggi)
int exchange_in_edges(graph_gen_data_t *ggi, mpi_data_t *comm)
int exchange_out_edges(graph_gen_data_t *ggi, mpi_data_t *comm)
int kcore_dist(dist_graph_t *g, mpi_data_t *comm, queue_data_t *q, uint32_t num_iter, char *output_file, bool run_approx)
int run_kcore(dist_graph_t *g, mpi_data_t *comm, queue_data_t *q, uint64_t *kcores, uint32_t num_iter, bool run_approx)
int labelprop_dist(dist_graph_t *g, mpi_data_t *comm, uint32_t num_iter, char *output_file)
int run_labelprop(dist_graph_t *g, mpi_data_t *comm, uint64_t *&labels, uint32_t num_iter)
int scc_dist(dist_graph_t *g, mpi_data_t *comm, queue_data_t *q, uint64_t root, char *output_file)
unsigned __int64 uint64_t
void throw_err(char const *err_message)
uint64_t * str_to_array(char *input_list_str, uint64_t *num)
int wcc_dist(dist_graph_t *g, mpi_data_t *comm, queue_data_t *q, uint64_t root, char *output_file)