Added max_no_threads.

It is meant for easily change no threads in concurrent tests.
This commit is contained in:
Kruno Tomola Fabro 2016-09-13 18:08:34 +01:00
parent a6f72dc3fd
commit 9bd845a62e
23 changed files with 23 additions and 21 deletions

View File

@ -20,6 +20,9 @@
#include "logging/streams/stdout.hpp"
#include "utils/sysinfo/memory.hpp"
// Sets max number of threads that will be used in concurrent tests.
constexpr int max_no_threads=8;
using std::cout;
using std::endl;
using map_t = ConcurrentMap<int, int>;

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t key_range = 1e2;
constexpr size_t op_per_thread = 1e5;
// Depending on value there is a possiblity of numerical overflow

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t op_per_thread = 1e5;
constexpr size_t bit_part_len = 2;
constexpr size_t no_slots = 1e4;

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 4
constexpr size_t THREADS_NO = std::min(max_no_threads, 4);
constexpr size_t op_per_thread = 1e5;
constexpr size_t up_border_bit_set_pow2 = 3;
constexpr size_t key_range =

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t op_per_thread = 1e5;
constexpr size_t key_range = op_per_thread * THREADS_NO * 3;

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 4
constexpr size_t THREADS_NO = std::min(max_no_threads, 4);
constexpr size_t op_per_thread = 1e5;
constexpr size_t up_border_bit_set_pow2 = 3;
constexpr size_t key_range =

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t elems_per_thread = 100000;
constexpr size_t key_range = elems_per_thread * THREADS_NO * 2;

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t elems_per_thread = 100000;
constexpr size_t key_range = elems_per_thread * THREADS_NO * 2;

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t elems_per_thread = 1e5;
int main()

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t elements = 2e6;

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 1
constexpr size_t THREADS_NO = std::min(max_no_threads, 1);
constexpr size_t elems_per_thread = 16e5;
// Known memory leak at 1,600,000 elements.

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t key_range = 1e4;
constexpr size_t op_per_thread = 1e5;
// Depending on value there is a possiblity of numerical overflow

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t key_range = 1e4;
constexpr size_t op_per_thread = 1e5;
// Depending on value there is a possiblity of numerical overflow

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 4
constexpr size_t THREADS_NO = std::min(max_no_threads, 4);
constexpr size_t key_range = 1e4;
constexpr size_t op_per_thread = 1e5;
// Depending on value there is a possiblity of numerical overflow

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t key_range = 1e4;
constexpr size_t op_per_thread = 1e5;
// Depending on value there is a possiblity of numerical overflow

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t key_range = 1e4;
constexpr size_t op_per_thread = 1e5;
constexpr size_t no_insert_for_one_delete = 1;

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t op_per_thread = 1e5;
// Depending on value there is a possiblity of numerical overflow
constexpr size_t max_number = 10;

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t key_range = 1e5;
constexpr size_t op_per_thread = 1e6;
constexpr size_t no_insert_for_one_delete = 1;

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t key_range = 1e4;
constexpr size_t op_per_thread = 1e5;
// Depending on value there is a possiblity of numerical overflow

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t key_range = 1e4;
constexpr size_t op_per_thread = 1e5;
constexpr size_t no_insert_for_one_delete = 2;

View File

@ -1,6 +1,6 @@
#include "common.h"
#define THREADS_NO 8
constexpr size_t THREADS_NO = std::min(max_no_threads, 8);
constexpr size_t key_range = 1e5;
constexpr size_t op_per_thread = 1e6;
// Depending on value there is a possiblity of numerical overflow

View File

@ -188,7 +188,6 @@ int main(void)
// empty database
// import snapshot
// assert database empty
Db db("snapshot", false);
db.snap_engine.make_snapshot();
run(cvl_n, create_vertex_label, db);

View File