Skip to content

Commit

Permalink
Setting up stinger_traversal_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpoovey committed Oct 20, 2015
1 parent 92c6319 commit 6cba987
Show file tree
Hide file tree
Showing 8 changed files with 600 additions and 28 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ enable_testing()
add_test(NamesTest ${CMAKE_BINARY_DIR}/bin/stinger_names_test)
add_test(StingerCoreTest ${CMAKE_BINARY_DIR}/bin/stinger_core_test)
add_test(StingerPhysmapTest ${CMAKE_BINARY_DIR}/bin/stinger_physmap_test)
add_test(StingerTraversalTest ${CMAKE_BINARY_DIR}/bin/stinger_traversal_test)

add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -E env CTEST_OUTPUT_ON_FAILURE=1 --verbose DEPENDS stinger_names_test stinger_core_test stinger_physmap_test)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -E env CTEST_OUTPUT_ON_FAILURE=1 --verbose DEPENDS stinger_names_test stinger_core_test stinger_physmap_test stinger_traversal_test)

47 changes: 21 additions & 26 deletions lib/stinger_core/inc/stinger_traversal.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ extern "C" {
int64_t source__ = current_eb__->vertexID; \
int64_t type__ = current_eb__->etype; \
for(uint64_t i__ = 0; i__ < stinger_eb_high(current_eb__); i__++) { \
if(!stinger_eb_is_blank(current_eb__, i__)) { \
struct stinger_edge * current_edge__ = current_eb__->edges + i__;
if(!stinger_eb_is_blank(current_eb__, i__)) { \
struct stinger_edge * current_edge__ = current_eb__->edges + i__;

#define STINGER_PARALLEL_FORALL_EDGES_END() \
} \
Expand Down Expand Up @@ -316,13 +316,13 @@ extern "C" {
} OMP("omp taskwait"); \
} while (0)

#define STINGER_READ_ONLY_PARALLEL_FORALL_EDGES_OF_TYPE_OF_VTX_BEGIN(STINGER_,VTX_) \
#define STINGER_READ_ONLY_PARALLEL_FORALL_EDGES_OF_TYPE_OF_VTX_BEGIN(STINGER_,TYPE_,VTX_) \
do { \
CONST_MAP_STING(STINGER_); \
const struct stinger * restrict S__ = (STINGER_); \
struct stinger_eb * ebpool_priv = ebpool->ebpool; \
const struct stinger_eb * ebpool_priv = ebpool->ebpool; \
OMP("omp parallel") { \
struct stinger_eb * restrict ebp__ = ebpool; \
const struct stinger_eb * restrict ebp__ = ebpool->ebpool; \
const int64_t source__ = (VTX_); \
const int64_t etype__ = (TYPE_); \
OMP("omp single") { \
Expand Down Expand Up @@ -351,7 +351,7 @@ extern "C" {
/* all edges of a given type */
#define STINGER_READ_ONLY_FORALL_EDGES_BEGIN(STINGER_,TYPE_) \
do { \
CONST_MAP_STING(STINGER_); \
CONST_MAP_STING(STINGER_); \
const struct stinger * restrict S__ = (STINGER_); \
const struct stinger_eb * restrict ebp__ = ebpool->ebpool; \
const int64_t etype__ = (TYPE_); \
Expand All @@ -374,30 +374,25 @@ extern "C" {

#define STINGER_READ_ONLY_PARALLEL_FORALL_EDGES_BEGIN(STINGER_,TYPE_) \
do { \
CONST_MAP_STING(STINGER_); \
CONST_MAP_STING(STINGER_); \
const struct stinger * restrict S__ = (STINGER_); \
const int64_t etype__ = (TYPE_); \
const struct stinger_eb * restrict ebp__ = ebpool->ebpool; \
OMP("omp parallel") { \
OMP("omp single") { \
for(uint64_t p__ = 0; p__ < ETA((STINGER_),(TYPE_))->high; p__++) { \
int64_t ebp_k__ = ETA((STINGER_),(TYPE_))->blocks[p__]; \
const int64_t source__ = ebp__[ebp_k__].vertexID; \
const int64_t type__ = ebp__[ebp_k__].etype; \
OMP("omp task untied firstprivate(ebp_k__)") \
for(uint64_t i__ = 0; i__ < ebp__[ebp_k__].high; i__++) { \
if(!stinger_eb_is_blank(&ebp__[ebp_k__], i__)) { \
const struct stinger_edge local_current_edge__ = ebp__[ebp_k__].edges[i__]; \
if(local_current_edge__.neighbor >= 0) {
OMP("omp parallel for ") \
for(uint64_t p__ = 0; p__ < ETA((STINGER_),(TYPE_))->high; p__++) { \
int64_t ebp_k__ = ETA((STINGER_),(TYPE_))->blocks[p__]; \
const int64_t source__ = ebp__[ebp_k__].vertexID; \
const int64_t type__ = ebp__[ebp_k__].etype; \
for(uint64_t i__ = 0; i__ < ebp__[ebp_k__].high; i__++) { \
if(!stinger_eb_is_blank(&ebp__[ebp_k__], i__)) { \
const struct stinger_edge local_current_edge__ = ebp__[ebp_k__].edges[i__]; \
if(local_current_edge__.neighbor >= 0) {

#define STINGER_READ_ONLY_PARALLEL_FORALL_EDGES_END() \
} \
} \
} \
} \
OMP("omp taskwait"); \
} \
} \
} \
} \
} \
} \
} while (0)


Expand All @@ -410,7 +405,7 @@ extern "C" {
#define STINGER_EDGE_TIME_RECENT current_edge__->timeRecent

#define STINGER_RO_EDGE_SOURCE source__
#define STINGER_RO_EDGE_TYPE ebp__[ebp_k__].type
#define STINGER_RO_EDGE_TYPE ebp__[ebp_k__].etype
#define STINGER_RO_EDGE_DEST local_current_edge__.neighbor
#define STINGER_RO_EDGE_WEIGHT local_current_edge__.weight
#define STINGER_RO_EDGE_TIME_FIRST local_current_edge__.timeFirst
Expand Down
13 changes: 13 additions & 0 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ target_link_libraries(stinger_physmap_test stinger_core gtest)

#================================

set(_stinger_traversal_test_sources
stinger_traversal_test/stinger_traversal_test.cpp
stinger_traversal_test/non_read_only_traversal.cpp
stinger_traversal_test/read_only_traversal.cpp
stinger_traversal_test/stinger_traversal_test.h
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/stinger_traversal_test)
add_executable(stinger_traversal_test ${_stinger_traversal_test_sources})
target_link_libraries(stinger_traversal_test stinger_core gtest)

#================================

set(_adamic_adar_test_sources
adamic_adar_test/adamic_adar_test.c
)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/stinger_physmap_test/stinger_physmap_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "stinger_core_test.h"
#include "stinger_physmap_test.h"
extern "C" {
#include "stinger_core/xmalloc.h"
#include "stinger_core/stinger_traversal.h"
Expand Down
Loading

0 comments on commit 6cba987

Please sign in to comment.