Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BLAS-join
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Google-TPU
BLAS-join
Commits
068cd1a2
Commit
068cd1a2
authored
Mar 15, 2019
by
Martin Perdacher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added 2 set join
parent
64a945a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
0 deletions
+92
-0
cmake/mainJoin.cpp
cmake/mainJoin.cpp
+92
-0
No files found.
cmake/mainJoin.cpp
0 → 100644
View file @
068cd1a2
// main method for a join with two sets
// for a self-join version see main.cpp
#include <stdio.h>
#include <omp.h>
#include <boost/lockfree/queue.hpp>
#include <boost/atomic.hpp>
#include "util/allocation.h"
#include "util/arguments.h"
#include "util/dataIo.h"
#include "blasJoin/blasJoin.h"
#ifndef COUNT_ONLY
size_t
consumer_count
;
int
consumer
(
boost
::
lockfree
::
queue
<
join_pair
>
&
queue
)
{
join_pair
jp
;
while
(
queue
.
pop
(
jp
)){
#pragma omp atomic write
consumer_count
=
consumer_count
+
1
;
// printf("%lu-%lu\n", jp.p1, jp.p2);
}
}
#endif
int
main
(
int
argc
,
char
**
argv
)
{
char
filename
[
255
]
=
""
;
char
filename2
[
255
]
=
""
;
double
watthours
=
0.0
;
bool
isBinary
=
false
;
double
*
x1
=
NULL
;
double
*
x2
=
NULL
;
size_t
threads
=
64
;
size_t
N
=
200
,
D
=
20
;
size_t
M
=
200
;
size_t
blocksize
=
4000
,
joinCounts
=
0
;
double
EPS
=
0.2
;
parsing_args_join
(
argc
,
argv
,
&
N
,
&
M
,
&
EPS
,
&
D
,
&
threads
,
&
blocksize
,
filename
,
filename2
,
&
isBinary
);
if
(
threads
!=
0
){
omp_set_num_threads
(
threads
);
}
boost
::
lockfree
::
queue
<
join_pair
>
queue
(
10000
);
x1
=
(
double
*
)
ddr_alloc
(
sizeof
(
double
)
*
N
*
D
);
x2
=
(
double
*
)
ddr_alloc
(
sizeof
(
double
)
*
M
*
D
);
if
(
strcmp
(
filename
,
""
)
==
0
)
{
random_init_unif
(
x1
,
N
,
D
,
1
);
}
else
{
read_file
(
x1
,
N
,
D
,
filename
,
isBinary
);
}
if
(
strcmp
(
filename2
,
""
)
==
0
)
{
random_init_unif
(
x2
,
M
,
D
,
2
);
}
else
{
read_file
(
x2
,
M
,
D
,
filename
,
isBinary
);
}
#ifdef COUNT_ONLY
blasJoinCountOnly
(
x1
,
N
,
x2
,
M
,
D
,
EPS
,
threads
,
blocksize
,
&
joinCounts
);
#else
// blasJoinStoreResults( x, N, D, EPS, threads, blocksize, &joinCounts, queue);
#endif
#ifndef COUNT_ONLY
// if we materialize with a non-blocking linked list, then joincounts are zero
#pragma omp parallel for
for
(
int
i
=
0
;
i
<
threads
;
i
++
){
consumer
(
queue
);
}
joinCounts
=
consumer_count
;
#endif
#pragma omp parallel
{
if
(
omp_get_thread_num
()
==
0
){
printf
(
"%ld;%ld;%2.12f;%ld;%d;%lu
\n
"
,
N
,
D
,
EPS
,
blocksize
,
omp_get_num_threads
(),
joinCounts
);
}
}
ddr_free
(
x1
);
ddr_free
(
x2
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment