Skip to content

Commit

Permalink
remove unnecessary stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
imilinovic committed Jan 17, 2024
1 parent 202473d commit 7973517
Show file tree
Hide file tree
Showing 23 changed files with 44 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

using namespace std;

double parallelLouvianMethodNoMap(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double parallelLouvianMethodNoMap(graph *G, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr) {
#ifdef PRINT_DETAILED_STATS_
#endif
Expand Down Expand Up @@ -109,7 +109,7 @@ double parallelLouvianMethodNoMap(graph *G, mgp_graph *mg_graph, long *C, int nT

//Initialize each vertex to its own cluster
// initCommAss(pastCommAss, currCommAss, NV);
initCommAssOpt(pastCommAss, currCommAss, NV, clusterLocalMap, vtxPtr, vtxInd, cInfo, constantForSecondTerm, vDegree, mg_graph);
initCommAssOpt(pastCommAss, currCommAss, NV, clusterLocalMap, vtxPtr, vtxInd, cInfo, constantForSecondTerm, vDegree);

time2 = omp_get_wtime();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

using namespace std;

double parallelLouvianMethodNoMapFastTrackResistance(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double parallelLouvianMethodNoMapFastTrackResistance(graph *G, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr, int phase, double* rmin, double* finMod) {
#ifdef PRINT_DETAILED_STATS_
#endif
Expand Down Expand Up @@ -110,7 +110,7 @@ double parallelLouvianMethodNoMapFastTrackResistance(graph *G, mgp_graph *mg_gra

//Initialize each vertex to its own cluster
// initCommAss(pastCommAss, currCommAss, NV);
initCommAssOpt(pastCommAss, currCommAss, NV, clusterLocalMap, vtxPtr, vtxInd, cInfo, constantForSecondTerm, vDegree, mg_graph);
initCommAssOpt(pastCommAss, currCommAss, NV, clusterLocalMap, vtxPtr, vtxInd, cInfo, constantForSecondTerm, vDegree);

time2 = omp_get_wtime();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void runMultiPhaseBasic(graph *G, mgp_graph *mg_graph, long *C_orig, int basicOp


if(basicOpt == 1){
currMod = parallelLouvianMethodNoMap(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
currMod = parallelLouvianMethodNoMap(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
}else if(threadsOpt == 1){
currMod = parallelLouvianMethod(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
//currMod = parallelLouvianMethodApprox(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
Expand Down Expand Up @@ -175,7 +175,7 @@ void runMultiPhaseBasicOnce(graph *G, mgp_graph *mg_graph, long *C_orig, int bas
prevMod = currMod;

if(basicOpt == 1){
currMod = parallelLouvianMethodNoMap(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
currMod = parallelLouvianMethodNoMap(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
}else if(threadsOpt == 1){
currMod = parallelLouvianMethod(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
//currMod = parallelLouvianMethodApprox(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void runMultiPhaseBasicApprox(graph *G, mgp_graph *mg_graph, long *C_orig, int b


if(basicOpt == 1){
currMod = parallelLouvianMethodNoMap(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
currMod = parallelLouvianMethodNoMap(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
}else if(threadsOpt == 1){
//currMod = parallelLouvianMethod(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
currMod = parallelLouvianMethodApprox(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr, percentage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void runMultiPhaseBasicFastTrackResistance(graph *G, mgp_graph *mg_graph, long *

// TODO add coloring routines when the basic has stabilized
if(basicOpt == 1){
currModAFG = parallelLouvianMethodNoMapFastTrackResistance(G, mg_graph, C, numThreads, currModAFG, threshold, &tmpTime, &tmpItr, phase, &rmin, &finMod);
currModAFG = parallelLouvianMethodNoMapFastTrackResistance(G, C, numThreads, currModAFG, threshold, &tmpTime, &tmpItr, phase, &rmin, &finMod);
}else if(threadsOpt == 1){
currModAFG = parallelLouvianMethodFastTrackResistance(G, mg_graph, C, numThreads, currModAFG, threshold, &tmpTime, &tmpItr, phase, &rmin, &finMod);
}else{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
////////////////////////// DISTANCE ONE COLORING ///////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
//Return the number of colors used (zero is a valid color)
int algoDistanceOneVertexColoringOpt(graph *G, mgp_graph *mg_graph, int *vtxColor, int nThreads, double *totTime)
int algoDistanceOneVertexColoringOpt(graph *G, int *vtxColor, int nThreads, double *totTime)
{
#ifdef PRINT_DETAILED_STATS_
#endif
Expand Down Expand Up @@ -216,7 +216,7 @@ int algoDistanceOneVertexColoringOpt(graph *G, mgp_graph *mg_graph, int *vtxColo
////////////////////////// DISTANCE ONE COLORING ///////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
//Return the number of colors used (zero is a valid color)
int algoDistanceOneVertexColoring(graph *G, mgp_graph *mg_graph, int *vtxColor, int nThreads, double *totTime)
int algoDistanceOneVertexColoring(graph *G, int *vtxColor, int nThreads, double *totTime)
{
if (nThreads < 1)
omp_set_num_threads(1); //default to one thread
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void generateRandomNumbers2(double* randValues, long NVer)
}
}

int algoColoringMultiHashMaxMin(graph *G, mgp_graph *mg_graph, int *vtxColor, int nThreads, double *totTime, int nHash, int nItrs)
int algoColoringMultiHashMaxMin(graph *G, int *vtxColor, int nThreads, double *totTime, int nHash, int nItrs)
{
#ifdef PRINT_DETAILED_STATS_
std::cout << "Within algoColoringMultiHashMaxMin(nHash= " << nHash << " -- nItrs= " << nItrs << ")\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include "color_comm.h"
using namespace std;

double algoLouvainWithDistOneColoringNoMap(graph* G, mgp_graph *mg_graph, long *C, int nThreads, int* color,
double algoLouvainWithDistOneColoringNoMap(graph* G, long *C, int nThreads, int* color,
int numColor, double Lower, double thresh, double *totTime, int *numItr) {
#ifdef PRINT_DETAILED_STATS_
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void runMultiPhaseColoring(graph *G, mgp_graph *mg_graph, long *C_orig, int colo
int nColors = 0;
// Coloring Steps
if((coloring == 1)||(coloring == 2)) {
nColors = algoDistanceOneVertexColoringOpt(G, mg_graph, colors, numThreads, &tmpTime)+1;
nColors = algoDistanceOneVertexColoringOpt(G, colors, numThreads, &tmpTime)+1;
totTimeColoring += tmpTime;
//Check if balanced coloring is enabled:
if(coloring == 2)
Expand All @@ -80,7 +80,7 @@ void runMultiPhaseColoring(graph *G, mgp_graph *mg_graph, long *C_orig, int colo
if (nItrs <= 0)
nItrs = 1;
//int nItrs = numColors / 4;
nColors = algoColoringMultiHashMaxMin(G, mg_graph, colors, numThreads, &tmpTime, nHash, nItrs)+1;
nColors = algoColoringMultiHashMaxMin(G, colors, numThreads, &tmpTime, nHash, nItrs)+1;
totTimeColoring += tmpTime;
}

Expand All @@ -105,14 +105,14 @@ void runMultiPhaseColoring(graph *G, mgp_graph *mg_graph, long *C_orig, int colo
if(nonColor == false) {
//Use higher modularity for the first few iterations when graph is big enough
if (replaceMap == 1)
currMod = algoLouvainWithDistOneColoringNoMap(G, mg_graph, C, numThreads, colors, nColors, currMod, C_threshold, &tmpTime, &tmpItr);
currMod = algoLouvainWithDistOneColoringNoMap(G, C, numThreads, colors, nColors, currMod, C_threshold, &tmpTime, &tmpItr);
else
currMod = algoLouvainWithDistOneColoring(G, mg_graph, C, numThreads, colors, nColors, currMod, C_threshold, &tmpTime, &tmpItr);
totTimeClustering += tmpTime;
totItr += tmpItr;
} else {
if (replaceMap == 1)
currMod = parallelLouvianMethodNoMap(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
currMod = parallelLouvianMethodNoMap(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
else
currMod = parallelLouvianMethod(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
totTimeClustering += tmpTime;
Expand Down Expand Up @@ -171,7 +171,7 @@ void runMultiPhaseColoring(graph *G, mgp_graph *mg_graph, long *C_orig, int colo
nColors = 0;
// Coloring Steps
if((coloring == 1)||(coloring == 2)) {
nColors = algoDistanceOneVertexColoringOpt(G, mg_graph, colors, numThreads, &tmpTime)+1;
nColors = algoDistanceOneVertexColoringOpt(G, colors, numThreads, &tmpTime)+1;
totTimeColoring += tmpTime;
//Check if balanced coloring is enabled:
if(coloring == 2)
Expand All @@ -185,7 +185,7 @@ void runMultiPhaseColoring(graph *G, mgp_graph *mg_graph, long *C_orig, int colo
if (nItrs <= 0)
nItrs = 1;
//int nItrs = numColors / 4;
nColors = algoColoringMultiHashMaxMin(G, mg_graph, colors, numThreads, &tmpTime, nHash, nItrs)+1;
nColors = algoColoringMultiHashMaxMin(G, colors, numThreads, &tmpTime, nHash, nItrs)+1;
totTimeColoring += tmpTime;
}
}
Expand Down
1 change: 0 additions & 1 deletion cpp/community_detection_module/grappolo/Coloring/vBase.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <mg_procedure.h>
#include "coloringUtils.h"
#include "defs.h"
#include "coloring.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ double parallelLouvianMethod(graph *G, mgp_graph *mg_graph, long *C, int nThread
double parallelLouvianMethodApprox(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr, int percentage);

double parallelLouvianMethodNoMap(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double parallelLouvianMethodNoMap(graph *G, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr);

double parallelLouvianMethodScale(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
Expand All @@ -41,7 +41,7 @@ double parallelLouvianMethodFastTrackResistance(graph *G, mgp_graph *mg_graph, l
double thresh, double *totTime, int *numItr, int phase, double* rmin, double* finMod);

// Define in parallelLouvianMethodNoMapFastTrackResistance.cpp
double parallelLouvianMethodNoMapFastTrackResistance(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double parallelLouvianMethodNoMapFastTrackResistance(graph *G, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr, int phase, double* rmin, double* finMod);

// Define in parallelLouvianMethodScaleFastTrackResistance.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void runMultiPhaseColoring(graph *G, mgp_graph *mg_graph, long *C_orig, int colo
double algoLouvainWithDistOneColoring(graph* G, mgp_graph *mg_graph, long *C, int nThreads, int* color,
int numColor, double Lower, double thresh, double *totTime, int *numItr);

double algoLouvainWithDistOneColoringNoMap(graph* G, mgp_graph *mg_graph, long *C, int nThreads, int* color,
double algoLouvainWithDistOneColoringNoMap(graph* G, long *C, int nThreads, int* color,
int numColor, double Lower, double thresh, double *totTime, int *numItr);

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#include "coloringUtils.h"

// In coloringDistanceOne.cpp
int algoDistanceOneVertexColoringOpt(graph *G, mgp_graph *mg_graph, int *vtxColor, int nThreads, double *totTime);
int algoDistanceOneVertexColoring(graph *G, mgp_graph *mg_graph, int *vtxColor, int nThreads, double *totTime);
int algoDistanceOneVertexColoringOpt(graph *G, int *vtxColor, int nThreads, double *totTime);
int algoDistanceOneVertexColoring(graph *G, int *vtxColor, int nThreads, double *totTime);

// In ColoringMultiHasMaxMin.cpp
int algoColoringMultiHashMaxMin(graph *G, mgp_graph *mg_graph, int *vtxColor, int nThreads, double *totTime, int nHash, int nItrs);
int algoColoringMultiHashMaxMin(graph *G, int *vtxColor, int nThreads, double *totTime, int nHash, int nItrs);

// In vBase.cpp
int vBaseRedistribution(graph* G, int* vtxColor, int ncolors, int type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct clustering_parameters
};

//Reverse Cuthill-McKee Algorithm
void algoReverseCuthillMcKee( graph *G, mgp_graph *mg_graph, long *pOrder, int nThreads );
void algoReverseCuthillMcKee( graph *G, long *pOrder, int nThreads );
void algoReverseCuthillMcKeeStrict( graph *G, long *pOrder, int nThreads );

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
void runMultiPhaseSyncType(graph *G, mgp_graph *mg_graph, long *C_orig, int syncType, long minGraphSize,
double threshold, double C_threshold, int numThreads, int threadsOpt);

double parallelLouvainMethodFullSyncEarly(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double parallelLouvainMethodFullSyncEarly(graph *G, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr,int ytype, int freedom);

double parallelLouvainMethodFullSync(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double parallelLouvainMethodFullSync(graph *G, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr,int ytype, int freedom);

double parallelLouvianMethodEarlyTerminate(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double parallelLouvianMethodEarlyTerminate(graph *G, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr);

// Define in fullSyncUtility.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void initCommAss(long* pastCommAss, long* currCommAss, long NV);

void initCommAssOpt(long* pastCommAss, long* currCommAss, long NV,
mapElement* clusterLocalMap, long* vtxPtr, edge* vtxInd,
Comm* cInfo, double constant, double* vDegree, mgp_graph *mg_graph);
Comm* cInfo, double constant, double* vDegree);

double buildLocalMapCounter(long adj1, long adj2, map<long, long> &clusterLocalMap,
vector<double> &Counter, edge* vtxInd, long* currCommAss, long me);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@
// ************************************************************************

#include "defs.h"
#include "mg_procedure.h"
#include "utilityClusteringFunctions.h"
#include "sync_comm.h"

using namespace std;

double parallelLouvianMethodEarlyTerminate(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double parallelLouvianMethodEarlyTerminate(graph *G, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr) {
#ifdef PRINT_DETAILED_STATS_
#endif
Expand Down Expand Up @@ -110,7 +109,7 @@ double parallelLouvianMethodEarlyTerminate(graph *G, mgp_graph *mg_graph, long *

//Initialize each vertex to its own cluster
// initCommAss(pastCommAss, currCommAss, NV);
initCommAssOpt(pastCommAss, currCommAss, NV, clusterLocalMap, vtxPtr, vtxInd, cInfo, constantForSecondTerm, vDegree, mg_graph);
initCommAssOpt(pastCommAss, currCommAss, NV, clusterLocalMap, vtxPtr, vtxInd, cInfo, constantForSecondTerm, vDegree);

// Store the termination node
bool* verT = (bool *) malloc (NV * sizeof(bool)); assert(verT != 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@
// ************************************************************************

#include "defs.h"
#include "mg_procedure.h"
#include "utilityClusteringFunctions.h"
#include "sync_comm.h"

using namespace std;

double parallelLouvainMethodFullSync(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double parallelLouvainMethodFullSync(graph *G, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr,int ytype, int freedom) {
#ifdef PRINT_DETAILED_STATS_
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@
// ************************************************************************

#include "defs.h"
#include "mg_procedure.h"
#include "utilityClusteringFunctions.h"
#include "sync_comm.h"

using namespace std;

double parallelLouvainMethodFullSyncEarly(graph *G, mgp_graph *mg_graph, long *C, int nThreads, double Lower,
double parallelLouvainMethodFullSyncEarly(graph *G, long *C, int nThreads, double Lower,
double thresh, double *totTime, int *numItr,int ytype, int freedom) {
#ifdef PRINT_DETAILED_STATS_
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,30 @@ void runMultiPhaseSyncType(graph *G, mgp_graph *mg_graph, long *C_orig, int sync
if(nonET == false) {
switch (syncType){
case 2:
currMod = parallelLouvainMethodFullSync(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr,syncType, freedom);
currMod = parallelLouvainMethodFullSync(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr,syncType, freedom);
break;
case 4:
currMod = parallelLouvainMethodFullSyncEarly(G, mg_graph, C, numThreads, currMod, C_threshold, &tmpTime, &tmpItr,syncType, freedom);
currMod = parallelLouvainMethodFullSyncEarly(G, C, numThreads, currMod, C_threshold, &tmpTime, &tmpItr,syncType, freedom);
break;
case 3:
currMod = parallelLouvianMethodEarlyTerminate(G, mg_graph, C, numThreads, currMod, C_threshold, &tmpTime, &tmpItr); break;
currMod = parallelLouvianMethodEarlyTerminate(G, C, numThreads, currMod, C_threshold, &tmpTime, &tmpItr); break;
default:
currMod = parallelLouvainMethodFullSync(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr,syncType, freedom);
currMod = parallelLouvainMethodFullSync(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr,syncType, freedom);
break;
}
} else {
switch (syncType){
case 2:
currMod = parallelLouvainMethodFullSync(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr,syncType, freedom);
currMod = parallelLouvainMethodFullSync(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr,syncType, freedom);
break;
case 4:
currMod = parallelLouvainMethodFullSyncEarly(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr,syncType, freedom);
currMod = parallelLouvainMethodFullSyncEarly(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr,syncType, freedom);
break;
case 3:
currMod = parallelLouvianMethodEarlyTerminate(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
currMod = parallelLouvianMethodEarlyTerminate(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr);
break;
default:
currMod = parallelLouvainMethodFullSync(G, mg_graph, C, numThreads, currMod, threshold, &tmpTime, &tmpItr,syncType, freedom);
currMod = parallelLouvainMethodFullSync(G, C, numThreads, currMod, threshold, &tmpTime, &tmpItr,syncType, freedom);
break;
}
nonET = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ double buildNextLevelGraphOpt(graph *Gin, mgp_graph *mg_graph, graph *Gout, long
}//End of buildNextLevelGraph2()

//WARNING: Will assume that the cluster ids have been renumbered contiguously
void buildNextLevelGraph(graph *Gin, mgp_graph *mg_graph, graph *Gout, long *C, long numUniqueClusters) {
void buildNextLevelGraph(graph *Gin, graph *Gout, long *C, long numUniqueClusters) {
#ifdef PRINT_DETAILED_STATS_
#endif
double time1, time2, time3, time4; //For timing purposes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// Perform reverse Cuthill-McKee operation on the graph
// SSize indicates the size of Source
// Sets the pointer in isChordal from one direction ONLY
void algoReverseCuthillMcKee(graph *G, mgp_graph *mg_graph, long *pOrder, int nThreads )
void algoReverseCuthillMcKee(graph *G, long *pOrder, int nThreads )
{
if (nThreads < 1)
omp_set_num_threads(1);
Expand Down
Loading

0 comments on commit 7973517

Please sign in to comment.