From 1e147b3af160fee8d93753a7f37031c6fbeafd9d Mon Sep 17 00:00:00 2001 From: Chris Groer Date: Fri, 30 Aug 2013 09:27:51 -0400 Subject: [PATCH 01/12] CSG adding lots of changes to add complement and make it compliant. Some utilities are far from compiling on MSVC --- MSVC/INDDGO.sln | 12 ++ MSVC/INDDGO.suo | Bin 51712 -> 61440 bytes MSVC/complement/complement.vcxproj | 88 +++++++++++ MSVC/complement/complement.vcxproj.filters | 22 +++ MSVC/lib_graphd/lib_graphd.vcxproj | 12 +- MSVC/lib_graphd/lib_graphd.vcxproj.filters | 32 +--- lib_graphd/inc/Graph.h | 31 +++- lib_graphd/inc/GraphReader.h | 2 + lib_graphd/inc/GraphWriter.h | 2 + lib_graphd/src/Graph.cpp | 8 +- lib_graphd/src/GraphCreator.cpp | 19 ++- lib_graphd/src/GraphProperties.cpp | 44 ++++-- lib_graphd/src/GraphReader.cpp | 6 +- lib_graphd/src/GraphUtil.cpp | 9 +- lib_graphd/src/GraphWriter.cpp | 1 - make.inc | 6 - util/Makefile | 161 +++++++++++---------- util/src/complement.cpp | 66 +++++++++ util/src/count-tri.cpp | 12 ++ util/src/gconvert.cpp | 8 +- util/src/gen_pkt.cpp | 10 +- util/src/graph_stats.cpp | 9 ++ util/src/orbtimer.cpp | 10 ++ 23 files changed, 410 insertions(+), 160 deletions(-) create mode 100755 MSVC/complement/complement.vcxproj create mode 100755 MSVC/complement/complement.vcxproj.filters delete mode 100644 make.inc mode change 100644 => 100755 util/Makefile create mode 100755 util/src/complement.cpp diff --git a/MSVC/INDDGO.sln b/MSVC/INDDGO.sln index 0567014..8557204 100755 --- a/MSVC/INDDGO.sln +++ b/MSVC/INDDGO.sln @@ -11,6 +11,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "serial_wis", "serial_wis\se {E88CD5F0-B70E-4504-B83B-393FC3FC12BD} = {E88CD5F0-B70E-4504-B83B-393FC3FC12BD} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gen_pkt", "gen_pkt\gen_pkt.vcxproj", "{F0C0ECD8-3A00-4D40-8A06-62938979C5A6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complement", "complement\complement.vcxproj", "{E8670ED1-EA47-4A7F-858E-2781A04901C3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -29,6 +33,14 @@ Global {F0033BB8-C99B-4696-9350-F6B97850C220}.Debug|Win32.Build.0 = Debug|Win32 {F0033BB8-C99B-4696-9350-F6B97850C220}.Release|Win32.ActiveCfg = Release|Win32 {F0033BB8-C99B-4696-9350-F6B97850C220}.Release|Win32.Build.0 = Release|Win32 + {F0C0ECD8-3A00-4D40-8A06-62938979C5A6}.Debug|Win32.ActiveCfg = Debug|Win32 + {F0C0ECD8-3A00-4D40-8A06-62938979C5A6}.Debug|Win32.Build.0 = Debug|Win32 + {F0C0ECD8-3A00-4D40-8A06-62938979C5A6}.Release|Win32.ActiveCfg = Release|Win32 + {F0C0ECD8-3A00-4D40-8A06-62938979C5A6}.Release|Win32.Build.0 = Release|Win32 + {E8670ED1-EA47-4A7F-858E-2781A04901C3}.Debug|Win32.ActiveCfg = Debug|Win32 + {E8670ED1-EA47-4A7F-858E-2781A04901C3}.Debug|Win32.Build.0 = Debug|Win32 + {E8670ED1-EA47-4A7F-858E-2781A04901C3}.Release|Win32.ActiveCfg = Release|Win32 + {E8670ED1-EA47-4A7F-858E-2781A04901C3}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MSVC/INDDGO.suo b/MSVC/INDDGO.suo index 1ea168820bb6d0d09c1999f95c08dbbe8dac294f..e343eda17ee69e5d4fec1eec4fe7d46e21508f64 100755 GIT binary patch delta 5578 zcmcIodr+L!75^?Qj|D=O*Jg=HSdcW~vADp70C_Fh1@bTg0Wrb`Saz3XlVuloKk^^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&{ z_R`tEeZV6pW6A7;nC;x;OUn~IK>?98gJ%byp@L%4fXl@^^uf6F$q~7F?m33jE~+Gy z#dP?{@>TYf5FTA!ZRfS%*i#n6PXM9 zh7Yn@`Rn0A2Fs4)7~LKTl}F>PIApRb7gz3#-}=N$S6{nc-2Qe{KYc{|`hy0`PQ%G@ za?nCWM_m)eda?Mt4Y}{8iM0JMq3T*8-W$zA(>2?@Z|}SvYImeO=6;evvA+mAD`IhR zb^z0#-1zSco*3MBZ<&(UL&a1*!Y*OG;C|rs3KB*su>ysk;+jePf930U#VBNc diff --git a/MSVC/complement/complement.vcxproj b/MSVC/complement/complement.vcxproj new file mode 100755 index 0000000..8e7878f --- /dev/null +++ b/MSVC/complement/complement.vcxproj @@ -0,0 +1,88 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + {E8670ED1-EA47-4A7F-858E-2781A04901C3} + Win32Proj + metis502 + + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + HAS_GMP;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.5/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) + + + Console + true + ../$(Configuration);../../../mpir-2.5.2/build.vc10/Win32/$(Configuration) + lib_graphd.lib;lib_treed.lib;mpir.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.7/;../../lib_graphd/inc/;../../lib_treed/inc/; + + + Console + true + true + true + ../$(Configuration);../../../mpir-2.5.2/build.vc10/Win32/$(Configuration) + lib_graphd.lib;lib_treed.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/MSVC/complement/complement.vcxproj.filters b/MSVC/complement/complement.vcxproj.filters new file mode 100755 index 0000000..9c847d0 --- /dev/null +++ b/MSVC/complement/complement.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/MSVC/lib_graphd/lib_graphd.vcxproj b/MSVC/lib_graphd/lib_graphd.vcxproj index 4c45626..b395727 100755 --- a/MSVC/lib_graphd/lib_graphd.vcxproj +++ b/MSVC/lib_graphd/lib_graphd.vcxproj @@ -11,11 +11,7 @@ - - - - @@ -23,19 +19,13 @@ - - - - - - - + {BFE092BE-DF45-44F1-B013-A98820441A40} diff --git a/MSVC/lib_graphd/lib_graphd.vcxproj.filters b/MSVC/lib_graphd/lib_graphd.vcxproj.filters index 54e063c..acec539 100755 --- a/MSVC/lib_graphd/lib_graphd.vcxproj.filters +++ b/MSVC/lib_graphd/lib_graphd.vcxproj.filters @@ -15,21 +15,9 @@ - - Source Files - - - Source Files - Source Files - - Source Files - - - Source Files - Source Files @@ -51,30 +39,15 @@ Source Files - - Source Files - Source Files - - Source Files - Source Files Source Files - - Source Files - - - Source Files - - - Source Files - Source Files @@ -84,10 +57,7 @@ Source Files - - Source Files - - + Source Files diff --git a/lib_graphd/inc/Graph.h b/lib_graphd/inc/Graph.h index c259e99..1e4727b 100644 --- a/lib_graphd/inc/Graph.h +++ b/lib_graphd/inc/Graph.h @@ -22,13 +22,30 @@ #ifndef GRAPH_H_ #define GRAPH_H_ -#ifdef _OPENMP - #include -#else - #ifndef HAS_METIS - #define omp_get_num_threads() 1 - #define omp_get_thread_num() 0 - #endif +//#ifdef _OPENMP +// #include +//#else +// // CSG changing from #ifdef +// #if !HAS_METIS +// +// // CSG moving here from Graph.cpp... +//void omp_set_num_threads(int num_threads) { return; } +//int omp_get_num_threads() { return 1; } +//int omp_get_max_threads(void) { return 1; } +//int omp_get_thread_num(void) { return 0; } +//int omp_get_num_procs(void) { return 1; } +//int omp_in_parallel(void) { return 0; } +//void omp_set_dynamic(int num_threads) { return; } +//int omp_get_dynamic(void) { return 0; } +//void omp_set_nested(int nested) { return; } +//int omp_get_nested(void) { return 0; } +//// #define omp_get_num_threads() 1 +//// #define omp_get_thread_num() 0 +// #endif +//#endif + +#if WIN32 +#define strncasecmp strncmp #endif #include "GraphInterface.h" diff --git a/lib_graphd/inc/GraphReader.h b/lib_graphd/inc/GraphReader.h index 1cb72f7..2ee7f18 100644 --- a/lib_graphd/inc/GraphReader.h +++ b/lib_graphd/inc/GraphReader.h @@ -28,7 +28,9 @@ #include "Log.h" #include "Debug.h" #include +#if !WIN32 #include +#endif #include #include #include diff --git a/lib_graphd/inc/GraphWriter.h b/lib_graphd/inc/GraphWriter.h index 92e41e8..b82fe97 100644 --- a/lib_graphd/inc/GraphWriter.h +++ b/lib_graphd/inc/GraphWriter.h @@ -28,7 +28,9 @@ #include "Log.h" #include "Debug.h" #include +#if !WIN32 #include +#endif #include #include #include diff --git a/lib_graphd/src/Graph.cpp b/lib_graphd/src/Graph.cpp index b9fdf7d..69f26db 100644 --- a/lib_graphd/src/Graph.cpp +++ b/lib_graphd/src/Graph.cpp @@ -28,10 +28,12 @@ #include #include +// CSG - moving to Graph.h #ifndef _OPENMP #ifdef HAS_METIS - void omp_set_num_threads(int num_threads) { return; } - int omp_get_num_threads(void) { return 1; } +// Above is still defined if HAS_METIS is 0 + /*void omp_set_num_threads(int num_threads) { return; } + int omp_get_num_threads() { return 1; } int omp_get_max_threads(void) { return 1; } int omp_get_thread_num(void) { return 0; } int omp_get_num_procs(void) { return 1; } @@ -39,7 +41,7 @@ void omp_set_dynamic(int num_threads) { return; } int omp_get_dynamic(void) { return 0; } void omp_set_nested(int nested) { return; } - int omp_get_nested(void) { return 0; } + int omp_get_nested(void) { return 0; }*/ #endif #endif diff --git a/lib_graphd/src/GraphCreator.cpp b/lib_graphd/src/GraphCreator.cpp index 18eabf6..a1b65b0 100644 --- a/lib_graphd/src/GraphCreator.cpp +++ b/lib_graphd/src/GraphCreator.cpp @@ -62,12 +62,13 @@ namespace Graph { double r = lcgrand(0); if(r < q1) { } else if(r < q2) { - x += pow(2,j); + // pow(2,j)?? 1< >::const_iterator it; for(it = edges.begin(); it != edges.end(); it++) { g->add_edge(it->first,it->second); @@ -106,14 +107,16 @@ namespace Graph { for(it = probs->begin(); it != probs->end(); it++) { //compute which actors have a given attribute vector connect; - for(unsigned long i = 0; i < n; i++) { + for(int i = 0; i < n; i++) { if(lcgrand(0) < *it) { connect.push_back(i); } } //attach these actors to the graph - for(int i = 0; i < connect.size(); i++) { - for(int j = i + 1; j < connect.size(); j++) { + // CSG - if you call size over and over here this will be sloooow! + int conn_size=connect.size(); + for(int i = 0; i < conn_size; i++) { + for(int j = i + 1; j < conn_size; j++) { edges.insert(make_pair(connect[i],connect[j])); } } diff --git a/lib_graphd/src/GraphProperties.cpp b/lib_graphd/src/GraphProperties.cpp index a14331c..44bf2c0 100644 --- a/lib_graphd/src/GraphProperties.cpp +++ b/lib_graphd/src/GraphProperties.cpp @@ -23,7 +23,32 @@ //No longer used 7/22/13 //#include #include +#if !WIN32 #include +#endif + +#ifdef _OPENMP + #include +#else + // CSG changing from #ifdef + #if !HAS_METIS + + // CSG moving here from Graph.cpp... +void omp_set_num_threads(int num_threads) { return; } +int omp_get_num_threads() { return 1; } +int omp_get_max_threads(void) { return 1; } +int omp_get_thread_num(void) { return 0; } +int omp_get_num_procs(void) { return 1; } +int omp_in_parallel(void) { return 0; } +void omp_set_dynamic(int num_threads) { return; } +int omp_get_dynamic(void) { return 0; } +void omp_set_nested(int nested) { return; } +int omp_get_nested(void) { return 0; } +// #define omp_get_num_threads() 1 +// #define omp_get_thread_num() 0 + #endif +#endif + #include @@ -372,10 +397,8 @@ namespace Graph { * \param[out] t output vector of per-vertex triangle counts */ void GraphProperties::all_triangles_compact_forward(Graph *g, vector &t){ - int i, j; + int i; int u, v; - int retcode; - Node *vn; std::list::const_reverse_iterator rit; @@ -406,8 +429,6 @@ namespace Graph { */ Node *nv, *nu; - int vp, up; - int iu, iv; int fakev; int uprime, vprime; const int n = g->get_num_nodes(); @@ -493,7 +514,8 @@ namespace Graph { } //for vtxs } //for fakev #pragma omp for - for(i = 0; i < t.size(); i++){ + int tsize=(int)t.size(); + for(i = 0; i < tsize; i++){ for(int j = 0; j < omp_get_num_threads(); j++){ t[i] += local_t[j][i]; } @@ -507,7 +529,7 @@ namespace Graph { * \param[out] t vector of long ints, length |V|, returns 3x number of triangles for each vertex */ void GraphProperties::all_triangles_edge_listing(Graph *g, vector &t){ - int i, j, u, v; + int i, u, v; vector::iterator it; list::const_iterator cit; list::iterator lt; @@ -757,7 +779,9 @@ namespace Graph { } //compute diameter of each vertex - for(int i = 0; i < ecc.size(); i++){ + int eccsize=ecc.size(); + // This could be slow with resizing + for(int i = 0; i < eccsize ; i++){ if(ecc[i] > freq_ecc.size() ){ freq_ecc.resize(ecc[i] + 1); //because vector numbering starts at 0 } @@ -766,7 +790,8 @@ namespace Graph { //printf("Graph diameter is %d\n", freq_ecc.size()-1); #pragma omp parallel for default(none) shared(freq_ecc) - for(int i = 0; i <= freq_ecc.size() - 1; i++){ + int freq_ecc_size=freq_ecc.size(); + for(int i = 0; i <= freq_ecc_size - 1; i++){ freq_ecc[i] = freq_ecc[i] / n; //printf("i=%d and n=%d with freq eccentricity %f\n",i,n,freq_ecc[i]); } @@ -920,7 +945,6 @@ namespace Graph { const vector °rees = g->get_degree_ref(); int i; double di, dc; - int nbr; std::list::const_iterator cit; Node *node; diff --git a/lib_graphd/src/GraphReader.cpp b/lib_graphd/src/GraphReader.cpp index 1f25781..3a99cef 100644 --- a/lib_graphd/src/GraphReader.cpp +++ b/lib_graphd/src/GraphReader.cpp @@ -23,7 +23,9 @@ #include "Log.h" #include "Debug.h" #include "Util.h" +#if !WIN32 #include +#endif #include #include #include @@ -105,8 +107,6 @@ namespace Graph { * \return code 0 on success, nonzero on failure */ int GraphReader::read_adjlist(Graph *g, const string filename){ - int i, j, m, n, retval; - char *retp; int new_vid; int new_nbr; @@ -136,6 +136,8 @@ namespace Graph { } } } + // CSG - what should this return? + return 1; } // read_adjlist /** diff --git a/lib_graphd/src/GraphUtil.cpp b/lib_graphd/src/GraphUtil.cpp index 1168e63..f1dcfed 100644 --- a/lib_graphd/src/GraphUtil.cpp +++ b/lib_graphd/src/GraphUtil.cpp @@ -778,14 +778,18 @@ namespace Graph { vector deg_lookup(n); int max_deg = 0; - for(int i = 0; i < deg_lookup.size(); i++) { + int deg_size=deg_lookup.size(); + for(int i = 0; i < deg_size; i++) { deg_lookup[i] = g->degree[i]; if(deg_lookup[i] > max_deg) max_deg = deg_lookup[i]; } vector > D; D.resize(max_deg+1); - int depth[n]; + + int *depth; + depth=new int[n]; + //int depth[n]; //can also create an L output list for coloring number optimal ordering for(int i = 0; i < n; i++) { @@ -822,6 +826,7 @@ namespace Graph { } } } + delete [] depth; return k; } // find_degen diff --git a/lib_graphd/src/GraphWriter.cpp b/lib_graphd/src/GraphWriter.cpp index 6d7dcdb..74fa12e 100644 --- a/lib_graphd/src/GraphWriter.cpp +++ b/lib_graphd/src/GraphWriter.cpp @@ -205,7 +205,6 @@ namespace Graph { int num_nodes = g->get_num_nodes(); int num_edges = g->get_num_edges(); //vector nodes = g->get_nodes(); - Node *n; for(int i = 0; i < capacity; i++){ perm.push_back(i); diff --git a/make.inc b/make.inc deleted file mode 100644 index 7af50f2..0000000 --- a/make.inc +++ /dev/null @@ -1,6 +0,0 @@ -#----------------------------------------- -# This is a placeholder. Users will need to copy one of -# make.inc.serial, make.inc.parallel to make.inc and set -# required variables (including SRC_DIR) to compile INDDGO. - -$(error Default make.inc. Please copy one of make.inc.serial, make.inc.parallel over this file and set necessary environment variables) diff --git a/util/Makefile b/util/Makefile old mode 100644 new mode 100755 index a5d6af8..b8e3522 --- a/util/Makefile +++ b/util/Makefile @@ -1,77 +1,84 @@ -include ../make.inc -DOX_DIR = ./doc/ -DOXYFILE = ./Doxyfile - -INC_DIR = -I./inc -I$(GRAPH)/inc -I$(TREE)/inc $(METIS_INCLUDES) $(SSPARSE_INCDIR) $(UTHASH_INCDIR) $(MADNESS_INCDIR) $(GMP_INCDIR) $(PARMETIS_INCDIR) - -LIBS = -lm $(INDDGO_LIB) -ltreed -lgraphd $(SSPARSE_LIB) $(ARPACK_LIB) $(GMP_LIB) $(PARMETIS_LIB) $(METIS_LIB) - -PKT_SRCS = ./src/gen_pkt.cpp -PKT_OBJ = src/orbtimer.o $(PKT_SRCS:.cpp=.o) -PKT_EXE = $(INDDGO_BIN)/gen_pkt - -TD_STATS_SRCS = ./src/td_stats.cpp -TD_STATS_OBJ = $(TD_STATS_SRCS:.cpp=.o) -TD_STATS_EXE = $(INDDGO_BIN)/td_stats - -G_STATS_SRCS = ./src/graph_stats.cpp -G_STATS_OBJ = src/orbtimer.o $(G_STATS_SRCS:.cpp=.o) -G_STATS_EXE = $(INDDGO_BIN)/graph_stats - -GCONVERT_SRCS = ./src/gconvert.cpp -GCONVERT_OBJ = src/orbtimer.o $(GCONVERT_SRCS:.cpp=.o) -GCONVERT_EXE = $(INDDGO_BIN)/gconvert - -TRI_SRCS = ./src/count-tri.cpp -TRI_OBJ = src/orbtimer.o $(TRI_SRCS:.cpp=.o) -TRI_EXE = $(INDDGO_BIN)/count-tri - -SRT_SRCS = ./src/shortest-paths.cpp -SRT_OBJ = $(SRT_SRCS:.cpp=.o) -SRT_EXE = $(INDDGO_BIN)/shortest-paths - -ECC_SRCS = ./src/v_eccentricity.cpp -ECC_OBJ = $(ECC_SRCS:.cpp=.o) -ECC_EXE = $(INDDGO_BIN)/v_eccentricity - -EXP_SRCS = ./src/expansion.cpp -EXP_OBJ = $(EXP_SRCS:.cpp=.o) -EXP_EXE = $(INDDGO_BIN)/expansion - -all: $(PKT_EXE) $(TD_STATS_EXE) $(GCONVERT_EXE) $(E2A_EXE) $(M2D_EXE) $(G_STATS_EXE) $(TRI_EXE) $(SRT_EXE) $(ECC_EXE) $(EXP_EXE) - -.cpp.o: - $(CXX) $(CPPFLAGS) $(CFLAGS) -c $(INC_DIR) $< -o $@ - -$(PKT_EXE): $(PKT_OBJ) ../lib/libgraphd.a - $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ - -$(TD_STATS_EXE): $(TD_STATS_OBJ) ../lib/libgraphd.a - $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ - -$(G_STATS_EXE): $(G_STATS_OBJ) ../lib/libgraphd.a - $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ - -$(GCONVERT_EXE): $(GCONVERT_OBJ) ../lib/libgraphd.a - $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ - -$(TRI_EXE): $(TRI_OBJ) ../lib/libgraphd.a - $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ - -$(SRT_EXE): $(SRT_OBJ) ../lib/libgraphd.a - $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ - -$(ECC_EXE): $(ECC_OBJ) ../lib/libgraphd.a - $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ - -$(EXP_EXE): $(EXP_OBJ) ../lib/libgraphd.a - $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ - -clean: - -rm -rf $(PKT_OBJ) $(PKT_EXE) $(TD_STATS_OBJ) $(TD_STATS_EXE) $(GCONVERT_OBJ) $(GCONVERT_EXE) $(M2D_EXE) $(M2D_OBJ) $(G_STATS_EXE) $(G_STATS_OBJ) $(TRI_OBJ) $(TRI_EXE) $(SRT_OBJ) $(SRT_EXE) $(ECC_OBJ) $(ECC_EXE) $(EXP_OBJ) $(EXP_EXE) $(E2A_EXE) $(E2A_OBJ) - -doc: $(DOXYFILE) - doxygen $(DOXYFILE) - -clean_doc: - rm -rf $(DOX_DIR) +include ../make.inc +DOX_DIR = ./doc/ +DOXYFILE = ./Doxyfile + +INC_DIR = -I./inc -I$(GRAPH)/inc -I$(TREE)/inc $(METIS_INCLUDES) $(SSPARSE_INCDIR) $(UTHASH_INCDIR) $(MADNESS_INCDIR) $(GMP_INCDIR) $(PARMETIS_INCDIR) + +LIBS = -lm $(INDDGO_LIB) -ltreed -lgraphd $(SSPARSE_LIB) $(ARPACK_LIB) $(GMP_LIB) $(PARMETIS_LIB) $(METIS_LIB) + +PKT_SRCS = ./src/gen_pkt.cpp +PKT_OBJ = src/orbtimer.o $(PKT_SRCS:.cpp=.o) +PKT_EXE = $(INDDGO_BIN)/gen_pkt + +CMP_SRCS = ./src/complement.cpp +CMP_OBJ = $(CMP_SRCS:.cpp=.o) +CMP_EXE = $(INDDGO_BIN)/complement + +TD_STATS_SRCS = ./src/td_stats.cpp +TD_STATS_OBJ = $(TD_STATS_SRCS:.cpp=.o) +TD_STATS_EXE = $(INDDGO_BIN)/td_stats + +G_STATS_SRCS = ./src/graph_stats.cpp +G_STATS_OBJ = src/orbtimer.o $(G_STATS_SRCS:.cpp=.o) +G_STATS_EXE = $(INDDGO_BIN)/graph_stats + +GCONVERT_SRCS = ./src/gconvert.cpp +GCONVERT_OBJ = src/orbtimer.o $(GCONVERT_SRCS:.cpp=.o) +GCONVERT_EXE = $(INDDGO_BIN)/gconvert + +TRI_SRCS = ./src/count-tri.cpp +TRI_OBJ = src/orbtimer.o $(TRI_SRCS:.cpp=.o) +TRI_EXE = $(INDDGO_BIN)/count-tri + +SRT_SRCS = ./src/shortest-paths.cpp +SRT_OBJ = $(SRT_SRCS:.cpp=.o) +SRT_EXE = $(INDDGO_BIN)/shortest-paths + +ECC_SRCS = ./src/v_eccentricity.cpp +ECC_OBJ = $(ECC_SRCS:.cpp=.o) +ECC_EXE = $(INDDGO_BIN)/v_eccentricity + +EXP_SRCS = ./src/expansion.cpp +EXP_OBJ = $(EXP_SRCS:.cpp=.o) +EXP_EXE = $(INDDGO_BIN)/expansion + +all: $(PKT_EXE) $(TD_STATS_EXE) $(GCONVERT_EXE) $(E2A_EXE) $(M2D_EXE) $(G_STATS_EXE) $(TRI_EXE) $(SRT_EXE) $(ECC_EXE) $(EXP_EXE) $(CMP_EXE) + +.cpp.o: + $(CXX) $(CPPFLAGS) $(CFLAGS) -c $(INC_DIR) $< -o $@ + +$(PKT_EXE): $(PKT_OBJ) ../lib/libgraphd.a + $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ + +$(CMP_EXE): $(CMP_OBJ) ../lib/libgraphd.a + $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ + +$(TD_STATS_EXE): $(TD_STATS_OBJ) ../lib/libgraphd.a + $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ + +$(G_STATS_EXE): $(G_STATS_OBJ) ../lib/libgraphd.a + $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ + +$(GCONVERT_EXE): $(GCONVERT_OBJ) ../lib/libgraphd.a + $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ + +$(TRI_EXE): $(TRI_OBJ) ../lib/libgraphd.a + $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ + +$(SRT_EXE): $(SRT_OBJ) ../lib/libgraphd.a + $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ + +$(ECC_EXE): $(ECC_OBJ) ../lib/libgraphd.a + $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ + +$(EXP_EXE): $(EXP_OBJ) ../lib/libgraphd.a + $(CXX) $(CPPFLAGS) $(CFLAGS) $^ $(INC_DIR) $(LIBS) $(LDFLAGS) -o $@ + +clean: + -rm -rf $(PKT_OBJ) $(PKT_EXE) $(TD_STATS_OBJ) $(TD_STATS_EXE) $(GCONVERT_OBJ) $(GCONVERT_EXE) $(M2D_EXE) $(M2D_OBJ) $(G_STATS_EXE) $(G_STATS_OBJ) $(TRI_OBJ) $(TRI_EXE) $(SRT_OBJ) $(SRT_EXE) $(ECC_OBJ) $(ECC_EXE) $(EXP_OBJ) $(EXP_EXE) $(E2A_EXE) $(E2A_OBJ) $(CMP_EXE) $(CMP_OBJ) + +doc: $(DOXYFILE) + doxygen $(DOXYFILE) + +clean_doc: + rm -rf $(DOX_DIR) diff --git a/util/src/complement.cpp b/util/src/complement.cpp new file mode 100755 index 0000000..d63b6b5 --- /dev/null +++ b/util/src/complement.cpp @@ -0,0 +1,66 @@ +/* +This file is part of INDDGO. + +Copyright (C) 2012, Oak Ridge National Laboratory + +This product includes software produced by UT-Battelle, LLC under Contract No. +DE-AC05-00OR22725 with the Department of Energy. + +This program is free software; you can redistribute it and/or modify +it under the terms of the New BSD 3-clause software license (LICENSE). + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +LICENSE for more details. + +For more information please contact the INDDGO developers at: +inddgo-info@googlegroups.com + +*/ + +#include "GraphDecomposition.h" +#include "TreeDecomposition.h" +#include "Log.h" +#include "GraphException.h" +#include +#include + +#include "VertexWeightedGraph.h" + +void usage(char *str) +{ + fprintf(stderr,"%s \n\tWrites the complement graph of the provided\n" + "\tDIMACS file to .comp.norm\n" + "\tin normalized DIMACS form\n", str); + exit(-1); +}; + +int main(int argc, char **argv) +{ + if(argc!=2 || strcmp(argv[1],"-h")==0 || strcmp(argv[1],"--help")==0) + usage(argv[0]); + + Graph::VertexWeightedGraph *G; + + Graph::GraphCreatorFile creator; + creator.set_file_name(argv[1]); + creator.set_graph_type("DIMACS"); + G = creator.create_weighted_mutable_graph(); + G->complement(); + Graph::GraphWriter writer; + + char comp_DIMACS_file[200]; + char normalized_comp_DIMACS_file[200]; + sprintf(comp_DIMACS_file,"%s.comp",argv[1]); + writer.write_graph(G,comp_DIMACS_file,"DIMACS",true,false); + // Now normalize it + sprintf(normalized_comp_DIMACS_file,"%s.norm",comp_DIMACS_file); + normalize_DIMACS_file(comp_DIMACS_file,normalized_comp_DIMACS_file); + fprintf(stderr,"Complement graph of %s written to %s in normalized DIMACS form\n", + argv[1],normalized_comp_DIMACS_file); + + delete G; + return 1; +} + diff --git a/util/src/count-tri.cpp b/util/src/count-tri.cpp index 980588a..e0bb0bf 100644 --- a/util/src/count-tri.cpp +++ b/util/src/count-tri.cpp @@ -19,6 +19,8 @@ */ +#if !WIN32 && !CYGWIN + #include "GraphDecomposition.h" #include "GraphProperties.h" #include "Log.h" @@ -134,3 +136,13 @@ int main(int argc, char **argv){ return 0; } // main + +#else +#include +int main() +{ + fprintf(stderr,"Can't build under windows or cygwin\n"); + return 0; +} +#endif + diff --git a/util/src/gconvert.cpp b/util/src/gconvert.cpp index 644af43..dc5b14a 100644 --- a/util/src/gconvert.cpp +++ b/util/src/gconvert.cpp @@ -27,20 +27,22 @@ #include "GraphReader.h" #include "GraphWriter.h" +#if !WIN32 && !CYGWIN #include "orbconfig.h" #include "orbtimer.h" - using namespace std; void print_time(string prefix, ORB_t start, ORB_t end){ cout << prefix + ": " << ORB_seconds(end, start) << "\n"; } +#endif void usage(const char *s){ fprintf(stderr,"Usage: %s intype outtype infile outfile\n",s); } int main(int argc, char **argv){ +#if !WIN32 & !CYGWIN ORB_t t1, t2; char *intype, *outtype, *infile, *outfile; @@ -106,5 +108,9 @@ int main(int argc, char **argv){ print_time("Time(write_graph)", t1, t2); return 0; +#else + fprintf(stderr,"Can't build under Cygwin or Windows\n"); + return 1; +#endif } // main diff --git a/util/src/gen_pkt.cpp b/util/src/gen_pkt.cpp index 826cb33..1e1bd71 100644 --- a/util/src/gen_pkt.cpp +++ b/util/src/gen_pkt.cpp @@ -25,8 +25,16 @@ #include "GraphException.h" #include "GraphWriter.h" +#if !WIN32 && !CYGWIN #include "orbconfig.h" #include "orbtimer.h" +#else +#define ORB_t clock_t +#define ORB_seconds(x,y) "lame" +#define ORB_calibrate() +#define ORB_read(x) +#endif + using namespace std; @@ -61,7 +69,7 @@ int main(int argc, char **argv){ exit(-1); } - ORB_t t1, t2, t3; + ORB_t t1=0, t2=0, t3=0; int i; int t = 1; int ktree_n = -1, ktree_k = -1, ktree_p = -1; diff --git a/util/src/graph_stats.cpp b/util/src/graph_stats.cpp index 75590d5..7dbb3ea 100644 --- a/util/src/graph_stats.cpp +++ b/util/src/graph_stats.cpp @@ -32,6 +32,7 @@ #include "Util.h" #include "GraphException.h" +#if !WIN32 && !CYGWIN #include "orbconfig.h" #include "orbtimer.h" @@ -41,6 +42,7 @@ void print_time(string prefix, ORB_t start, ORB_t end){ cout << prefix + ": " << ORB_seconds(end, start) << "\n"; } + const string allowed_methods ("edge_density,avg_degree,degree_dist,global_cc,avg_cc,local_ccs,shortest_paths,assortativity,eccentricity,eccentricity_dist,expansion"); /** @@ -253,3 +255,10 @@ int main(int argc, char **argv){ exit(0); } // main +#else +int main() +{ + fprintf(stderr,"Can't run under windows or cygwin\n"); + return 0; +} +#endif diff --git a/util/src/orbtimer.cpp b/util/src/orbtimer.cpp index 163a256..d53302a 100644 --- a/util/src/orbtimer.cpp +++ b/util/src/orbtimer.cpp @@ -27,6 +27,8 @@ * All Rights Reserved. * **************************************************************************/ +#if !WIN32 +#if !CYGWIN #include #include @@ -39,8 +41,13 @@ static ORB_tick_t Csum = 0; static ORB_tick_t Gsum = 0; static ORB_tick_t nsamples = 0; static ORB_tick_t ndummy = 0; +#endif +#endif void ORB_calibrate(){ +#if WIN32 || CYGWIN || _CYGWIN + return; +#else int i, j; double seconds; struct timeval tv1, tv2; @@ -104,5 +111,8 @@ void ORB_calibrate(){ ORB_min_lat_sec = ORB_min_lat_cyc / ORB_ref_freq; GTD_avg_lat_sec = GTD_avg_lat_cyc / ORB_ref_freq; GTD_min_lat_sec = GTD_min_lat_cyc / ORB_ref_freq; +#endif } // ORB_calibrate + + From a80f9c6aabf34885a26ee926a7e89536b542ccf7 Mon Sep 17 00:00:00 2001 From: Chris Groer Date: Fri, 30 Aug 2013 09:32:14 -0400 Subject: [PATCH 02/12] CSG adding make.inc back in --- make.inc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 make.inc diff --git a/make.inc b/make.inc new file mode 100755 index 0000000..50fa200 --- /dev/null +++ b/make.inc @@ -0,0 +1,6 @@ +#----------------------------------------- +# This is a placeholder. Users will need to copy one of +# make.inc.serial, make.inc.parallel to make.inc and set +# required variables (including SRC_DIR) to compile INDDGO. + +$(error Default make.inc. Please copy one of make.inc.serial, make.inc.parallel over this file and set necessary environment variables) \ No newline at end of file From cb7a6a56fc7cbc8f4666420a11590575b1280b93 Mon Sep 17 00:00:00 2001 From: Chris Groer Date: Fri, 30 Aug 2013 10:32:36 -0400 Subject: [PATCH 03/12] Change to HAS_METIS #ifdef in Graph.cpp, adding project dependencies in solution --- MSVC/INDDGO.sln | 9 +++++++++ MSVC/INDDGO.suo | Bin 61440 -> 61440 bytes lib_graphd/src/GraphProperties.cpp | 9 ++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/MSVC/INDDGO.sln b/MSVC/INDDGO.sln index 8557204..d6d97ca 100755 --- a/MSVC/INDDGO.sln +++ b/MSVC/INDDGO.sln @@ -2,6 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual C++ Express 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_treed", "lib_treed\lib_treed.vcxproj", "{E88CD5F0-B70E-4504-B83B-393FC3FC12BD}" + ProjectSection(ProjectDependencies) = postProject + {BFE092BE-DF45-44F1-B013-A98820441A40} = {BFE092BE-DF45-44F1-B013-A98820441A40} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_graphd", "lib_graphd\lib_graphd.vcxproj", "{BFE092BE-DF45-44F1-B013-A98820441A40}" EndProject @@ -12,8 +15,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "serial_wis", "serial_wis\se EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gen_pkt", "gen_pkt\gen_pkt.vcxproj", "{F0C0ECD8-3A00-4D40-8A06-62938979C5A6}" + ProjectSection(ProjectDependencies) = postProject + {BFE092BE-DF45-44F1-B013-A98820441A40} = {BFE092BE-DF45-44F1-B013-A98820441A40} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complement", "complement\complement.vcxproj", "{E8670ED1-EA47-4A7F-858E-2781A04901C3}" + ProjectSection(ProjectDependencies) = postProject + {BFE092BE-DF45-44F1-B013-A98820441A40} = {BFE092BE-DF45-44F1-B013-A98820441A40} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/MSVC/INDDGO.suo b/MSVC/INDDGO.suo index e343eda17ee69e5d4fec1eec4fe7d46e21508f64..f7a799b1f90036cbd6d7b8fad1bbc85610dc74aa 100755 GIT binary patch delta 556 zcmZp8z})bFc|#5h>jKV`iM^8xSuSxhN-;1numkbr^M^Dh@v>~LVD)C>WK08!a6m;j zf8jpQ%*ps42zcN^{QgXn4+|SjE){BKY}ou$XeA>nGlMmQ{bWOtz|B8IOc)uNHtUKp zGBL7j)|V({oE)R6GO|fW|OEjbhURG8kAkSIK%ZPd?0IIQff02n#n< za&w8|d9di_64f5&$wDzklY4l%Ci9)-n4FW!H#sF$WU`xP)Z_!2Dl+>fJ=pJh|D($W z;guZaFR-W>SAVCCT3#g;UAla>eLWWnP)n@hB-Oc@zBzfZWVG1(+W0BqQ$PLatM zIt3PWF-?BZsW3S~Q%;P5p|kSnvJY2#Uhr*aaou5UX@B^S(B91;g4WoLvN z&LYO(0^|5hmVeI0t$YAzJ%a!cyG$-TwRQ4@dt#GgUh{BC14YdTrVkQ2eicLZBP$-@xg(9|ILQ#w;y|{=M zWl`um2_9l-1-&R8q=HtW$-%_binb?9S&E8YL?MSNLY>An;&*!Qec$|eW4o&Dst+@) zX?XV=*Ty;aHb~awv=Txv|Dt`Og^5c|$9;d&fR~C|XkHDHW@*EXXv2VlzEBsk+Esc= z{Lt=EjKwtc>M60R@1c~4T?SQT)+~~-3`J?vQ$&Zju+5T!66^GJNR+FJ@y*B7ARU#) z@3B$iC-5?o6!zAlTxl{^yp_mqcT{NQI5HyT_StuhT>0eBg7!L@cl~~V|RmMX)4apxoo2Peu&QCX7viJcYATM(mQ>>v@u{w z$dSJtYEQx~;N={6qK%%%Y`G6>ll}Nvd4OjN-D1b93x3)lV`-{~86@>zfaroDs*8sM zcs}`P-59M@((A(tT #else - // CSG changing from #ifdef - #if !HAS_METIS - - // CSG moving here from Graph.cpp... +#ifdef HAS_METIS +// CSG moving here from Graph.cpp... MSVC will complain +// about multiple definitions with the #define omp_X as well void omp_set_num_threads(int num_threads) { return; } int omp_get_num_threads() { return 1; } int omp_get_max_threads(void) { return 1; } @@ -46,7 +45,7 @@ void omp_set_nested(int nested) { return; } int omp_get_nested(void) { return 0; } // #define omp_get_num_threads() 1 // #define omp_get_thread_num() 0 - #endif +#endif #endif From a1e49fc210c2a28372dd863daf539fb8a5b3a8a0 Mon Sep 17 00:00:00 2001 From: Josh Lothian Date: Fri, 30 Aug 2013 14:22:40 -0400 Subject: [PATCH 04/12] fix compilation with openmp --- lib_graphd/src/GraphProperties.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_graphd/src/GraphProperties.cpp b/lib_graphd/src/GraphProperties.cpp index ce914d0..85ab595 100644 --- a/lib_graphd/src/GraphProperties.cpp +++ b/lib_graphd/src/GraphProperties.cpp @@ -512,8 +512,8 @@ namespace Graph { } //if revmap } //for vtxs } //for fakev - #pragma omp for int tsize=(int)t.size(); + #pragma omp for for(i = 0; i < tsize; i++){ for(int j = 0; j < omp_get_num_threads(); j++){ t[i] += local_t[j][i]; @@ -788,8 +788,8 @@ namespace Graph { } //printf("Graph diameter is %d\n", freq_ecc.size()-1); - #pragma omp parallel for default(none) shared(freq_ecc) int freq_ecc_size=freq_ecc.size(); + #pragma omp parallel for default(none) shared(freq_ecc, freq_ecc_size) for(int i = 0; i <= freq_ecc_size - 1; i++){ freq_ecc[i] = freq_ecc[i] / n; //printf("i=%d and n=%d with freq eccentricity %f\n",i,n,freq_ecc[i]); From 2669a3801f738c8f66fee83945b9f1910f00701a Mon Sep 17 00:00:00 2001 From: "Blair D. Sullivan" Date: Fri, 30 Aug 2013 15:22:41 -0400 Subject: [PATCH 05/12] Fixing OpenMP includes to work under Linux under all combinations of HAS_METIS and -fopenmp -D__OPENMP__. May now have issues under MSVC due to HAS_METIS always being defined. --- lib_graphd/inc/Graph.h | 29 ++++++++--------------------- lib_graphd/src/Graph.cpp | 7 +++---- lib_graphd/src/GraphProperties.cpp | 22 ---------------------- 3 files changed, 11 insertions(+), 47 deletions(-) diff --git a/lib_graphd/inc/Graph.h b/lib_graphd/inc/Graph.h index 1e4727b..3a7de41 100644 --- a/lib_graphd/inc/Graph.h +++ b/lib_graphd/inc/Graph.h @@ -22,27 +22,14 @@ #ifndef GRAPH_H_ #define GRAPH_H_ -//#ifdef _OPENMP -// #include -//#else -// // CSG changing from #ifdef -// #if !HAS_METIS -// -// // CSG moving here from Graph.cpp... -//void omp_set_num_threads(int num_threads) { return; } -//int omp_get_num_threads() { return 1; } -//int omp_get_max_threads(void) { return 1; } -//int omp_get_thread_num(void) { return 0; } -//int omp_get_num_procs(void) { return 1; } -//int omp_in_parallel(void) { return 0; } -//void omp_set_dynamic(int num_threads) { return; } -//int omp_get_dynamic(void) { return 0; } -//void omp_set_nested(int nested) { return; } -//int omp_get_nested(void) { return 0; } -//// #define omp_get_num_threads() 1 -//// #define omp_get_thread_num() 0 -// #endif -//#endif +#ifdef _OPENMP + #include +#else + #ifndef HAS_METIS + #define omp_get_num_threads() 1 + #define omp_get_thread_num() 0 + #endif +#endif #if WIN32 #define strncasecmp strncmp diff --git a/lib_graphd/src/Graph.cpp b/lib_graphd/src/Graph.cpp index 69f26db..802aa2e 100644 --- a/lib_graphd/src/Graph.cpp +++ b/lib_graphd/src/Graph.cpp @@ -28,11 +28,10 @@ #include #include -// CSG - moving to Graph.h #ifndef _OPENMP #ifdef HAS_METIS -// Above is still defined if HAS_METIS is 0 - /*void omp_set_num_threads(int num_threads) { return; } +//Note: the above still evaluates to true if HAS_METIS is defined to 0 in MSVC + void omp_set_num_threads(int num_threads) { return; } int omp_get_num_threads() { return 1; } int omp_get_max_threads(void) { return 1; } int omp_get_thread_num(void) { return 0; } @@ -41,7 +40,7 @@ void omp_set_dynamic(int num_threads) { return; } int omp_get_dynamic(void) { return 0; } void omp_set_nested(int nested) { return; } - int omp_get_nested(void) { return 0; }*/ + int omp_get_nested(void) { return 0; } #endif #endif diff --git a/lib_graphd/src/GraphProperties.cpp b/lib_graphd/src/GraphProperties.cpp index 85ab595..a2e94be 100644 --- a/lib_graphd/src/GraphProperties.cpp +++ b/lib_graphd/src/GraphProperties.cpp @@ -27,28 +27,6 @@ #include #endif -#ifdef _OPENMP - #include -#else -#ifdef HAS_METIS -// CSG moving here from Graph.cpp... MSVC will complain -// about multiple definitions with the #define omp_X as well -void omp_set_num_threads(int num_threads) { return; } -int omp_get_num_threads() { return 1; } -int omp_get_max_threads(void) { return 1; } -int omp_get_thread_num(void) { return 0; } -int omp_get_num_procs(void) { return 1; } -int omp_in_parallel(void) { return 0; } -void omp_set_dynamic(int num_threads) { return; } -int omp_get_dynamic(void) { return 0; } -void omp_set_nested(int nested) { return; } -int omp_get_nested(void) { return 0; } -// #define omp_get_num_threads() 1 -// #define omp_get_thread_num() 0 -#endif -#endif - - #include namespace Graph { From e82e7be09edf04a570c0008b00538ad2aebac2f0 Mon Sep 17 00:00:00 2001 From: "Blair D. Sullivan" Date: Fri, 30 Aug 2013 15:34:47 -0400 Subject: [PATCH 06/12] Adding macro to undefine HAS_METIS under MSVC when it's set to zero to enable all OpenMP function definitions to operate consistently with linux. --- lib_graphd/inc/Graph.h | 8 ++++++++ lib_graphd/src/Graph.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib_graphd/inc/Graph.h b/lib_graphd/inc/Graph.h index 3a7de41..0981dc3 100644 --- a/lib_graphd/inc/Graph.h +++ b/lib_graphd/inc/Graph.h @@ -19,6 +19,14 @@ */ +/*This fixes any issues with MSVC always having HAS_METIS defined*/ +#ifdef _MSC_VER + #if !HAS_METIS + #undef HAS_METIS + #endif +#endif + + #ifndef GRAPH_H_ #define GRAPH_H_ diff --git a/lib_graphd/src/Graph.cpp b/lib_graphd/src/Graph.cpp index 802aa2e..5cfff3f 100644 --- a/lib_graphd/src/Graph.cpp +++ b/lib_graphd/src/Graph.cpp @@ -28,9 +28,9 @@ #include #include + #ifndef _OPENMP #ifdef HAS_METIS -//Note: the above still evaluates to true if HAS_METIS is defined to 0 in MSVC void omp_set_num_threads(int num_threads) { return; } int omp_get_num_threads() { return 1; } int omp_get_max_threads(void) { return 1; } From a7462ca9df9feed90abc83ab49ff0741fd8d5dce Mon Sep 17 00:00:00 2001 From: Chris Groer Date: Fri, 30 Aug 2013 16:39:20 -0400 Subject: [PATCH 07/12] Adding gen_pkt project --- MSVC/INDDGO.sln | 6 ++ MSVC/INDDGO.suo | Bin 61440 -> 61952 bytes MSVC/gen_pkt/gen_pkt.vcxproj | 88 +++++++++++++++++++++++++++ MSVC/gen_pkt/gen_pkt.vcxproj.filters | 22 +++++++ 4 files changed, 116 insertions(+) create mode 100755 MSVC/gen_pkt/gen_pkt.vcxproj create mode 100755 MSVC/gen_pkt/gen_pkt.vcxproj.filters diff --git a/MSVC/INDDGO.sln b/MSVC/INDDGO.sln index d6d97ca..c403974 100755 --- a/MSVC/INDDGO.sln +++ b/MSVC/INDDGO.sln @@ -24,6 +24,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complement", "complement\co {BFE092BE-DF45-44F1-B013-A98820441A40} = {BFE092BE-DF45-44F1-B013-A98820441A40} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CPX_solve_wis", "CPX_solve_wis\CPX_solve_wis.vcxproj", "{141CEE83-9865-4982-A304-65ED2248F0BA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -50,6 +52,10 @@ Global {E8670ED1-EA47-4A7F-858E-2781A04901C3}.Debug|Win32.Build.0 = Debug|Win32 {E8670ED1-EA47-4A7F-858E-2781A04901C3}.Release|Win32.ActiveCfg = Release|Win32 {E8670ED1-EA47-4A7F-858E-2781A04901C3}.Release|Win32.Build.0 = Release|Win32 + {141CEE83-9865-4982-A304-65ED2248F0BA}.Debug|Win32.ActiveCfg = Debug|Win32 + {141CEE83-9865-4982-A304-65ED2248F0BA}.Debug|Win32.Build.0 = Debug|Win32 + {141CEE83-9865-4982-A304-65ED2248F0BA}.Release|Win32.ActiveCfg = Release|Win32 + {141CEE83-9865-4982-A304-65ED2248F0BA}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MSVC/INDDGO.suo b/MSVC/INDDGO.suo index f7a799b1f90036cbd6d7b8fad1bbc85610dc74aa..9516454448dddc2e33219a7b4a876df27e7a7059 100755 GIT binary patch delta 1988 zcmcIlZA?>F7(TbX#g@+krD8>G3vm`KgHlORbkz2$_%W)O*-bu-QWaAHfdEs~0*=ku z`OznkWh0AUTgLvZax&+(#1Ce+p+>XFk1aCC%(fp>nP&W$i-Wz_)lD<^OT9Nw-sgRv zbMHClJ?A|qFsuyxs0d@kmqF{VVrsE=`VMCGF~ zE0tnG#6x3(N3AC(_8&Q6P$9-dJk@d{J-Cy!M7@DnTqKOfw-p@O1>d7U{xlObNuBgiFr?dmL^WiD1k z%_i>`E8m*YDdPB~(>QI>X*)*JbiOy+i;sxDo90EgK7~n473E-Grb|#UN&Z3Nmos@| zR?va=wg7IlMDy6HQ4OYh4cySaQQ$(|xFC$ID(XJ{ku9$?vIo?m z*MFB53$#TEK7zcJU1X~X5@A6kwuo$TgfAhxl(3BOJfVazhPiuIrK~5mfv{1I(4RKl zQ+oHT(loMq+D1NBg)?hYuyP=M@&kE485%w%eSg~>PVRlp=r$C=9W4#bjzn~NR^tBrmZAmzBO`rJdZ{^}% zOTl-6Go>3${hCrWwbf%~?aWf@mI_%e-6xm$Q_n~XpVT6@O`HSI?n3l0PsK>Rj_=wz zCLC!$Aog_^O+c7xDL7z<(UOLt-5H@^5!P0*^D+H=2Tl&!Fw~oYoU0QN_}Yw` z_cVOy-6#cr_5Et0?}M|6YWX0UFAte!$wxnnjf1Va@P75c?~6y3Plxpu4^9sh!FV+j z7p|1^=5rb9#ZP}W%k<3slzS0|=3(pg*yt6M16n}l{x^ZzL4C?C3f+I?n?*i~-8ggf zBYtbprR2(Qe~3c3VK%}pGp=@-ak0|Ny~An+>PNh$N8KfV-!t;T$XFRKzt*e3v5O0N z*3X|zK>rRS*7)_Pn5u*4r!Y?V3bDV-h?_lH_($FfWu&Pj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3A00-4D40-8A06-62938979C5A6} + Win32Proj + metis502 + + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + HAS_GMP;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.5/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) + + + Console + true + ../$(Configuration);../../../mpir-2.5.2/build.vc10/Win32/$(Configuration) + lib_graphd.lib;lib_treed.lib;mpir.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.7/;../../lib_graphd/inc/;../../lib_treed/inc/; + + + Console + true + true + true + ../$(Configuration);../../../mpir-2.5.2/build.vc10/Win32/$(Configuration) + lib_graphd.lib;lib_treed.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/MSVC/gen_pkt/gen_pkt.vcxproj.filters b/MSVC/gen_pkt/gen_pkt.vcxproj.filters new file mode 100755 index 0000000..5c9925d --- /dev/null +++ b/MSVC/gen_pkt/gen_pkt.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file From 954b23109df5afc0ee74d8fddaad54ac1c6307a7 Mon Sep 17 00:00:00 2001 From: Chris Groer Date: Fri, 30 Aug 2013 17:11:30 -0400 Subject: [PATCH 08/12] Cleaning up paths in projects --- MSVC/INDDGO.sln | 3 +++ MSVC/INDDGO.suo | Bin 61952 -> 69120 bytes MSVC/complement/complement.vcxproj | 8 ++++---- MSVC/gen_pkt/gen_pkt.vcxproj | 8 ++++---- MSVC/lib_graphd/lib_graphd.vcxproj | 4 ++-- MSVC/lib_treed/lib_treed.vcxproj | 4 ++-- MSVC/serial_wis/serial_wis.vcxproj | 10 +++++----- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/MSVC/INDDGO.sln b/MSVC/INDDGO.sln index c403974..2dbceeb 100755 --- a/MSVC/INDDGO.sln +++ b/MSVC/INDDGO.sln @@ -25,6 +25,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complement", "complement\co EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CPX_solve_wis", "CPX_solve_wis\CPX_solve_wis.vcxproj", "{141CEE83-9865-4982-A304-65ED2248F0BA}" + ProjectSection(ProjectDependencies) = postProject + {BFE092BE-DF45-44F1-B013-A98820441A40} = {BFE092BE-DF45-44F1-B013-A98820441A40} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/MSVC/INDDGO.suo b/MSVC/INDDGO.suo index 9516454448dddc2e33219a7b4a876df27e7a7059..14d17028c62ec2c1e762a74240df8e92070b4099 100755 GIT binary patch delta 4260 zcmcH+X;@R&^4xF}gMcILh?^(O}<|J2M`{#Y{``UM5GBao9%ssQ5 zbLLuayIHrftsxArEi{0&5<(8md6lv8uJflMJqhmchWn01DiL7{!UTk=2nh(&VVGM0 zy9z1LxwVFrB2kV|fl!9<+vCTNDO4d{iLe@>8leWk#uj*W#aiBbxtnoAHYOL!*=`Vj z5MuLU9i{w_`0flfF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$1`*GMA+L21hl>(8EJHk7mJU~u zye<2*N;yeqyj2L=T9lg4TmjPxCJR#`lcG_?bFq&v<++Th+$XR0%{Z_%%w0SU&c2jT zBQ2py`aK7K5tZz0TF@(%+=-h1)5pkbGbx4U>2Q!;ZfFxK_8Q@(&DH208-~Y|)X3SK zfx-5vcyn7hR4uK($X(qMjDX?*j=x-74o~7!@o*Pg@w4Xx^lW!|lW6!o)VR~BxO)r( zE4dL5>%>K@FTC+HkY@Ij8jv&~@$0l8WuR4fSn2u0JMODY`KxbTx^AdHo|iEFlW863 zd541 zNr^6XF5BKOQ1@ovaCi7aCQeF8`FdX7&pO`m!UjQe{fUlj6~x!m)Hej(WckwDg3j|5 z%XX`~DXNrv|3Gv&JCu^$EDzV?a)9CU*3sLN`w0f^Nc9tKL&<98o`9*HO56 z79Q^ohrPfUJ=`=ryi-XwF1Y1Xl9My{aPs59sq-%$`1Z%o|Ldn9-+pTcYBEjO`}S_F zP|RA%W_q*D(VeMT&H_J?Fa5d~4|`@0_f4hzD5*7^n0wm1#j8PR187GSzb(l)c%cpb z=VIiQ@4cmh>$XPLoZhYS>^EyB@Uar#QQ5ISTZj2a<8bfeY$@#tpyOz!hTTXnK2f`O z^nzBhJe58V^uv_CMK~B6g6}GI(DfOV1}8Qm%QzM%`ewuZ{bc#vnf?*@+1kTLpFT7SNJP-KaWpu zex>~lb4ukj!*y2n{9usFzrQ1J-aZ3|(xY(xYA}vnX~Op6xv*FhaOjG}t;z<=wI)QY zsY2C4J?EnGUjgT&+5Bm4z!Fo}HGhbzoRtz5= zniEE5M#}mB=~W@={wCOeY{z-`4CMm3;1|8{{2GOx{V)5^WAC_;rTJZ_d89Z7i^i-l Gss9H90%Pj{ diff --git a/MSVC/complement/complement.vcxproj b/MSVC/complement/complement.vcxproj index 8e7878f..12a8b3e 100755 --- a/MSVC/complement/complement.vcxproj +++ b/MSVC/complement/complement.vcxproj @@ -41,7 +41,7 @@ - true + false false @@ -53,13 +53,13 @@ Level3 Disabled HAS_GMP;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.5/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) + ../../../mpir-2.5.2;../../max_wis/inc;../../uthash-1.9.3/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) Console true ../$(Configuration);../../../mpir-2.5.2/build.vc10/Win32/$(Configuration) - lib_graphd.lib;lib_treed.lib;mpir.lib;%(AdditionalDependencies) + lib_graphd.lib;lib_treed.lib;%(AdditionalDependencies) @@ -71,7 +71,7 @@ true true _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.7/;../../lib_graphd/inc/;../../lib_treed/inc/; + ../../../mpir-2.5.2;../../max_wis/inc;../../uthash-1.9.3/src;../../lib_graphd/inc/;../../lib_treed/inc/; Console diff --git a/MSVC/gen_pkt/gen_pkt.vcxproj b/MSVC/gen_pkt/gen_pkt.vcxproj index b1a15c2..bad9513 100755 --- a/MSVC/gen_pkt/gen_pkt.vcxproj +++ b/MSVC/gen_pkt/gen_pkt.vcxproj @@ -41,7 +41,7 @@ - true + false false @@ -53,13 +53,13 @@ Level3 Disabled HAS_GMP;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.5/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) + ../../../mpir-2.5.2;../../max_wis/inc;../../uthash-1.9.3/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) Console true ../$(Configuration);../../../mpir-2.5.2/build.vc10/Win32/$(Configuration) - lib_graphd.lib;lib_treed.lib;mpir.lib;%(AdditionalDependencies) + lib_graphd.lib;lib_treed.lib;%(AdditionalDependencies) @@ -71,7 +71,7 @@ true true _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.7/;../../lib_graphd/inc/;../../lib_treed/inc/; + ../../../mpir-2.5.2;../../max_wis/inc;../../uthash-1.9.3/src/;../../lib_graphd/inc/;../../lib_treed/inc/; Console diff --git a/MSVC/lib_graphd/lib_graphd.vcxproj b/MSVC/lib_graphd/lib_graphd.vcxproj index b395727..db340a2 100755 --- a/MSVC/lib_graphd/lib_graphd.vcxproj +++ b/MSVC/lib_graphd/lib_graphd.vcxproj @@ -67,7 +67,7 @@ Level3 Disabled _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - ../../../uthash-1.9.5/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) + ../../uthash-1.9.3/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) Console @@ -83,7 +83,7 @@ true true _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - ../../..uthash-1.9.5/src/;../../lib_graphd/inc/;../../lib_treed/inc/; + ../../uthash-1.9.3/src/;../../lib_graphd/inc/;../../lib_treed/inc/; Console diff --git a/MSVC/lib_treed/lib_treed.vcxproj b/MSVC/lib_treed/lib_treed.vcxproj index 5d78dc6..f175a6e 100755 --- a/MSVC/lib_treed/lib_treed.vcxproj +++ b/MSVC/lib_treed/lib_treed.vcxproj @@ -57,7 +57,7 @@ Level3 Disabled _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - ../../../uthash-1.9.5/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) + ../../uthash-1.9.3/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) Console @@ -73,7 +73,7 @@ true true _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - ../../../uthash-1.9.7/;../../lib_graphd/inc/;../../lib_treed/inc/; + ../../uthash-1.9.3/src;../../lib_graphd/inc/;../../lib_treed/inc/; Console diff --git a/MSVC/serial_wis/serial_wis.vcxproj b/MSVC/serial_wis/serial_wis.vcxproj index c9e640d..07eface 100755 --- a/MSVC/serial_wis/serial_wis.vcxproj +++ b/MSVC/serial_wis/serial_wis.vcxproj @@ -43,7 +43,7 @@ - true + false false @@ -54,14 +54,14 @@ Level3 Disabled - HAS_GMP;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.5/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ../../../mpir-2.5.2;../../max_wis/inc;../../uthash-1.9.3/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) Console true ../$(Configuration);../../../mpir-2.5.2/build.vc10/Win32/$(Configuration) - lib_graphd.lib;lib_treed.lib;mpir.lib;%(AdditionalDependencies) + lib_graphd.lib;lib_treed.lib;%(AdditionalDependencies) @@ -73,7 +73,7 @@ true true _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.7/;../../lib_graphd/inc/;../../lib_treed/inc/; + ../../../mpir-2.5.2;../../max_wis/inc;../../uthash-1.9.3/src;../../lib_graphd/inc/;../../lib_treed/inc/; Console From c4b96831cd934be80706e3a53cf5a080253a3c0d Mon Sep 17 00:00:00 2001 From: Chris Groer Date: Fri, 30 Aug 2013 21:38:41 -0400 Subject: [PATCH 09/12] CSG adding CPX_solve_wis.cpp to util/src directory, adding readme to MSVC directory that describes how to build CPX_solve_wis if you have CPLEX, etc. and also putting an #if WIN32 in src/Util.cpp for getHWmem() function --- MSVC/CPX_solve_wis/CPX_solve_wis.vcxproj | 88 +++++++ .../CPX_solve_wis.vcxproj.filters | 22 ++ MSVC/INDDGO.sln | 3 - MSVC/INDDGO.suo | Bin 69120 -> 69120 bytes MSVC/README.txt | 7 + lib_graphd/src/Util.cpp | 6 +- util/src/CPX_solve_wis.cpp | 227 ++++++++++++++++++ 7 files changed, 349 insertions(+), 4 deletions(-) create mode 100755 MSVC/CPX_solve_wis/CPX_solve_wis.vcxproj create mode 100755 MSVC/CPX_solve_wis/CPX_solve_wis.vcxproj.filters create mode 100755 MSVC/README.txt create mode 100755 util/src/CPX_solve_wis.cpp diff --git a/MSVC/CPX_solve_wis/CPX_solve_wis.vcxproj b/MSVC/CPX_solve_wis/CPX_solve_wis.vcxproj new file mode 100755 index 0000000..9128dc6 --- /dev/null +++ b/MSVC/CPX_solve_wis/CPX_solve_wis.vcxproj @@ -0,0 +1,88 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + {141CEE83-9865-4982-A304-65ED2248F0BA} + Win32Proj + metis502 + + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + HAS_GMP;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ../../../mpir-2.5.2;../../max_wis/inc;../../../uthash-1.9.5/src/;../../lib_graphd/inc/;../../lib_treed/inc/;%(AdditionalIncludeDirectories) + + + Console + true + ../$(Configuration);../../../mpir-2.5.2/build.vc10/Win32/$(Configuration) + lib_graphd.lib;lib_treed.lib;mpir.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + C:\Program Files\IBM\ILOG\CPLEX_Studio125\cplex\include;../../lib_graphd/inc/;../../../glpk-4.47/src + + + Console + true + true + true + ../$(Configuration);C:\ILOG\CPLEX111\lib\x86_windows_vs2008\stat_mda;C:\Program Files\IBM\ILOG\CPLEX_Studio125\cplex\lib\x86_windows_vs2010\stat_mda;../../../glpk-4.47/w32 + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;cplex125.lib;lib_graphd.lib;glpk.lib + + + + + + \ No newline at end of file diff --git a/MSVC/CPX_solve_wis/CPX_solve_wis.vcxproj.filters b/MSVC/CPX_solve_wis/CPX_solve_wis.vcxproj.filters new file mode 100755 index 0000000..951e0d9 --- /dev/null +++ b/MSVC/CPX_solve_wis/CPX_solve_wis.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/MSVC/INDDGO.sln b/MSVC/INDDGO.sln index 2dbceeb..c403974 100755 --- a/MSVC/INDDGO.sln +++ b/MSVC/INDDGO.sln @@ -25,9 +25,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complement", "complement\co EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CPX_solve_wis", "CPX_solve_wis\CPX_solve_wis.vcxproj", "{141CEE83-9865-4982-A304-65ED2248F0BA}" - ProjectSection(ProjectDependencies) = postProject - {BFE092BE-DF45-44F1-B013-A98820441A40} = {BFE092BE-DF45-44F1-B013-A98820441A40} - EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/MSVC/INDDGO.suo b/MSVC/INDDGO.suo index 14d17028c62ec2c1e762a74240df8e92070b4099..a7e23c4a8b6e974e980081922fb2aae900aad7c1 100755 GIT binary patch delta 814 zcmX|8ZAg<*6ux)wb-qrQbFQVE$}+VS1vQJpLebfe(wGGP2#Hes2(+e7Qi@m;V#}4f z10iKKXOsn%?fo$&%9RqW()`E@MY11CT8bY-NNnrAy1ek*=RAkQbI!R}-$wLpr0W|K zQjZY2Na68%y*#`y%QX0D)i(JwS4BpI0f?^_>O?sS&|5xZjjsE0^&SSGH>jd~HS08zdfqs%KOr;g;h+9*=Wy7)^ zLm^KU$m$CA_R;jlX;_GmfiqqP@kByiS*CjJ2~(#ap-BtlMlDEPawv#TuwNrMfL|pW zBUB3F#>RbRG~zQAKGylT(#QPXS{hgR^yWhhH0}khI1YqnMPknPC3RQmBcn>K$m~vM z7H_+59s$j2Po3tCYH`f`bDM+Ybf+K8=v$Y*gq=jzp*IT{Iy2;%YQVZ90zA8gP+-c1 zg&X_1TTKtd&}EATNjM2tpcCjkszueP7?mIuI)cuk3L4eG8B+#$?nJ?5Q#5lJ>EU%j z24voKLe>R2EEY>({YnHF?!{P)JT2pLsI`ug?R-=EQ=G0n2un7fjlT;~9&KbXCqoga z;B=GRrz`if#*bgxRZen0Wh_}2+7*cNu%P+ZH z%8%wdO3E?{bvv~wgvzfh_i=1afE^o?DaUgm(jCOrj9>SI=1CDRKtA)_HYJ3r`CTwK zGXc$m95v<2XIlwaN8{k+NE)xT%PH8lK)Ci51BRu}Ly$Z#f_EziY^wtMY9AAT%V<|2 X#pZ5*K1m=uCdJ_v;atq=bx!;bt~5#P delta 1114 zcmcIi`%6=C6#ss`*EMt6G#h1E(k#my&Fh1ymCkKaWVHoFP*f&rMGw>UG(jhYODXeH z5tU^=0)xPI344$ZtzeO4nc)kvevpESB^G4m`d*#VKhXJdIG=OQ_nz@x|Bp zrXDWn1R2aoG9*<`XpSV(AWt-mmR6NALmibXBGo2|cf0n@NZKs2dftEXhIMAyG`{rfyb#CSV?Okucsy(^C(mKoX_H?G z3@E5L8vaZ^JNvS2O&y>8W#MY~Llz#F_tvpmIG2WCDX*NU6g9XVo9%m91xk`h3M_UD zdd|+rMpvri3{U-XC?N)>xd2AaC=jIc;T=8${Tn51Q=FeWa>U^3}qHHo@}cuicQPSEIMwQ-t+c#}~O;&kcS zG=0%YgL%u2f`j{xWbZh-r(oNZhvhxX;cWB^n2JbwoF9l5^BU@W&|Loj5gnz_^$D=Q zNJeMhPGmJ+bliRtB%j4drAfrtk0y>h5~OLI#`$~`&bkC_tPWvQIYSI2iEJZTXm#o3 zf?yEzf>7jm9>LK&@C?~dULP$+bi9_O|L=b29I?3D!u{`e(t=8)WsQs4X=hf3j-D>s zC*JJ6?2CL`XjP6%)DCtsJgmZocX!b=poV&=-#d_H-DyD!yafnRI-?j?ilal>zO`R@ zWY&jb-3x_y>T@AQQ$rYPy4FD3uR=|)0%gOaaK8;i-uFuEl&3g;v~zwWSE9glVoN_? RD$&lzG>=TD8Ps8Q(!VZ{oNxdD diff --git a/MSVC/README.txt b/MSVC/README.txt new file mode 100755 index 0000000..0f85d0a --- /dev/null +++ b/MSVC/README.txt @@ -0,0 +1,7 @@ +All the projects in this directory should build without issue +except for the CPX_solve_wis project as it requires both +GLPK (open source) and CPLEX (not open source). If you have +both GLPK and CPLEX, then it should be straightforward to +add the appropriate paths and libs to the project properties +by just editing what is in there now as that is specific +to a particular machine with the paths, etc. \ No newline at end of file diff --git a/lib_graphd/src/Util.cpp b/lib_graphd/src/Util.cpp index 2db0a22..28105c7 100644 --- a/lib_graphd/src/Util.cpp +++ b/lib_graphd/src/Util.cpp @@ -36,7 +36,11 @@ int parseLine(char *line){ return i; } -int getHWmem(){ //Note: this value is in KB! +int getHWmem(){ +#if WIN32 + return -1; +#endif + //Note: this value is in KB! FILE *file = fopen("/proc/self/status", "r"); if(file == NULL){ fprintf(stderr, "Error opening processor status file!\n"); diff --git a/util/src/CPX_solve_wis.cpp b/util/src/CPX_solve_wis.cpp new file mode 100755 index 0000000..7db56a7 --- /dev/null +++ b/util/src/CPX_solve_wis.cpp @@ -0,0 +1,227 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "GraphDecomposition.h" + +void check_CPX_status(char *func, int status) +{ + if (status) + { + fprintf (stderr, "CPX nonzero status after %s: %d\n",func,status); + exit(-1); + } +}; + +void write_ind_set_model(const char *DIMACS_file, const char *model_file, + Graph::VertexWeightedGraph *G) +{ + int i, j; + + FILE *out = fopen(model_file, "w"); + if (!out) + fatal_error("Can't open %s for writing\n", model_file); + + // Write out the model + fprintf(out, + "# Automatically generated model file for max independent set\n" + "# Assumes 1-based node names with no holes!!\n" + "# Original graph file is %s\n" + "# Model section\n\n" + "param num_nodes ;\n" + "set Nodes := 1..num_nodes ;\n" + "set E within Nodes cross Nodes ;\n" + "param w{Nodes};\n" + "var x{i in Nodes} binary;\n\n" + // Change to minimization for archaic MPS reasons + "minimize Cost: sum{i in Nodes} -x[i]*w[i];\n\n" + "subject to Independent{i in Nodes, j in Nodes: (i,j) in E}:\n" + "x[i]+x[j]<=1;\n\n" + "solve;\n\n", DIMACS_file); + /* + fprintf( + out, + "printf \" \\nMaximum Independent Set: %%d\\n\", sum{i in Nodes} x[i]*w[i] > \"%s\";\n", + sol_file); + fprintf(out, "for { i in Nodes }\n" + "{\n" + " printf{0..0: x[i]!=0} \"%%d (%%3.1f)\\n\", i, w[i] >> \"%s\";\n", + sol_file); + fprintf(out, "}\n\n");*/ + fflush(out); + fprintf(stderr,"Writing data section\n"); + + fprintf(out, "# Data Section\n\ndata;\n\n"); + fflush(out); + // Write out the problem data + fprintf(out, "param num_nodes:=%d;\n", G->get_num_nodes()); + fflush(out); + fprintf(out, "param w:=\n"); + fflush(out); + vector nodes = G->get_nodes(); + vector weight = G->get_weight(); + + for (i = 0; i < G->get_num_nodes(); i++) + { + fprintf(out, "%d %d\n",nodes[i].get_label(), weight[i]); + } + fprintf(out, ";\n"); + fprintf(out, "set E:=\n"); + Graph::GraphProperties properties; + + vector adj_vec; + for (i = 0; i < G->get_num_nodes(); i++) + { + // This assumes 1-based labeling! + int current_key = properties.fill_adj_vec(G, i); + //int current_key=G->fill_adj_vec(i); + adj_vec = G->get_adj_vec(); + for (j = i + 1; j < G->get_num_nodes(); j++) + { + if (adj_vec[j] == current_key) + fprintf(out, "(%d,%d)\n", i + 1, j + 1); + } + fprintf(out, "\n"); + } + fprintf(out, ";\nend;\n"); + fclose(out); +}; + +void read_DIMACS(const char *DIMACS_file, Graph::VertexWeightedGraph *G) +{ + int i; + Graph::GraphCreatorFile creator; + creator.set_file_name(DIMACS_file); + creator.set_graph_type("DIMACS"); + + G = creator.create_weighted_mutable_graph(); + if (!G) + { + fprintf(stderr,"Could not create graph for DIMACS file %s\n",DIMACS_file); + exit(-1); + } + + // Add weights of 1 to all vertices if we didn't load any from the file + bool has_weights = false; + vector weight = (G)->get_weight(); + for (i = 0; i < (G)->get_capacity(); i++) + { + if (weight[i] != 0) + { + has_weights = true; + break; + } + } + + if (!has_weights) + for (i = 0; i < (G)->get_capacity(); i++) + weight[i] = 1; + + fprintf(stderr,"Graph loaded with %d nodes, %d edges\n",G->get_num_nodes(), + G->get_num_edges()); +}; + +void create_mps_file(char *gmpl_file, char *mps_file, bool verbose) +{ + // Read in the model + glp_prob *lp; + glp_tran *tran; + if(!verbose) + glp_term_out(GLP_OFF); + lp = glp_create_prob(); + tran = glp_mpl_alloc_wksp(); + fprintf(stderr,"reading model\n"); + int ret = glp_mpl_read_model(tran, gmpl_file , 0); + if (ret) + { + fprintf(stderr, "Error translating model\n"); + exit(-1); + } + ret = glp_mpl_generate(tran, NULL); + if (ret) + { + fprintf(stderr, "Error generating model\n"); + exit(-1); + } + + glp_mpl_build_prob(tran, lp); + ret = glp_write_mps(lp, GLP_MPS_FILE, NULL, mps_file); + if (ret) + { + fprintf(stderr, "Error on writing MPS file\n"); + exit(-1); + } + glp_mpl_free_wksp(tran); + glp_delete_prob(lp); + fprintf(stderr,"GLPK created MPS file %s\n",mps_file); +} + +void usage(char *str) +{ + fprintf(stderr,"%s [-n num_threads]\n" + "\t Uses CPLEX with num_threads to solve WIS with max_seconds time limit\n",str); + exit(-1); +} + +int main(int argc,char *argv[]) +{ + if(argc!=3) + usage(argv[0]); + char *DIMACS_file=argv[1]; + // set time limit + int max_secs=atoi(argv[2]); + + // Load the graph from DIMACS_file + Graph::VertexWeightedGraph *G; + Graph::GraphCreatorFile creator; + creator.set_file_name(DIMACS_file); + creator.set_graph_type("DIMACS"); + G = creator.create_weighted_mutable_graph(); + + char mps_file[100], mod_file[100]; + + int status; + fprintf(stderr,"G has %d nodes, %d edges\n",G->get_num_nodes(), + G->get_num_edges()); + + // Write a GMPL model + sprintf(mod_file,"%s.mod",DIMACS_file); + write_ind_set_model(DIMACS_file, mod_file, G); + // Write mps file + sprintf(mps_file,"%s.mps",DIMACS_file); + create_mps_file(mod_file,mps_file,false); + + CPXENVptr env = NULL; + env = CPXopenCPLEX (&status); + check_CPX_status("CPXopenCPLEX",status); + + CPXsetintparam (env, CPX_PARAM_SCRIND, CPX_OFF); + + clock_t start=clock(),stop; + CPXLPptr mip; + mip=CPXcreateprob(env,&status,mps_file); + status = CPXreadcopyprob (env, mip, mps_file, NULL); + check_CPX_status("CPXreadcopyprob",status); + CPXsetdblparam(env, CPX_PARAM_TILIM, max_secs); + + int num_cols=CPXgetnumcols(env,mip); + int num_rows=CPXgetnumrows(env,mip); + + int mip_status=CPXmipopt(env,mip); + double obj; + CPXgetobjval(env,mip,&obj); + int objval=(int)obj; + stop=clock(); + fprintf(stdout,"%s %d %d %d %d %d %3.3f\n",DIMACS_file,num_cols, num_rows,mip_status, + -objval,getHWmem(),(double)(stop-start)/CLOCKS_PER_SEC); + fflush(stdout); + exit(-1); +} + + + + From a985b54a56c3bbc0dba9078fa155486fd9dea7e2 Mon Sep 17 00:00:00 2001 From: Chris Groer Date: Sat, 31 Aug 2013 17:05:14 -0400 Subject: [PATCH 10/12] Minor changes to MSVC solution file --- MSVC/INDDGO.suo | Bin 69120 -> 68608 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/MSVC/INDDGO.suo b/MSVC/INDDGO.suo index a7e23c4a8b6e974e980081922fb2aae900aad7c1..70d4df729394cfa58efa81ccb608acebdfead1d4 100755 GIT binary patch delta 1704 zcmX|AZA_C_6u!583oW)#Yh^7kDflspSjtp%i@GAr4K}2HF^3>f>ql7!SW5X&@kJdj zib{JXI1#}zXV$r8HkpnsWFLufZfdsuA)36&P!x7<`_|h$z2`jVAR&k1Nap=3;GJbx%1}{C zgdolulPg(b^$RBDh)fnF(5Wj^CL@_D84}VdAt?l&>ejYMjCEpC@1XN%Y6wlp~!%os@$RyDS|-D{Xg$U4kpfTF6B=xMu*8StP$O^WIGKG-RXeQ|ouGh?gyN+z&dwDo> zat(YvG!JCM3!vwtPG~%mBqTZatEfYu-WjT9qjCrfIFA5zvpba$BdA7f zEJ0W#qZRi8#H*6doR_0qh*-fmfBjO>9yj=%2CyC9tU_~a!O-#aw_DJo8L^jnN(LXw zt&+~Tc9eNUCt{z(AHcm!l9^A?M?)tLQ9;($g#*wchWgZsP``sx;@>bw@C}@jB;%*K z6mD<@;5|Fe)nYGVeHyG#QFeNp#0cWxyV(2oaOgZwDG%2x-w?vX994SJVNX0v9I;0q z?_7ycXtAPe(DB3!!3%dGyT%4T@3g^Bo+bDR4YUYLf%ivW2|Qf{;T>s#XEw-u(*${^ z$KjDbEwC$9u-?1Fg)ZMr=eED7<2$t+x+2-|g;@vxG-*K_*$?4}4U*R{1KYze8?Av~ zRdk+UofxAq=6@Y5!3D5goEGf2#VlnjCi2AV^*)N#+Yl$jM-{PVJhsEPoK+AXtGU4Q zbokAnHO6Q4tFyl}{$(s5{PLZwwbm^YRL*Yko@k~X=sxGbS=7!RE*$K0{rV(mVnvPSbW zW9iB~?JsJH&-Emb`|sN*^D;|?q)2Xq;_$ktmWGh#JzyDBt5VrKQ0bS2jEDq}TyoSz z;hA5y=<__L%)d#4Z-N?G9jZ$+Vb1qNwj~sX`=Q7V_C-^W2-WZ;MGk(dVp&SXn;X=u z7ylTua9*FL$Po^e$2dx5iB~FzZWfVLI>eP?=I~`OH5TbwLrhZJll}*AKP|FISOh zh;88~Y>OBonhn@lTZP(9RnV79 zkUssLY`fx&Lu-NYpF4<8oPq0y^VG!fN_MiUkWI-Uw2z&$lvrkO5nU$J)2X4jw^? zdFf~jv&&4i4Y=`fNkqoYZ3{u#7H8Jh$j+=L}DB=LNZU4BS3**eOWVIK3px>*N6}e_5!(eM-5XZ=gnkj&kaOLi2;Tn zBl132s>r)!5yr_P`s`tdJp5y8T|Q&}yK?=NRrQ}R_Boe=_QWt9<25hfU(|J_?7b}J z4JZvcI$=I(tKAmG(J-B%EZ>Bm7EHvMf-w8SNS3BJ_g6ER4n(7{F<5CkATo(xiTsLm z<#aTeB^4@A|^!gwX_ zLL`Ibufz5jBaBbqQn7NJ?TKfrQ2sPq$9Qkzy{tdk(;swUq3t1N#Eis!f8j(^kTE+2lHr zWguf{LVcOYT(?TS$=dhD0J-)5+T6!rz&;0p{82HgpHV HuO#k23KFsb From bcbe1652be15873d94a613f825790ab1b614e6db Mon Sep 17 00:00:00 2001 From: Chris Groer Date: Sat, 31 Aug 2013 18:25:38 -0400 Subject: [PATCH 11/12] editing MSVC README.txt --- MSVC/README.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MSVC/README.txt b/MSVC/README.txt index 0f85d0a..33b2152 100755 --- a/MSVC/README.txt +++ b/MSVC/README.txt @@ -4,4 +4,10 @@ GLPK (open source) and CPLEX (not open source). If you have both GLPK and CPLEX, then it should be straightforward to add the appropriate paths and libs to the project properties by just editing what is in there now as that is specific -to a particular machine with the paths, etc. \ No newline at end of file +to a particular machine with the paths, etc. + +Here is a compile line for CPX_solve_wis : + g++ CPX_solve_wis.cpp -O2 -g -I../../lib_graphd/inc +-I/opt/ibm/ILOG/CPLEX_Studio125/cplex/include/ +-L/opt/ibm/ILOG/CPLEX_Studio125/cplex/lib/x86-64_sles10_4.1/static_pic/ +-L../../lib/ -lgraphd -lpthread -lcplex -lglpk From 2ebf21db5355120a6c56e85e295cf01f6ca396d1 Mon Sep 17 00:00:00 2001 From: Chris Groer Date: Sat, 31 Aug 2013 18:28:05 -0400 Subject: [PATCH 12/12] modifying CPX code to accept num_threads argument --- util/src/CPX_solve_wis.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/util/src/CPX_solve_wis.cpp b/util/src/CPX_solve_wis.cpp index 7db56a7..89e88ec 100755 --- a/util/src/CPX_solve_wis.cpp +++ b/util/src/CPX_solve_wis.cpp @@ -169,11 +169,18 @@ void usage(char *str) int main(int argc,char *argv[]) { - if(argc!=3) + if(argc<3) usage(argv[0]); char *DIMACS_file=argv[1]; // set time limit int max_secs=atoi(argv[2]); + int num_threads=-1; + if(argc>=4) + { + for(int i=3;i