mmore500 / conduit

C++ library that wraps intra-thread, inter-thread, and inter-process communication in a uniform, modular, object-oriented interface, with a focus on asynchronous high-performance computing applications.
https://conduit.fyi
MIT License
13 stars 4 forks source link

Build all tests with CMake #123

Closed rodsan0 closed 3 years ago

rodsan0 commented 3 years ago

And eventually, it will be possible to build everything with CMake!

mmore500 commented 3 years ago

I added the flags we need for coverage to the cmakelists.txt

set(CMAKE_CXX_FLAGS_COVERAGE "-std=c++17 -pipe -pthread -march=native -g -Wall -Wno-unused-function -I$(TO_ROOT)/coverage_include/ -I$(TO_ROOT)/third-party/ -DEMP_TRACK_MEM -DUITSL_AUDIT_OCCUPANCY -Wnon-virtual-dtor -Wcast-align -Woverloaded-virtual -ftemplate-backtrace-limit=0 -fprofile-instr-generate -fcoverage-mapping -fno-inline -fno-elide-constructors -O0")

In order to get the coverage working, we just need to run the tests with these options in multiproc

    # see https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation
    for n in $$(seq 2 3); do \
        export n; \
        $(UIT_MPIEXEC) --bind-to none $$($(UIT_MPIEXEC) --version | grep -q "OpenRTE" && echo "--oversubscribe") -n $$n \
            /bin/bash -c '\
                LLVM_PROFILE_FILE="%p-%m-%h-$${n}-$${OMPI_COMM_WORLD_RANK}.profraw" \
                ./$@.out' \
            || exit 1; \
    done
    llvm-profdata merge *.profraw -o default.profdata
    llvm-cov show ./$@.out -instr-profile=default.profdata > coverage_$@.txt
    python $(TO_ROOT)/third-party/force-cover/fix_coverage.py coverage_$@.txt

like this for uniproc

    echo "UIT_MPICXX" $(UIT_MPICXX)
    echo "UIT_MPIEXEC" $(UIT_MPIEXEC)
    # see https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation
    $(UIT_MPIEXEC) --bind-to none -n 1 \
        /bin/bash -c '\
            LLVM_PROFILE_FILE="%p-%m-%h-$${n}-$${OMPI_COMM_WORLD_RANK}.profraw" \
            ./$@.out' \
            || exit 1
    llvm-profdata merge *.profraw -o default.profdata
    llvm-cov show ./$@.out -instr-profile=default.profdata > coverage_$@.txt
    python $(TO_ROOT)/third-party/force-cover/fix_coverage.py coverage_$@.txt

and like this for multithread

    export OMPI_CXX=clang++ && $(UIT_MPICXX) $(FLAGS) $< -lbenchmark -lmetis -lpthread -lstdc++fs -lz -o $@.out
    # execute test
    echo "UIT_MPICXX" $(UIT_MPICXX)
    echo "UIT_MPIEXEC" $(UIT_MPIEXEC)
    # see https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation
    for n in $$(seq 2 3); do \
        $(UIT_MPIEXEC) -n 1 ./$@.out --num_threads $$n || exit 1; \
    done
    llvm-profdata merge *.profraw -o default.profdata
    llvm-cov show ./$@.out -instr-profile=default.profdata > coverage_$@.txt
    python $(TO_ROOT)/third-party/force-cover/fix_coverage.py coverage_$@.txt
codecov[bot] commented 3 years ago

Codecov Report

Merging #123 (8785bdd) into master (3a90980) will decrease coverage by 21.61%. The diff coverage is 68.54%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #123       +/-   ##
===========================================
- Coverage   67.54%   45.92%   -21.62%     
===========================================
  Files         387      213      -174     
  Lines       12134     5696     -6438     
===========================================
- Hits         8196     2616     -5580     
+ Misses       3938     3080      -858     
Impacted Files Coverage Δ
include/netuit/arrange/EmptyTopologyFactory.hpp 30.00% <ø> (ø)
include/netuit/assign/AssignRandomly.hpp 100.00% <ø> (ø)
include/netuit/assign/GenerateMetisAssignments.hpp 89.74% <0.00%> (-10.26%) :arrow_down:
include/netuit/mesh/MeshNode.hpp 86.36% <ø> (-5.31%) :arrow_down:
include/netuit/mesh/MeshNodeInput.hpp 100.00% <ø> (ø)
include/netuit/mesh/MeshNodeOutput.hpp 100.00% <ø> (ø)
include/netuit/topology/TopoNode.hpp 19.35% <0.00%> (+1.61%) :arrow_up:
include/netuit/topology/Topology.hpp 65.00% <ø> (+2.42%) :arrow_up:
include/uit/ducts/Duct.hpp 36.76% <0.00%> (-29.91%) :arrow_down:
...ntra/accumulating+type=any/a::AccumulatingDuct.hpp 0.00% <ø> (-65.00%) :arrow_down:
... and 392 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 393fc13...8785bdd. Read the comment docs.

mmore500 commented 3 years ago

This looks like it will pass imminently! Merging it in now so that (fingers crossed) there will be a built container in the morning I can work with