From 42f5768bf7a19bd089a645c028ec2c4d43644575 Mon Sep 17 00:00:00 2001 From: Aapo Kyrola Date: Mon, 30 Sep 2013 20:24:45 -0700 Subject: [PATCH 1/3] fixed some idiotic bugs by Chief Owl --- example_apps/contractionresearch.cpp | 56 ++++++++++---- .../graphchi_xcode.xcodeproj/project.pbxproj | 2 - src/util/graphgenerators.cpp | 76 +++++++++++++++++-- src/util/graphgenerators.h | 14 ---- 4 files changed, 113 insertions(+), 35 deletions(-) delete mode 100644 src/util/graphgenerators.h diff --git a/example_apps/contractionresearch.cpp b/example_apps/contractionresearch.cpp index 40fd1944..4d2b1bb8 100644 --- a/example_apps/contractionresearch.cpp +++ b/example_apps/contractionresearch.cpp @@ -44,24 +44,39 @@ struct Contractor : public GraphChiProgram { std::vector vertex_labels; std::vector vertex_labels_last; + std::vector coins; + std::string contraction_type; bool synchronous; - Contractor(bool synchronous) : synchronous(synchronous) {} + Contractor(bool synchronous, std::string contraction_type) : synchronous(synchronous), contraction_type(contraction_type) {} /** * Vertex update function. */ void update(graphchi_vertex &vertex, graphchi_context &gcontext) { - - vid_t min_label = vertex_labels[vertex.id()]; - - std::vector & nbr_labels = (synchronous ? vertex_labels_last : vertex_labels); - - /* Loop over all edges (ignore direction) */ - for(int i=0; i < vertex.num_edges(); i++) { - min_label = std::min(min_label, nbr_labels[vertex.edge(i)->vertex_id()]); + if (contraction_type == "mlp") { + vid_t min_label = vertex_labels[vertex.id()]; + + std::vector & nbr_labels = (synchronous ? vertex_labels_last : vertex_labels); + + /* Loop over all edges (ignore direction) */ + for(int i=0; i < vertex.num_edges(); i++) { + min_label = std::min(min_label, nbr_labels[vertex.edge(i)->vertex_id()]); + } + vertex_labels[vertex.id()] = min_label; + } else { + // tails collapse into heads + bool me_heads = coins[vertex.id()]; + if (!me_heads) { + /* Find first tail to collapse into */ + for(int j=0; jvertex_id()]) { + vertex_labels[vertex.id()] = vertex_labels[vertex.edge(j)->vertex_id()]; + return; + } + } + } } - vertex_labels[vertex.id()] = min_label; } void print() { @@ -76,6 +91,7 @@ struct Contractor : public GraphChiProgram { void before_iteration(int iteration, graphchi_context &gcontext) { if (iteration == 0) { // Initialize labels + vertex_labels.resize(gcontext.nvertices); for(vid_t v=0; v { print(); } - + if (contraction_type == "star") { + for(vid_t v=0; v { return n; } + bool contains_2() { + for(int i=0; i + #include #include #include #include +#include +#include +#include +int idcounter = 0; + +struct Node { + std::vector children; + int id; + + Node(int id) : id(id) {} + + void branch(int mydepth, int maxdepth, int d, int n) { + if (mydepth > maxdepth) return; + while (children.size() < d) { + children.push_back(new Node(idcounter++)); + } + for(int i=0; ibranch(mydepth + 1, maxdepth, d, n); + } + } + + void output(FILE * f) { + for(int i=0; iid); + children[i]->output(f); + } + } +}; + +struct Tree { + int d; + Node * root; + Tree(int d, int n) : d(d) { + int depth = (int) (1 + log(n)/log(d)); + std::cout << "depth=" << depth<< std::endl; + root = new Node(idcounter++); + root->branch(1, depth, d, n); + } + + void output(FILE * f) { + root->output(f); + } +}; int main(int argc, const char ** argv) { if (argc < 3) { @@ -107,5 +145,31 @@ int main(int argc, const char ** argv) { } } + if (type == "tree2") { + Tree t(2, n); + t.output(f); + } + + if (type == "tree3") { + Tree t(3, n); + t.output(f); + } + + if (type == "tree4") { + Tree t(4, n); + t.output(f); + } + + + if (type == "tree5") { + Tree t(5, n); + t.output(f); + } + + if (type == "tree50") { + Tree t(50, n); + t.output(f); + } + fclose(f); } \ No newline at end of file diff --git a/src/util/graphgenerators.h b/src/util/graphgenerators.h deleted file mode 100644 index 68aac623..00000000 --- a/src/util/graphgenerators.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// graphgenerators.h -// graphchi_xcode -// -// Created by Aapo Kyrola on 9/16/13. -// -// - -#ifndef __graphchi_xcode__graphgenerators__ -#define __graphchi_xcode__graphgenerators__ - -#include - -#endif /* defined(__graphchi_xcode__graphgenerators__) */ From 4d15fec3b8b39c501d9a3b057dd43d83db7fad2f Mon Sep 17 00:00:00 2001 From: Aapo Kyrola Date: Fri, 31 Jan 2014 17:08:40 -0800 Subject: [PATCH 2/3] implemented, but now with temporary labeling --- example_apps/cc_contraction.cpp | 416 ++++++++++++++++++ .../cc_contraction/cc_contraction.1 | 79 ++++ graphchi_xcode/cc_contraction/main.cpp | 18 + .../graphchi_xcode.xcodeproj/project.pbxproj | 135 ++++++ 4 files changed, 648 insertions(+) create mode 100644 example_apps/cc_contraction.cpp create mode 100644 graphchi_xcode/cc_contraction/cc_contraction.1 create mode 100644 graphchi_xcode/cc_contraction/main.cpp diff --git a/example_apps/cc_contraction.cpp b/example_apps/cc_contraction.cpp new file mode 100644 index 00000000..5e05a61f --- /dev/null +++ b/example_apps/cc_contraction.cpp @@ -0,0 +1,416 @@ + +/** + * @file + * @author Aapo Kyrola + * @version 1.0 + * + * @section LICENSE + * + * Copyright [2012] [Aapo Kyrola, Guy Blelloch, Carlos Guestrin / Carnegie Mellon University] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + + * + * @section DESCRIPTION + * Minimum spanning forest based on Boruvska steps. Also alternatively implementation using + * star contraction. Unfortunately, this code is quite optimized and hard to read. + * + * This application demonstrates how graph contraction algorithms can be implemented efficiently + * with GraphChi. + */ + +#define GRAPHCHI_DISABLE_COMPRESSION + +#include + +#include "graphchi_basic_includes.hpp" +#include "util/labelanalysis.hpp" + +using namespace graphchi; + + +enum ContractionType { + STAR = 1, BORUVSKA = 2 +}; + +ContractionType contractionType; + +#define MAX_VIDT 0xffffffff + +struct bidirectional_label { + vid_t smaller_component; + vid_t larger_component; + + bidirectional_label() { + smaller_component = larger_component = MAX_VIDT; + } + + bidirectional_label(int x) { + smaller_component = larger_component = MAX_VIDT; + } + + + vid_t neighbor_label(vid_t myid, vid_t nbid) { + vid_t label = (myid < nbid ? larger_component : smaller_component); + if (label == MAX_VIDT) label = nbid; // NOTE: important optimization (for random orders!) + return label; + } + + vid_t & my_label(vid_t myid, vid_t nbid) { + if (myid < nbid) { + return smaller_component; + } else { + return larger_component; + } + } + + bool labels_agree() { + return smaller_component == larger_component; + } + +}; + + +class AcceptMinimum : public DuplicateEdgeFilter { + bool acceptFirst(bidirectional_label &first, bidirectional_label &second) { + return (first.smaller_component < second.smaller_component); + } +}; + + +// Temporary solution +std::vector componentids; + + +/** + * Type definitions. Remember to create suitable graph shards using the + * Sharder-program. + */ +typedef vid_t VertexDataType; +typedef bidirectional_label EdgeDataType; + +void * gengine; + +size_t CONTRACTED_GRAPH_OUTPUT; +FILE * complog; + + + +template +struct BoruvskaStarContractionStep : public GraphChiProgram { + + // Hash parameters, always chosen randomly + uint64_t a, b; + size_t num_edges; + int num_contract, num_tails, num_heads, num_active_vertices; + + BoruvskaStarContractionStep() { + a = (uint64_t) std::rand(); + b = (uint64_t) std::rand(); + num_edges = 0; + num_contract = num_tails = num_heads = num_active_vertices = 0; + logstream(LOG_INFO) << "Chose random hash function: a = " << a << " b = " << b << std::endl; + + } + + bool heads(vid_t vertex_id) { + const long prime = 7907; // Courtesy of Wolfram alpha + return ((a * vertex_id + b) % prime) % 2 == 0; + } + + + /** + * Vertex update function. Note: we assume fresh edge values. + */ + void update(graphchi_vertex &vertex, graphchi_context &gcontext) { + + if (vertex.num_edges() == 0) { + return; + } + + if (gcontext.iteration == 0) { + num_active_vertices ++; + num_edges += vertex.num_inedges(); + + } + + if (contractionType == STAR) { + // Communicate label and check if want to contract + + // Tails collapse into Heads + bool meTails = !heads(vertex.id()); + vid_t my_id = vertex.id(); + if (meTails) { + assert(false); // not done properly yet + num_tails++; + // Find minimum edge with a heads + for(int i=0; i < vertex.num_edges(); i++) { + graphchi_edge * e = vertex.edge(i); + if (heads(e->vertex_id())) { + my_id = e->vertex_id(); + num_contract++; + break; + } + } + } else { + num_heads++; + } + + // Write my label + for(int i=0; i < vertex.num_edges(); i++) { + graphchi_edge * e = vertex.edge(i); + EdgeDataType edata = e->get_data(); + edata.my_label(vertex.id(), e->vertex_id()) = my_id; + e->set_data(edata); + } + } + + if (contractionType == BORUVSKA) { + /* Get my component id. It is the minimum label of a neighbor via a mst edge (or my own id) */ + vid_t min_component_id = vertex.id(); + for(int i=0; i < vertex.num_edges(); i++) { + graphchi_edge * e = vertex.edge(i); + min_component_id = std::min( + std::min(e->get_data().neighbor_label(vertex.id(), e->vertex_id()), e->vertex_id()), min_component_id); + } + + + componentids[vertex.id()] = min_component_id; + + /* Set component ids and schedule neighbors */ + for(int i=0; i < vertex.num_edges(); i++) { + graphchi_edge * e = vertex.edge(i); + EdgeDataType edata = e->get_data(); + + if (edata.my_label(vertex.id(), e->vertex_id()) != min_component_id) { + edata.my_label(vertex.id(), e->vertex_id()) = min_component_id; + e->set_data(edata); + + } + } + } + } + + /** + * Called before an iteration starts. + */ + void before_iteration(int iteration, graphchi_context &gcontext) { + logstream(LOG_INFO) << "Start iteration " << iteration << ", scheduled tasks=" << gcontext.scheduler->num_tasks() << std::endl; + } + + void after_iteration(int iteration, graphchi_context &gcontext) { + logstream(LOG_INFO) << "To contract: " << num_contract << ", tails=" << num_tails << " heads=" << num_heads << + " active=" << num_active_vertices << std::endl; + if (iteration == 1) { + fprintf(complog, "%d,%d,%ld\n", num_contract, num_active_vertices, num_edges); + } + } + void before_exec_interval(vid_t window_st, vid_t window_en, graphchi_context &gcontext) {} + void after_exec_interval(vid_t window_st, vid_t window_en, graphchi_context &gcontext) {} + +}; + + + mutex lock; + +/** + * Update function that writes the contracted graph for next iteration and + * outputs also the minimum spanning edges. + */ +template +struct ContractionStep : public GraphChiProgram { + + bool new_edges; + + ContractionStep() { + new_edges = false; + } + + + void emit(vid_t from, vid_t to, vid_t a, vid_t b, bidirectional_label &edata) { + // terrible... + sharded_graph_output * out = (sharded_graph_output *)((graphchi_engine *)gengine)->output(CONTRACTED_GRAPH_OUTPUT); + out->output_edgeval(a, b, edata); + } + + /** + * Vertex update function. Note: we assume fresh edge values. + */ + void update(graphchi_vertex &vertex, graphchi_context &gcontext) { + + if (vertex.num_inedges() == 0) { + return; + } + + // Loop over only in-edges + for(int i=0; i < vertex.num_inedges(); i++) { + graphchi_edge * e = vertex.inedge(i); + + EdgeDataType edata = e->get_data(); + + + vid_t a = edata.my_label(vertex.id(), e->vertex_id()); + vid_t b = edata.neighbor_label(vertex.id(), e->vertex_id()); + + if (edata.labels_agree()) { + // Do nothing + } else if (!edata.labels_agree()) { + // Output the contracted edge + + + edata.smaller_component = MAX_VIDT; + edata.larger_component = MAX_VIDT; + + new_edges = true; + emit(vertex.id(), e->vertex_id(), std::min(a, b), std::max(a, b), + edata); + } else { + // Otherwise: discard the edge + } + } + } + + /** + * Called before an iteration starts. + */ + void before_iteration(int iteration, graphchi_context &gcontext) { + logstream(LOG_INFO) << "Contraction: Start iteration " << iteration << std::endl; + } + + void after_iteration(int iteration, graphchi_context &gcontext) { + } + void before_exec_interval(vid_t window_st, vid_t window_en, graphchi_context &gcontext) {} + void after_exec_interval(vid_t window_st, vid_t window_en, graphchi_context &gcontext) {} + +}; + + + + +int main(int argc, const char ** argv) { + /* GraphChi initialization will read the command line + arguments and the configuration file. */ + graphchi_init(argc, argv); + + /* Metrics object for keeping track of performance counters + and other information. Currently required. */ + metrics m("cc-contraction"); + m.start_time("cc-contraction-total-runtime"); + + /* Basic arguments for application */ + std::string filename = get_option_string("file"); // Base filename + std::string origfilename = filename; + bool scheduler = false; // Whether to use selective scheduling + + /* Detect the number of shards or preprocess an input to create them */ + int nshards = get_option_int("nshards", 0); + delete_shards(filename, nshards); + + convert_if_notexists(filename, get_option_string("nshards", "0")); + + contractionType = get_option_string("algo", "boruvska") == "boruvska" ? BORUVSKA : STAR; + + if (contractionType == BORUVSKA) { + complog = fopen("cclog_boruvska.txt", "w"); + } else { + complog = fopen("ccflog_star.txt", "w"); + + } + + + /* NOTE: because of optimizing the first iteration data size, this is a terrible mess */ + for(int super_iteration=0; super_iteration < 100; super_iteration++) { + logstream(LOG_INFO) << "CC ITERATION " << super_iteration << " contraction: " << contractionType << std::endl; + + BoruvskaStarContractionStep boruvska_starcontraction; + graphchi_engine engine(filename, nshards, scheduler, m); + engine.set_disable_vertexdata_storage(); + gengine = &engine; + engine.set_save_edgesfiles_after_inmemmode(true); + engine.set_modifies_inedges(true); + engine.set_modifies_outedges(true); + engine.set_disable_outedges(false); + + if (super_iteration == 0) { + componentids.resize(engine.num_vertices()); + } + + engine.run(boruvska_starcontraction, 2); // hack + + /* Step 2: Run contraction */ + /* Initialize output */ + + int orig_numshards = (int) engine.get_intervals().size(); + std::string contractedname = filename + "C"; + sharded_graph_output shardedout(contractedname, new AcceptMinimum()); + CONTRACTED_GRAPH_OUTPUT = engine.add_output(&shardedout); + + ContractionStep contraction; + engine.set_disable_vertexdata_storage(); + engine.set_modifies_inedges(false); + engine.set_modifies_outedges(false); + engine.set_disable_outedges(true); + engine.set_save_edgesfiles_after_inmemmode(true); + engine.run(contraction, 1); + + // Clean up + if (super_iteration > 0) + delete_shards(filename, orig_numshards); + + + if (contraction.new_edges == false) { + logstream(LOG_INFO) << "CC ready!" << std::endl; + break; + } + + nshards = (int)shardedout.finish_sharding(); + filename = contractedname; + } + m.stop_time("cc-contraction-total-runtime"); + + logstream(LOG_INFO) << "Final component labeling..." << std::endl; + + bool changes = true; + while(changes) { + changes = false; + std::cout << "..." << std::endl; + for(int j=0; j(origfilename); + + + FILE * f = fopen(outputfile.c_str(), "w"); + fwrite(&componentids[0], sizeof(vid_t), componentids.size(), f); + fclose(f); + + /* Analyze */ + analyze_labels(origfilename); + + + /* Report execution metrics */ + metrics_report(m); + fclose(complog); + return 0; +} \ No newline at end of file diff --git a/graphchi_xcode/cc_contraction/cc_contraction.1 b/graphchi_xcode/cc_contraction/cc_contraction.1 new file mode 100644 index 00000000..123bf67b --- /dev/null +++ b/graphchi_xcode/cc_contraction/cc_contraction.1 @@ -0,0 +1,79 @@ +.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. +.\"See Also: +.\"man mdoc.samples for a complete listing of options +.\"man mdoc for the short list of editing options +.\"/usr/share/misc/mdoc.template +.Dd 1/31/14 \" DATE +.Dt cc_contraction 1 \" Program name and manual section number +.Os Darwin +.Sh NAME \" Section Header - required - don't modify +.Nm cc_contraction, +.\" The following lines are read in generating the apropos(man -k) database. Use only key +.\" words here as the database is built based on the words here and in the .ND line. +.Nm Other_name_for_same_program(), +.Nm Yet another name for the same program. +.\" Use .Nm macro to designate other names for the documented program. +.Nd This line parsed for whatis database. +.Sh SYNOPSIS \" Section Header - required - don't modify +.Nm +.Op Fl abcd \" [-abcd] +.Op Fl a Ar path \" [-a path] +.Op Ar file \" [file] +.Op Ar \" [file ...] +.Ar arg0 \" Underlined argument - use .Ar anywhere to underline +arg2 ... \" Arguments +.Sh DESCRIPTION \" Section Header - required - don't modify +Use the .Nm macro to refer to your program throughout the man page like such: +.Nm +Underlining is accomplished with the .Ar macro like this: +.Ar underlined text . +.Pp \" Inserts a space +A list of items with descriptions: +.Bl -tag -width -indent \" Begins a tagged list +.It item a \" Each item preceded by .It macro +Description of item a +.It item b +Description of item b +.El \" Ends the list +.Pp +A list of flags and their descriptions: +.Bl -tag -width -indent \" Differs from above in tag removed +.It Fl a \"-a flag as a list item +Description of -a flag +.It Fl b +Description of -b flag +.El \" Ends the list +.Pp +.\" .Sh ENVIRONMENT \" May not be needed +.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 +.\" .It Ev ENV_VAR_1 +.\" Description of ENV_VAR_1 +.\" .It Ev ENV_VAR_2 +.\" Description of ENV_VAR_2 +.\" .El +.Sh FILES \" File used or created by the topic of the man page +.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact +.It Pa /usr/share/file_name +FILE_1 description +.It Pa /Users/joeuser/Library/really_long_file_name +FILE_2 description +.El \" Ends the list +.\" .Sh DIAGNOSTICS \" May not be needed +.\" .Bl -diag +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .El +.Sh SEE ALSO +.\" List links in ascending order by section, alphabetically within a section. +.\" Please do not reference files that do not exist without filing a bug report +.Xr a 1 , +.Xr b 1 , +.Xr c 1 , +.Xr a 2 , +.Xr b 2 , +.Xr a 3 , +.Xr b 3 +.\" .Sh BUGS \" Document known, unremedied bugs +.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file diff --git a/graphchi_xcode/cc_contraction/main.cpp b/graphchi_xcode/cc_contraction/main.cpp new file mode 100644 index 00000000..e10f0aec --- /dev/null +++ b/graphchi_xcode/cc_contraction/main.cpp @@ -0,0 +1,18 @@ +// +// main.cpp +// cc_contraction +// +// Created by Aapo Kyrola on 1/31/14. +// +// + +#include + +int main(int argc, const char * argv[]) +{ + + // insert code here... + std::cout << "Hello, World!\n"; + return 0; +} + diff --git a/graphchi_xcode/graphchi_xcode.xcodeproj/project.pbxproj b/graphchi_xcode/graphchi_xcode.xcodeproj/project.pbxproj index 5d4b8c65..6f7ca4a7 100644 --- a/graphchi_xcode/graphchi_xcode.xcodeproj/project.pbxproj +++ b/graphchi_xcode/graphchi_xcode.xcodeproj/project.pbxproj @@ -9,6 +9,8 @@ /* Begin PBXBuildFile section */ 5F0A1FCF16AB3E4E0066FB56 /* test_dynamicedata_loader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5F0A1FCD16AB3E4E0066FB56 /* test_dynamicedata_loader.cpp */; }; 5F10740318242CD3003DC44E /* pagerank.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5FCC1EC01599F59A0003D0E9 /* pagerank.cpp */; }; + 5F36B4B4189C199E006CA08D /* cc_contraction.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5F36B4B3189C199E006CA08D /* cc_contraction.1 */; }; + 5F36B4BA189C19C6006CA08D /* cc_contraction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5F36B4B8189C19C6006CA08D /* cc_contraction.cpp */; }; 5F56F71D159B78D300423ECE /* bulksync_functional_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5F56F703159B771900423ECE /* bulksync_functional_test.cpp */; }; 5F648EE617B82B9900EFEE76 /* stronglyconnectedcomponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5F648EDE17B80D7800EFEE76 /* stronglyconnectedcomponents.cpp */; }; 5F684D0717F3656700E1FA0A /* contractionresearch.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5F684D0617F3656700E1FA0A /* contractionresearch.1 */; }; @@ -24,6 +26,16 @@ /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ + 5F36B4AD189C199E006CA08D /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + 5F36B4B4189C199E006CA08D /* cc_contraction.1 in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 1; + }; 5F54B84D15FD4D9F00B3842C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -243,6 +255,11 @@ 5F359BF615955CD100AF7672 /* functional_bulksync.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = functional_bulksync.hpp; sourceTree = ""; }; 5F359BF715955D1B00AF7672 /* functional_defs.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = functional_defs.hpp; sourceTree = ""; }; 5F359BF81596B76200AF7672 /* graphchi_program.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = graphchi_program.hpp; sourceTree = ""; }; + 5F36B4AA189C18E5006CA08D /* contractionresearch.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = contractionresearch.cpp; sourceTree = ""; }; + 5F36B4AF189C199E006CA08D /* cc_contraction */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = cc_contraction; sourceTree = BUILT_PRODUCTS_DIR; }; + 5F36B4B1189C199E006CA08D /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; + 5F36B4B3189C199E006CA08D /* cc_contraction.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = cc_contraction.1; sourceTree = ""; }; + 5F36B4B8189C19C6006CA08D /* cc_contraction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cc_contraction.cpp; sourceTree = ""; }; 5F3B0889158AC5520058A8B1 /* graphchi_engine.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = graphchi_engine.hpp; sourceTree = ""; }; 5F41F79717B0068800C5FD90 /* atomic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic.hpp; sourceTree = ""; }; 5F41F79817B0068800C5FD90 /* binary_minheap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = binary_minheap.hpp; sourceTree = ""; }; @@ -445,6 +462,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 5F36B4AC189C199E006CA08D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 5F54B84C15FD4D9F00B3842C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -567,6 +591,7 @@ 5F74B03515D349EF00ED3EA9 /* graphlab_toolkit_ports */, 5F7A0FE31589162F00748D0D /* src */, 5F684D0317F3656700E1FA0A /* contractionresearch */, + 5F36B4B0189C199E006CA08D /* cc_contraction */, 5F7A0FFC1589163E00748D0D /* Products */, ); name = graphchi_xcode; @@ -730,6 +755,15 @@ path = functional; sourceTree = ""; }; + 5F36B4B0189C199E006CA08D /* cc_contraction */ = { + isa = PBXGroup; + children = ( + 5F36B4B1189C199E006CA08D /* main.cpp */, + 5F36B4B3189C199E006CA08D /* cc_contraction.1 */, + ); + path = cc_contraction; + sourceTree = ""; + }; 5F41F79617B0068800C5FD90 /* util */ = { isa = PBXGroup; children = ( @@ -870,6 +904,7 @@ 5FA2B40B16E8EF58005B2F53 /* jinlianglda */, 5F648EEC17B82B9900EFEE76 /* SCC */, 5F684D0217F3656700E1FA0A /* contractionresearch */, + 5F36B4AF189C199E006CA08D /* cc_contraction */, ); name = Products; sourceTree = ""; @@ -1157,10 +1192,12 @@ 5FCC1EBC1599F59A0003D0E9 /* example_apps */ = { isa = PBXGroup; children = ( + 5F36B4B8189C19C6006CA08D /* cc_contraction.cpp */, 5FCC1EC8159A03D50003D0E9 /* matrix_factorization */, 5FCC1EBD1599F59A0003D0E9 /* application_template.cpp */, 5FCC1EBE1599F59A0003D0E9 /* communitydetection.cpp */, 5FCC1EBF1599F59A0003D0E9 /* connectedcomponents.cpp */, + 5F36B4AA189C18E5006CA08D /* contractionresearch.cpp */, 5F67653F16AF2EAF00359562 /* inmemconncomps.cpp */, 5FF774DD17B3E94100F84939 /* minimumspanningforest.cpp */, 5FCC1EC01599F59A0003D0E9 /* pagerank.cpp */, @@ -1220,6 +1257,23 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 5F36B4AE189C199E006CA08D /* cc_contraction */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5F36B4B5189C199E006CA08D /* Build configuration list for PBXNativeTarget "cc_contraction" */; + buildPhases = ( + 5F36B4AB189C199E006CA08D /* Sources */, + 5F36B4AC189C199E006CA08D /* Frameworks */, + 5F36B4AD189C199E006CA08D /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = cc_contraction; + productName = cc_contraction; + productReference = 5F36B4AF189C199E006CA08D /* cc_contraction */; + productType = "com.apple.product-type.tool"; + }; 5F54B84915FD4D9F00B3842C /* test_dynamicedata */ = { isa = PBXNativeTarget; buildConfigurationList = 5F54B84E15FD4D9F00B3842C /* Build configuration list for PBXNativeTarget "test_dynamicedata" */; @@ -1537,11 +1591,20 @@ 5FA2B40316E8EF58005B2F53 /* jinlianglda */, 5F648EE317B82B9900EFEE76 /* SCC */, 5F684D0117F3656700E1FA0A /* contractionresearch */, + 5F36B4AE189C199E006CA08D /* cc_contraction */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ + 5F36B4AB189C199E006CA08D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5F36B4BA189C19C6006CA08D /* cc_contraction.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 5F54B84A15FD4D9F00B3842C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1756,6 +1819,70 @@ }; name = Release; }; + 5F36B4B6189C199E006CA08D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + 5F36B4B7189C199E006CA08D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Release; + }; 5F54B84F15FD4D9F00B3842C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2323,6 +2450,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 5F36B4B5189C199E006CA08D /* Build configuration list for PBXNativeTarget "cc_contraction" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5F36B4B6189C199E006CA08D /* Debug */, + 5F36B4B7189C199E006CA08D /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 5F54B84E15FD4D9F00B3842C /* Build configuration list for PBXNativeTarget "test_dynamicedata" */ = { isa = XCConfigurationList; buildConfigurations = ( From 1ee44f909d674df1f124231f12c3bf460963c811 Mon Sep 17 00:00:00 2001 From: Aapo Kyrola Date: Mon, 3 Feb 2014 15:00:09 -0500 Subject: [PATCH 3/3] added --- example_apps/cc_contraction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example_apps/cc_contraction.cpp b/example_apps/cc_contraction.cpp index 5e05a61f..1793aef9 100644 --- a/example_apps/cc_contraction.cpp +++ b/example_apps/cc_contraction.cpp @@ -211,7 +211,7 @@ struct BoruvskaStarContractionStep : public GraphChiProgram