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)
void print_usage(char **argv)
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 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 scc_dist(dist_graph_t *g, mpi_data_t *comm, queue_data_t *q, uint64_t root, char *output_file)
int wcc_dist(dist_graph_t *g, mpi_data_t *comm, queue_data_t *q, uint64_t root, char *output_file)