137 int mpi_rank(0), mpi_size(0);
147 std::cout <<
"MPI initialized with " << mpi_size <<
" ranks." << std::endl;
152 uint64_t num_vertices = 1;
154 uint64_t hub_threshold;
155 std::string fname_output;
157 parse_cmd_line(argc, argv, vert_scale, hub_threshold, fname_output);
159 num_vertices <<= vert_scale;
161 std::cout <<
"Building Graph500"<< std::endl
162 <<
"Building graph Scale: " << vert_scale << std::endl
163 <<
"Hub threshold = " << hub_threshold << std::endl
164 <<
"File name = " << fname_output << std::endl;
170 bip::allocator<void, segment_manager_t> alloc_inst(segment_manager);
173 uint64_t num_edges_per_rank = num_vertices * 16 / mpi_size;
175 vert_scale, num_edges_per_rank,
176 0.57, 0.19, 0.19, 0.05,
true,
true);
180 std::cout <<
"Generating new graph." << std::endl;
182 graph_type *graph = segment_manager->construct<graph_type>
184 (alloc_inst, MPI_COMM_WORLD, rmat, rmat.max_vertex_id(), hub_threshold);
189 std::cout <<
"Graph Ready, Calculating Stats. " << std::endl;
194 for (
int i = 0; i < mpi_size; i++) {
196 double percent = double(segment_manager->get_free_memory()) /
197 double(segment_manager->get_size());
198 std::cout <<
"[" << mpi_rank <<
"] " << segment_manager->get_free_memory()
199 <<
"/" << segment_manager->get_size() <<
" = " << percent << std::endl;
209 uint64_t max_degree(0);
211 max_degree = std::max(max_degree, graph->
degree(*citr));
219 std::cout <<
"Max Degree = " << global_max_degree << std::endl;
hmpi::delegate_partitioned_graph< segment_manager_t > graph_type
uint64_t degree(vertex_locator locator) const
Returns the degree of a vertex.
const communicator & world_comm() const
T mpi_all_reduce(T in_d, Op in_op, MPI_Comm mpi_comm)
controller_iterator controller_end() const
environment * havoqgt_env()
mapped_type::segment_manager segment_manager_type
segment_manager_type * get_segment_manager()
old_environment & get_environment()
controller_iterator controller_begin() const
void parse_cmd_line(int argc, char **argv, uint64_t &scale, uint64_t &delegate_threshold, std::string &output_filename)
void print_graph_statistics()
havoqgt::distributed_db::segment_manager_type segment_manager_t
void havoqgt_init(int *argc, char ***argv)