Skip to content

Commit

Permalink
LLAMA/ Test performance, give the option to set the number of threads to
Browse files Browse the repository at this point in the history
use
  • Loading branch information
Dean De Leo committed Jun 22, 2020
1 parent 6322a95 commit 3c775b1
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions tests/test_performance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,20 @@ using namespace gfe::library;
using namespace std;

extern char** environ;

constexpr static int num_threads = 1;
constexpr static bool is_directed = false; // whether the graph is directed

static int num_threads_default = 1;
static int get_num_threads(){
static const char* gfe_num_threads = getenv("GFE_NUM_THREADS");
if(gfe_num_threads == nullptr){
cout << "Warning: env. var. GFE_NUM_THREADS not set. Using the default: " << num_threads_default << endl;
return num_threads_default;
} else {
return atoi(gfe_num_threads);
}
}


static const string path_graph_default = common::filesystem::directory_executable() + "/graphs/ldbc_graphalytics/example-undirected.properties";
static string get_path_graph(){
static const char* path_graph = getenv("GFE_PATH_GRAPH");
Expand Down Expand Up @@ -77,8 +87,8 @@ TEST(Performance, InsertOnly) {
cout << "Graph loaded in " << timer << "\n";
stream->permute(1910);


cout << "[Performance::InsertOnly] Executing the insertions ...\n";
int num_threads = get_num_threads();
cout << "[Performance::InsertOnly] Executing the insertions using " << num_threads << " threads ...\n";
timer.start();
InsertOnly experiment(impl, move(stream), num_threads);
experiment.execute();
Expand All @@ -99,8 +109,8 @@ TEST(Performance, LCC) {
cout << "Graph loaded in " << timer << "\n";
stream->permute(1910);


cout << "[Performance::LCC] Executing the insertions ...\n";
int num_threads = get_num_threads();
cout << "[Performance::LCC] Executing the insertions using " << num_threads << " threads ...\n";
timer.start();
InsertOnly experiment(impl, move(stream), num_threads);
experiment.execute();
Expand All @@ -127,15 +137,14 @@ static void _test_perf_run_llama(){
cout << "Graph loaded in " << timer << "\n";
stream->permute(1910);


cout << "[Performance::LLAMA_Iterator_Overhead] Executing the insertions ...\n";
int num_threads = get_num_threads();
cout << "[Performance::LLAMA_Iterator_Overhead] Executing the insertions using " << num_threads << " threads...\n";
timer.start();
InsertOnly experiment(impl, move(stream), num_threads);
experiment.execute();
timer.stop();
cout << "Execution completed in " << timer << "\n";


uint64_t num_iterations = get_num_iterations();
uint64_t num_vertices = impl->num_vertices();
cout << "[Performance::LLAMA_Iterator_Overhead] Initialising " << num_iterations << " the output iterator...\n";
Expand Down

0 comments on commit 3c775b1

Please sign in to comment.