int main(int argc, char** argv) {
  Galois::StatManager statManager;
  LonestarStart(argc, argv, name, desc, url);

  Galois::StatTimer Tinitial("InitializeTime");
  Tinitial.start();
  graph.structureFromFile(inputFilename.c_str());
  std::cout << "Num nodes: " << graph.size() << "\n";
  Tinitial.stop();

  //Galois::preAlloc(numThreads);
  Galois::Statistic("MeminfoPre", GaloisRuntime::MM::pageAllocInfo());
  switch (algo) {
    case demo: run<DemoAlgo>(); break;
    case asynchronous: run<AsynchronousAlgo>(); break;
    default: std::cerr << "Unknown algo: " << algo << "\n";
  }
  Galois::Statistic("MeminfoPost", GaloisRuntime::MM::pageAllocInfo());

  if (!skipVerify && !verify()) {
    std::cerr << "verification failed\n";
    assert(0 && "verification failed");
    abort();
  }

  return 0;
}
Exemple #2
0
/***********************************************************
 * MAIN
 **********************************************************/
int main(int argc, char *argv[]) {
	Galois::StatManager M;
	LonestarStart(argc, argv, "Ray Tracing");

	std::cerr << std::fixed;
	std::cerr.width(2);
	std::cerr.precision(2);
	//std::cerr << std::endl;

	/*std::cerr	<< "configuration: "
					<< config.w << "x" << config.h
					<< " (" << config.spp << " spp)"
					<< std::endl << std::endl;

	std::cout << "Num. of threads: " << numThreads << std::endl;*/
	

	Galois::StatTimer T("Total");
	T.start();
	Scene scene(config);
	scene.raytrace();
	scene.save();
	T.stop();

	std::cerr << std::endl << std::endl;
}
int main(int argc, char** argv) {
  Galois::StatManager M;
  bool serial = false;
  LonestarStart(argc, argv, name, desc, url);

  initializeGraph(filename, sourceId, sinkId, &app);
  if (relabelInt == 0) {
    app.global_relabel_interval = app.graph.size() * ALPHA + app.graph.sizeEdges() / 3;
  } else {
    app.global_relabel_interval = relabelInt;
  }
  std::cout << "number of nodes: " << app.graph.size() << "\n";
  std::cout << "global relabel interval: " << app.global_relabel_interval << "\n";
  std::cout << "serial execution: " << (serial ? "yes" : "no") << "\n";

  Galois::StatTimer T;
  T.start();
  run();
  T.stop();

  std::cout << "Flow is " << app.graph.getData(app.sink).excess << "\n";
  
  if (!skipVerify) {
    Config orig;
    initializeGraph(filename, sourceId, sinkId, &orig);
    verify(orig);
    std::cout << "(Partially) Verified\n";
  }

  return 0;
}
Exemple #4
0
int main(int argc, char** argv) {
  LonestarStart(argc, argv, name, desc, url);

	srand(-1);
	MetisGraph metisGraph;
	GGraph graph;
	metisGraph.setGraph(&graph);
	bool directed = true;
	if(mtxInput){
	  readMetisGraph(&metisGraph, filename.c_str());
	}else{
	  readGraph(&metisGraph, filename.c_str(), weighted, directed);
	}
	partition(&metisGraph, numPartitions);
	verify(&metisGraph);
}
int main(int argc, char **argv) {
  LonestarStart(argc, argv, name, desc, url);
  Galois::StatManager statManager;

  outOnly = outOnlyP;

  Galois::StatTimer T("TotalTime");
  T.start();
  switch (algo) {
  case Algo::sync_coord: run<Sync<true>>(); break;
  case Algo::sync_aut: run<Sync<false>>(); break;
    case Algo::async: run<AsyncSet>(); break;
    case Algo::async_rsd: run<AsyncRsd>(); break;
    case Algo::async_prt: run<AsyncPri>(); break;
    case Algo::async_prs: run<AsyncPriSet>(); break;
    case Algo::async_edge: run<AsyncEdge>(); break;
    case Algo::async_edge_prs:run<AsyncEdgePriSet>(); break;
    case Algo::async_ppr_rsd: runPPR<PPRAsyncRsd>(); break;
    default: std::cerr << "Unknown algorithm\n"; abort();
  }
  T.stop();

  return 0;
}
Exemple #6
0
int main(int argc, char** argv) {

  

  Galois::StatManager statManager;
  LonestarStart(argc, argv, name, desc, url);

  Galois::StatTimer Tinitial("InitializeTime");
  Tinitial.start();

  SymbolicGraph graph;
  Graph outgraph;

  // Load input graph. Read to an LC_Graph and then convert to a
  // FirstGraph. (based on makeGraph from Boruvka.)
  
  double** matrix2;
  double* rhs;
  int matrix_size2 = 15000; 
  double l_boundary_condition = -100; 
  double r_boundary_condition = 100; 
  
  get_matrix_and_rhs(matrix_size2, &matrix2, &rhs, l_boundary_condition, r_boundary_condition);
  /*
  for(int i = 0; i<matrix_size2; i++){
	for(int j = 0; j<matrix_size2; j++){
		
		printf("%lf ", matrix2[i][j]);
	} 
	
	printf(" | %lf\n", rhs[i]); 
  }
  */
  
  
  clock_t t_start = clock();
  makeGraph(graph,matrix2,matrix_size2); 
  //makeGraph(graph, inputFilename.c_str());
  nodecount = graph.size();
  std::cout << "Num nodes: " << nodecount << "\n";

  // Verify IDs assigned to each node
  {
    unsigned int i = 0;
    for (SymbolicGraph::iterator ii = graph.begin(), ei = graph.end();
         ii != ei; ++ii) {
      Node& data = graph.getData(*ii);
      assert(data.id == i++);
      assert(!data.seen);
    }
    assert(i == nodecount);
  }

  // Initialize dependency ordering
  depgraph = new DepItem[nodecount];
  assert(depgraph);

  Tinitial.stop();

  //Galois::preAlloc(numThreads);
  Galois::reportPageAlloc("MeminfoPre");

  // First run the symbolic factorization
  std::cout << "Symbolic factorization\n";
  run(SymbolicAlgo<SymbolicGraph,Graph>(graph, outgraph), "SymbolicTime");

  // Clear the seen flags for the numeric factorization.
  for (SymbolicGraph::iterator ii = graph.begin(), ei = graph.end();
       ii != ei; ++ii) {
    Node& data = graph.getData(*ii);
    assert(data.seen);
    data.seen = false;
  }

  // We should now have built a directed graph (outgraph) and total
  // ordering. Now run the numeric factorization.
  //
  // FIXME: Convert back to a LC_Graph?
  std::cout << "Numeric factorization\n";
  run(NumericAlgo<Graph>(outgraph), "NumericTime");

  Galois::reportPageAlloc("MeminfoPost");

  if (!skipVerify && !verify(outgraph)) {
    std::cerr << "verification failed\n";
    assert(0 && "verification failed");
    abort();
  }
  
  get_solution_from_graph(outgraph, rhs);
  
  printf("\nTime taken: %.4fs\n", (float)(clock() - t_start)/CLOCKS_PER_SEC);
  return 0;
}
int main(int argc, char** argv) {
    Galois::StatManager M;
    LonestarStart(argc, argv, name, desc, url);

    Graph g;
    G = &g;

    G->structureFromFile(filename.c_str());

    NumNodes = G->size();

#if SHARE_SINGLE_BC
    std::vector<cache_line_storage<BCrecord> > cb(NumNodes);
    CB = &cb;
#else
    Galois::GVectorElementAccumulator<std::vector<double> > cb;
    CB = &cb;
#endif

    initGraphData();

    int iterations = NumNodes;
    if (iterLimit)
        iterations = iterLimit;

    boost::filter_iterator<HasOut,Graph::iterator>
    begin = boost::make_filter_iterator(HasOut(G), g.begin(), g.end()),
    end = boost::make_filter_iterator(HasOut(G), g.end(), g.end());

    iterations = std::min((int) std::distance(begin, end), iterations);

    std::cout
            << "NumNodes: " << NumNodes
            << " Iterations: " << iterations << "\n";

    end = begin;
    std::advance(end, iterations);
    std::vector<GNode> tmp;
    std::copy(begin, end, std::back_inserter(tmp));

    typedef GaloisRuntime::WorkList::dChunkedLIFO<1> WL;
    Galois::StatTimer T;
    T.start();
    Galois::for_each<WL>(tmp.begin(), tmp.end(), process());
    T.stop();

    if (forceVerify || !skipVerify) {
        verify();
    } else { // print bc value for first 10 nodes
#if SHARE_SINGLE_BC
#else
        const std::vector<double>& bcv = CB->reduce();
#endif
        for (int i=0; i<10; ++i)
#if SHARE_SINGLE_BC
            std::cout << i << ": " << setiosflags(std::ios::fixed) << std::setprecision(6) << (*CB)[i].data.bc << "\n";
#else
            std::cout << i << ": " << setiosflags(std::ios::fixed) << std::setprecision(6) << bcv[i] << "\n";
#endif
#if SHOULD_PRODUCE_CERTIFICATE
        printBCcertificate();
#endif
    }
    std::cerr << "Application done...\n";

    Galois::StatTimer tt("cleanup");
    tt.start();
    cleanupData();
    tt.stop();

    return 0;
}
int main(int argc, char** argv) {
  Galois::StatManager statManager;
  LonestarStart(argc, argv, name, desc, url);

  Galois::StatTimer Tinitial("InitializeTime");
  Tinitial.start();

  // Load filled graph with edge data
  Galois::Graph::readGraph(graph, inputFilename.c_str());
  std::cout << "Num nodes: " << graph.size() << "\n";

  // Assign IDs to each node
  {
    unsigned int n = graph.size(), i = 0;
    for (Graph::iterator ii = graph.begin(), ei = graph.end(); ii != ei; ++ii) {
      Node& data = graph.getData(*ii);
      data.id = i++;
      assert(!data.seen);
    }
    assert(i == n);

    // Load dependence ordering
    depgraph = new DepItem[n];
    assert(depgraph);
    std::ifstream depfile(depFilename.c_str());
    i = 0;
    while (depfile) {
      unsigned int node;
      depfile >> node;
      if ( !depfile ) break;
      assert(node < n);
      if ( i < 0 || i >= n ) {
        std::cout << "Error loading dependencies.\n";
        abort();
      }
      depgraph[i] = node;
      i++;
    }
    assert(i == n);
    depfile.close();
  }

  Tinitial.stop();

  //Galois::preAlloc(numThreads);
  Galois::reportPageAlloc("MeminfoPre");

  switch (algo) {
    case demo: run<DemoAlgo>(); break;
    //case asynchronous: run<AsynchronousAlgo>(); break;
    default: std::cerr << "Unknown algo: " << algo << "\n";
  }
  Galois::reportPageAlloc("MeminfoPost");

  if (!skipVerify && !verify()) {
    std::cerr << "verification failed\n";
    assert(0 && "verification failed");
    abort();
  }

  return 0;
}