Giter Club home page Giter Club logo

Comments (8)

cheshmi avatar cheshmi commented on September 24, 2024

Thanks, can you please send a PR?

from aggregation.

learning-chip avatar learning-chip commented on September 24, 2024

I haven't diagnosed the root cause of error, but simply skipped the cases that calls partialSparsification in order to compile that example program. For example SpTrSv_LL_HDAGG doesn't call sparsification so still runs, but SpTrSv_LL_Tree_HDAGG breaks. However the inspection time of HDAGG is many times slower than Tree_HDAGG, presumably due to lack of sparsification.

from aggregation.

learning-chip avatar learning-chip commented on September 24, 2024

One clue: The same SpTRSV_runtime.cpp example from the older repo https://github.com/BehroozZare/HDagg-benchmark (as of commit 948b38f) runs fine without array-bound errors. So it must be due to some updates in between.

from aggregation.

cheshmi avatar cheshmi commented on September 24, 2024

Got it, thanks.
I think HDagg repo is more updated than this for the HDagg algorithm.

from aggregation.

learning-chip avatar learning-chip commented on September 24, 2024

Hi @cheshmi I found the problem with this repo --

The find_package(OpenMP) in the top-level cmake file is disabled:

#find_package(OpenMP)
if(OpenMP_FOUND)
if(APPLE) #TODO: there might be a better support
set(OpenMP_CXX_INCLUDE_DIRS "/usr/local/include/")
endif()
include_directories(
${OpenMP_CXX_INCLUDE_DIRS}
)
link_libraries(
OpenMP::OpenMP_CXX
)
add_definitions(-DENABLE_OPENMP)
add_definitions(-D__OPENMP__)
endif()

This is probably fine when compiled as a subproject of Sympiler (where OpenMP is found one level higher); but when compiling this aggregation repo as a standalone project, the ENABLE_OPENMP macro and OpenMP flags won't get defined. Then, inside the HDAGG::partialSparsification function:

#ifdef ENABLE_OPENMP
int bins = omp_get_num_threads();
int tid = omp_get_thread_num();
#else
int bins =1;
int tid=1;
#endif

Both bins and tid will be set to 1, causing a bug when the user wants parallel partitioning.

Uncommenting find_package(OpenMP) fixes the bug. Or maybe using the HAS_PARENT condition to optionally include dependencies.

One the other hand, in the older HDagg-benchmark repo, there is no ENABLE_OPENMP switch, and bins is always set to omp_get_num_threads(), so no such bug.

from aggregation.

learning-chip avatar learning-chip commented on September 24, 2024

More unit tests for the HDagg procedure (sparsification, grouping, partitioning, ungrouping...) might help prevent future bugs? In the current Catch_tests there seems to be only one test for the simple levelset sptrsv, but not more advanced partitionings like LBC or HDagg. And the test is disabled in cmake file.

from aggregation.

learning-chip avatar learning-chip commented on September 24, 2024

The current GitHub workflow runs lbc_demo and sptrsv_demo, but not Hdagg_SpTRSV (the executable for SpTRSV_runtime.cpp).

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --target lbc lbc_demo sptrsv_demo
- name: run test 1
run: |
${{github.workspace}}/build/example/lbc_demo
${{github.workspace}}/build/example/sptrsv_demo

If you add lines like

cmake --build ${{github.workspace}}/build --target Hdagg_SpTRSV
${{github.workspace}}/build/example/Hdagg_SpTRSV`, 

you should see the error message in GitHub actions.

from aggregation.

learning-chip avatar learning-chip commented on September 24, 2024

OK I saw that find_package(OpenMP) was disabled by the commit 5b88309 , presumably to ensure compatibility with the parent Sympiler directory.

May using

if(LBC_IS_TOPLEVEL)
    find_package(OpenMP)
endif()

to avoid duplication. Although I think duplicately calling find_package(OpenMP) is also fine...

from aggregation.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.