Skip to content

Commit

Permalink
[Teseo] Explicitly set the thread affinity
Browse files Browse the repository at this point in the history
It turns out that the env. vars for the OpenMP thread affinity are
completely ignored by Clang and have a global effect, that is, they
affect all threads, in GCC. With this patch, avoid using the env.
vars for OpenMP to set the thread affinity, but set it manually
through proper pthread function calls upon necessity.
  • Loading branch information
Dean De Leo committed Jan 5, 2021
1 parent c4cd550 commit 1acdb0e
Show file tree
Hide file tree
Showing 14 changed files with 670 additions and 811 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ ifneq (,$(findstring -DHAVE_GRAPHONE,${ALL_CPPFLAGS}))
sources += $(addprefix library/graphone/, graphone.cpp)
endif
ifneq (,$(findstring -DHAVE_TESEO,${ALL_CPPFLAGS}))
sources += $(addprefix library/teseo/, teseo_driver.cpp teseo_real_vtx.cpp)
sources += $(addprefix library/teseo/, teseo_driver.cpp teseo_openmp.cpp teseo_real_vtx.cpp)
endif
ifneq (,$(findstring -DHAVE_LIVEGRAPH,${ALL_CPPFLAGS}))
sources += $(addprefix library/livegraph/, livegraph_driver.cpp)
Expand Down
2 changes: 0 additions & 2 deletions library/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ std::unique_ptr<Interface> generate_teseo_real_vtx(bool directed_graph){
std::unique_ptr<Interface> generate_teseo_real_vtx_lcc(bool directed_graph){
return unique_ptr<Interface>{ new TeseoRealVerticesLCC(directed_graph) };
}


#endif

vector<ImplementationManifest> implementations() {
Expand Down
260 changes: 102 additions & 158 deletions library/teseo/teseo_driver.cpp

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion library/teseo/teseo_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class TeseoDriver : public virtual UpdateInterface, public virtual GraphalyticsI
void* m_pImpl; // pointer to the teseo library
const bool m_is_directed; // whether the underlying graph is directed or undirected
const bool m_read_only; // whether to used read only transactions for graphalytics
bool m_thread_affinity; // whether to enable the thread affinity in graphalytics
std::chrono::seconds m_timeout { 0 }; // the budget to complete each of the algorithms in the Graphalytics suite

public:
Expand Down Expand Up @@ -83,6 +84,21 @@ class TeseoDriver : public virtual UpdateInterface, public virtual GraphalyticsI
*/
virtual void set_timeout(uint64_t seconds);

/**
* Whether to restrict the execution of the OpenMP threads in sockets
*/
virtual void set_thread_affinity(bool value);

/**
* Whether thread affinity is set
*/
virtual bool has_thread_affinity() const;

/**
* Whether Graphalytics transactions should be `read-only'
*/
virtual bool has_read_only_transactions() const;

/**
* Add the given vertex to the graph
* @return true if the vertex has been inserted, false otherwise (that is, the vertex already exists)
Expand Down Expand Up @@ -169,7 +185,7 @@ class TeseoDriver : public virtual UpdateInterface, public virtual GraphalyticsI
virtual void sssp(uint64_t source_vertex_id, const char* dump2file = nullptr);

/**
* Retrieve the handle to the implementation, for debugging pruposes
* Retrieve the handle to the Teseo implementation
*/
void* handle_impl();
};
Expand Down
Loading

0 comments on commit 1acdb0e

Please sign in to comment.