Skip to content
Snippets Groups Projects
Commit d959eac0 authored by gianlucarossi15's avatar gianlucarossi15
Browse files

minor changes

parent a730de6b
No related branches found
No related tags found
1 merge request!1New code version
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#include "io.h" #include "io.h"
#include <string> #include <string>
#include "hash.h" #include "hash.h"
#include <omp.h>
#include <pthread.h> //#include <pthread.h>
#define NUM_TRIALS 10 #define NUM_TRIALS 10
...@@ -14,17 +14,7 @@ ...@@ -14,17 +14,7 @@
using namespace std; using namespace std;
namespace po = boost::program_options; namespace po = boost::program_options;
static void *handler(void *args){
string mode = *(string *) args;
if(mode=="Random"){
g2 = compress_graph_basic(g, var["depth"].as<int>(), var["proportions"].as<vector<double>>(),
var["directed"].as<bool>());
}else if(mode=="LP"){
g2 = compress_graph_LP(g, e_s, var["depth"].as<int>(), var["proportions"].as<vector<double>>(),
var["directed"].as<bool>());
}
}
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
...@@ -74,10 +64,8 @@ int main(int argc, char *argv[]) { ...@@ -74,10 +64,8 @@ int main(int argc, char *argv[]) {
auto start = chrono::steady_clock::now(); auto start = chrono::steady_clock::now();
string execMode=var["algorithm"].as<string>(); string execMode=var["algorithm"].as<string>();
#include <omp.h>
#include <chrono>
#include <vector>
#include <string>
// Assuming NUM_TRIALS and other variables are defined somewhere // Assuming NUM_TRIALS and other variables are defined somewhere
...@@ -86,7 +74,7 @@ int main(int argc, char *argv[]) { ...@@ -86,7 +74,7 @@ int main(int argc, char *argv[]) {
// Inside the loop, each thread will execute one iteration // Inside the loop, each thread will execute one iteration
// Each thread will create a separate graph instance, so make sure g2 is declared inside the loop // Each thread will create a separate graph instance, so make sure g2 is declared inside the loop
Graph g2;
// Other variables like edges_original and edges_compressed need to be declared thread-safe or local to each thread // Other variables like edges_original and edges_compressed need to be declared thread-safe or local to each thread
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment