fast
This commit is contained in:
parent
2a8d045463
commit
9a0c0f77da
@ -9,4 +9,5 @@ typedef struct {
|
||||
//----------------------------------------------------------
|
||||
// Functions
|
||||
|
||||
void rev_mc(size_t sets_cnt, size_t threshold, size_t rounds, size_t m_size, char *o_file, uint64_t flags);
|
||||
void
|
||||
rev_mc(size_t sets_cnt, size_t threshold, size_t rounds, size_t m_size, char *o_file, uint64_t flags, uint64_t cpu);
|
||||
|
@ -57,6 +57,7 @@ main(int argc, char **argv)
|
||||
size_t rounds = ROUNDS_std;
|
||||
size_t m_size = MEM_SIZE_std;
|
||||
size_t threshold = THRESHOLD_std;
|
||||
size_t cpu = 1;
|
||||
char *o_file = (char *) O_FILE_std;
|
||||
|
||||
flags |= F_POPULATE;
|
||||
@ -74,7 +75,7 @@ main(int argc, char **argv)
|
||||
{"mem", required_argument, 0, 0},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
int arg = getopt_long(argc, argv, "o:s:r:t:hv", long_options, &option_index);
|
||||
int arg = getopt_long(argc, argv, "o:s:r:t:n:hv", long_options, &option_index);
|
||||
|
||||
if (arg == -1) break;
|
||||
|
||||
@ -99,6 +100,8 @@ main(int argc, char **argv)
|
||||
case 'r':
|
||||
rounds = atoi(optarg);
|
||||
break;
|
||||
case 'n':
|
||||
cpu = atoi(optarg);
|
||||
case 't':
|
||||
threshold = atoi(optarg);
|
||||
break;
|
||||
@ -112,7 +115,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
rev_mc(sets_cnt, threshold, rounds, m_size, o_file, flags);
|
||||
rev_mc(sets_cnt, threshold, rounds, m_size, o_file, flags, cpu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,9 @@ find_row_mask(std::vector<set_t> &sets,
|
||||
// }
|
||||
|
||||
std::vector<std::thread> workers;
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
auto thread_num = std::thread::hardware_concurrency();
|
||||
if (thread_num > 2) { thread_num -= 2; }
|
||||
for (int i = 0; i < thread_num; ++i) {
|
||||
workers.emplace_back([&] {
|
||||
while (!found) {
|
||||
uint64_t cur_mask = last_mask;
|
||||
@ -361,7 +363,7 @@ find_row_mask(std::vector<set_t> &sets,
|
||||
|
||||
//----------------------------------------------------------
|
||||
void
|
||||
rev_mc(size_t sets_cnt, size_t threshold, size_t rounds, size_t m_size, char *o_file, uint64_t flags)
|
||||
rev_mc(size_t sets_cnt, size_t threshold, size_t rounds, size_t m_size, char *o_file, uint64_t flags, uint64_t cpu)
|
||||
{
|
||||
|
||||
time_t t;
|
||||
|
Loading…
x
Reference in New Issue
Block a user