Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
64ad4686
Commit
64ad4686
authored
Sep 02, 2017
by
Tiago Peixoto
Browse files
Change custom USING_OPENMP to standard _OPENMP
parent
ee1c9505
Changes
11
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
64ad4686
...
...
@@ -89,7 +89,6 @@ AC_ARG_ENABLE([openmp], [AS_HELP_STRING([--disable-openmp],[disable openmp [defa
[AX_OPENMP([], [USING_OPENMP=no]
[OPENMP_CXXFLAGS="-Wno-unknown-pragmas"])])
if test ${USING_OPENMP} = yes; then
AC_DEFINE([USING_OPENMP], 1, [using openmp])
dnl clang is retarded
if test "$(${CXX} --version | grep clang)x" != "x"; then
[OPENMP_LDFLAGS="-lomp ${OPENMP_LDFLAGS}"]
...
...
src/graph/clustering/graph_clustering.hh
View file @
64ad4686
...
...
@@ -23,7 +23,7 @@
#include "hash_map_wrap.hh"
#include <boost/mpl/if.hpp>
#ifdef
USING
_OPENMP
#ifdef _OPENMP
#include "omp.h"
#endif
...
...
src/graph/graph_openmp.cc
View file @
64ad4686
...
...
@@ -24,13 +24,13 @@ using namespace boost;
using
namespace
graph_tool
;
// OpenMP control
#ifdef
USING
_OPENMP
#ifdef _OPENMP
#include <omp.h>
#endif
bool
openmp_enabled
()
{
#ifdef
USING
_OPENMP
#ifdef _OPENMP
return
true
;
#else
return
false
;
...
...
@@ -39,7 +39,7 @@ bool openmp_enabled()
size_t
openmp_get_num_threads
()
{
#ifdef
USING
_OPENMP
#ifdef _OPENMP
return
omp_get_max_threads
();
#else
throw
GraphException
(
"OpenMP was not enabled during compilation"
);
...
...
@@ -48,7 +48,7 @@ size_t openmp_get_num_threads()
void
openmp_set_num_threads
(
int
n
)
{
#ifdef
USING
_OPENMP
#ifdef _OPENMP
omp_set_num_threads
(
n
);
#else
throw
GraphException
(
"OpenMP was not enabled during compilation"
);
...
...
@@ -57,7 +57,7 @@ void openmp_set_num_threads(int n)
python
::
tuple
openmp_get_schedule
()
{
#ifdef
USING
_OPENMP
#ifdef _OPENMP
omp_sched_t
kind
;
int
chunk
;
omp_get_schedule
(
&
kind
,
&
chunk
);
...
...
@@ -88,7 +88,7 @@ python::tuple openmp_get_schedule()
void
openmp_set_schedule
(
string
skind
,
int
chunk
)
{
#ifdef
USING
_OPENMP
#ifdef _OPENMP
omp_sched_t
kind
;
if
(
skind
==
"static"
)
kind
=
omp_sched_static
;
...
...
src/graph/graph_properties_imp1.cc
View file @
64ad4686
...
...
@@ -22,7 +22,7 @@
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef
USING
_OPENMP
#ifdef _OPENMP
#include <omp.h>
#endif
...
...
@@ -45,7 +45,7 @@ struct do_edge_endpoint
eprop_t
eprop
=
any_cast
<
eprop_t
>
(
aeprop
);
eprop
.
reserve
(
edge_index_range
);
#ifdef
USING
_OPENMP
#ifdef _OPENMP
size_t
__attribute__
((
unused
))
nt
=
omp_get_num_threads
();
if
(
std
::
is_convertible
<
val_t
,
python
::
object
>::
value
)
nt
=
1
;
// python is not thread-safe
...
...
src/graph/graph_properties_imp2.cc
View file @
64ad4686
...
...
@@ -22,7 +22,7 @@
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef
USING
_OPENMP
#ifdef _OPENMP
#include <omp.h>
#endif
...
...
@@ -164,7 +164,7 @@ struct do_out_edges_op
auto
vprop
=
boost
::
any_cast
<
VProp
>
(
avprop
).
get_unchecked
(
num_vertices
(
g
));
#ifdef
USING
_OPENMP
#ifdef _OPENMP
size_t
__attribute__
((
unused
))
nt
=
omp_get_num_threads
();
if
(
std
::
is_convertible
<
eval_t
,
python
::
object
>::
value
)
nt
=
1
;
// python is not thread-safe
...
...
src/graph/inference/bundled_vacate_loop.hh
View file @
64ad4686
...
...
@@ -27,7 +27,7 @@
#include "hash_map_wrap.hh"
#ifdef
USING
_OPENMP
#ifdef _OPENMP
#include <omp.h>
#endif
namespace
graph_tool
...
...
src/graph/inference/gibbs_loop.hh
View file @
64ad4686
...
...
@@ -28,7 +28,7 @@
#include "hash_map_wrap.hh"
#include "parallel_rng.hh"
#ifdef
USING
_OPENMP
#ifdef _OPENMP
#include <omp.h>
#endif
namespace
graph_tool
...
...
src/graph/inference/mcmc_loop.hh
View file @
64ad4686
...
...
@@ -28,7 +28,7 @@
#include "hash_map_wrap.hh"
#include "parallel_rng.hh"
#ifdef
USING
_OPENMP
#ifdef _OPENMP
#include <omp.h>
#endif
namespace
graph_tool
...
...
src/graph/inference/merge_loop.hh
View file @
64ad4686
...
...
@@ -28,7 +28,7 @@
#include "hash_map_wrap.hh"
#include "parallel_rng.hh"
#ifdef
USING
_OPENMP
#ifdef _OPENMP
#include <omp.h>
#endif
namespace
graph_tool
...
...
src/graph/inference/parallel_rng.hh
View file @
64ad4686
...
...
@@ -24,7 +24,7 @@ template <class RNG>
void
init_rngs
(
std
::
vector
<
std
::
shared_ptr
<
RNG
>>&
rngs
,
RNG
&
rng
)
{
size_t
num_threads
=
1
;
#ifdef
USING
_OPENMP
#ifdef _OPENMP
num_threads
=
omp_get_max_threads
();
#endif
for
(
size_t
i
=
0
;
i
<
num_threads
;
++
i
)
...
...
@@ -42,7 +42,7 @@ RNG& get_rng(std::vector<std::shared_ptr<RNG>>& rngs, RNG& rng)
if
(
rngs
.
empty
())
return
rng
;
size_t
tid
=
0
;
#ifdef
USING
_OPENMP
#ifdef _OPENMP
tid
=
omp_get_thread_num
();
#endif
return
*
rngs
[
tid
];
...
...
src/graph/util/graph_search.hh
View file @
64ad4686
...
...
@@ -22,7 +22,7 @@
#include "graph_util.hh"
#include "hash_map_wrap.hh"
#ifdef
USING
_OPENMP
#ifdef _OPENMP
#include <omp.h>
#include <boost/type_traits.hpp>
#endif
...
...
@@ -68,7 +68,7 @@ struct find_vertices
range
.
first
=
python
::
extract
<
value_type
>
(
prange
[
0
]);
range
.
second
=
python
::
extract
<
value_type
>
(
prange
[
1
]);
#ifdef
USING
_OPENMP
#ifdef _OPENMP
size_t
__attribute__
((
unused
))
nt
=
omp_get_num_threads
();
if
(
std
::
is_convertible
<
value_type
,
python
::
object
>::
value
)
nt
=
1
;
// python is not thread-safe
...
...
@@ -112,7 +112,7 @@ struct find_edges
gt_hash_set
<
size_t
>
edge_set
;
#ifdef
USING
_OPENMP
#ifdef _OPENMP
size_t
__attribute__
((
unused
))
nt
=
omp_get_num_threads
();
if
(
std
::
is_convertible
<
value_type
,
python
::
object
>::
value
)
nt
=
1
;
// python is not thread-safe
...
...
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