Skip to content

Commit

Permalink
1.7.0 release cleanup and minor updates. Addresses #101. (#116)
Browse files Browse the repository at this point in the history
* Pre-create strings in annotation perftest

* Update LLNL system hostconfigs

* Disable most build options by default. Addresses #101.

* Add CaliperMetadataDB::import_globals() test case
  • Loading branch information
daboehme authored Jun 19, 2018
1 parent 1938cce commit 898277c
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 37 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ script:
- cd build-${CALI_TRAVIS_TESTNAME}
- CMAKE_OPTS="-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=On"
- CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_C_COMPILER=${CALI_CC} -DCMAKE_CXX_COMPILER=${CALI_CXX}"
- CMAKE_OPTS="${CMAKE_OPTS} -DWITH_LIBPFM=Off"
- CMAKE_OPTS="${CMAKE_OPTS} -DWITH_PAPI=Off"
- CMAKE_OPTS="${CMAKE_OPTS} -DWITH_MPI=${WITH_MPI} -DWITH_MPIT=Off"
- CMAKE_OPTS="${CMAKE_OPTS} -DWITH_GOTCHA=${WITH_GOTCHA}"
- CMAKE_OPTS="${CMAKE_OPTS} -DWITH_GOTCHA=${WITH_GOTCHA} -DWITH_SAMPLER=On"
- if [[ -n "${COVERAGE}" ]] ; then CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_C_FLAGS=-coverage -DCMAKE_CXX_FLAGS=-coverage"; fi
- cmake ${CMAKE_OPTS} ..
- make -j4
Expand Down
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project (caliper)
set(CALIPER_MAJOR_VERSION 1)
set(CALIPER_MINOR_VERSION 7)
set(CALIPER_PATCH_VERSION 0)
set(CALIPER_VERSION "${CALIPER_MAJOR_VERSION}.${CALIPER_MINOR_VERSION}.${CALIPER_PATCH_VERSION}-dev")
set(CALIPER_VERSION "${CALIPER_MAJOR_VERSION}.${CALIPER_MINOR_VERSION}.${CALIPER_PATCH_VERSION}")

# Add our module directory to the include path.
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
Expand All @@ -30,14 +30,14 @@ option(WITH_TOOLS "Build Caliper tools" TRUE)
option(WITH_NVPROF "Enable NVidia profiler bindings (requires CUDA)" FALSE)
option(WITH_CUPTI "Enable CUPTI service (CUDA performance analysis)" FALSE)
option(WITH_NETOUT "Enable netout service (requires curl)" FALSE)
option(WITH_PAPI "Enable PAPI hardware counter service (requires papi)" TRUE)
option(WITH_LIBPFM "Enable libpfm (perf_event) sampling" TRUE)
option(WITH_PAPI "Enable PAPI hardware counter service (requires papi)" FALSE)
option(WITH_LIBPFM "Enable libpfm (perf_event) sampling" FALSE)
option(WITH_LIBDW "Enable libdw support (for module detection in callpath service)" FALSE)
option(WITH_CALLPATH "Enable callpath service (requires libunwind)" TRUE)
option(WITH_MPI "Enable MPI" TRUE)
option(WITH_MPIT "Enable MPI-T" TRUE)
option(WITH_CALLPATH "Enable callpath service (requires libunwind)" FALSE)
option(WITH_MPI "Enable MPI" FALSE)
option(WITH_MPIT "Enable MPI-T" FALSE)
option(WITH_OMPT "Enable OMPT" FALSE)
option(WITH_SAMPLER "Enable Linux sampler (x86 Linux only)" TRUE)
option(WITH_SAMPLER "Enable Linux sampler (x86 and PPC Linux only)" FALSE)
option(WITH_DYNINST "Enable dyninst (for symbollookup service" FALSE)
option(WITH_GOTCHA "Enable GOTCHA wrapping" TRUE)
option(WITH_SOS "Enable SOSFlow data management" FALSE)
Expand Down
6 changes: 3 additions & 3 deletions cmake/hostconfig/llnl-ray-gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ set(CMAKE_CXX_COMPILER "/usr/tcetmp/bin/g++" CACHE PATH "C++ Compiler (g++ 4.9.3
set(MPI_C_COMPILER "/usr/tcetmp/bin/mpigcc" CACHE PATH "")
set(MPI_CXX_COMPILER "/usr/tcetmp/bin/mpig++" CACHE PATH "")

set(CUDA_TOOLKIT_ROOT_DIR "/usr/local/cuda-8.0" CACHE PATH "")
set(CUDA_TOOLKIT_ROOT_DIR "/usr/local/cuda" CACHE PATH "")

set(CUPTI_PREFIX "/usr/local/cuda-8.0/extras/CUPTI" CACHE PATH "")
set(CUPTI_PREFIX "/usr/local/cuda/extras/CUPTI" CACHE PATH "")

set(WITH_CALLPATH Off CACHE BOOL "")
set(WITH_NVPROF On CACHE BOOL "")
set(WITH_CUPTI On CACHE BOOL "")
set(WITH_PAPI Off CACHE BOOL "")
set(WITH_DYNINST Off CACHE BOOL "")
set(WITH_SAMPLER Off CACHE BOOL "") # currently doesn't support non-X86
set(WITH_SAMPLER On CACHE BOOL "")
set(WITH_LIBPFM Off CACHE BOOL "")
set(WITH_MPI On CACHE BOOL "")
set(WITH_MPIT Off CACHE BOOL "")
Expand Down
5 changes: 3 additions & 2 deletions cmake/hostconfig/llnl-toss3-gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ set(CMAKE_CXX_COMPILER "/usr/tce/bin/g++" CACHE PATH "C++ Compiler (g++ 4.9.3)")
set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.2-gcc-4.9.3/bin/mpicc" CACHE PATH "")
set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.2-gcc-4.9.3/bin/mpicxx" CACHE PATH "")

set(PAPI_PREFIX "/usr/tce/packages/papi/papi-5.4.3" CACHE PATH "")
set(PAPI_PREFIX "/usr/tce/packages/papi/papi-5.5.1" CACHE PATH "")
set(ITT_PREFIX "/usr/tce/packages/vtune/default" CACHE PATH "")

set(CMAKE_PREFIX_PATH "/usr/tce/packages/dyninst/dyninst-9.3.1/lib/cmake" CACHE PATH "")
set(CMAKE_PREFIX_PATH "/usr/tce/packages/dyninst/dyninst-9.3.2/lib/cmake" CACHE PATH "")

set(WITH_CALLPATH On CACHE BOOL "")
set(WITH_NVPROF Off CACHE BOOL "")
set(WITH_CUPTI Off CACHE BOOL "")
set(WITH_PAPI On CACHE BOOL "")
set(WITH_LIBPFM On CACHE BOOL "")
set(WITH_DYNINST On CACHE BOOL "")
set(WITH_SAMPLER On Cache BOOL "")
set(WITH_MPI On CACHE BOOL "")
Expand Down
17 changes: 17 additions & 0 deletions src/reader/test/test_metadb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,21 @@ TEST(MetaDBTest, SetGlobal) {
EXPECT_EQ(count_in_record(globals, g_int_attr, v_int ), 1);
EXPECT_EQ(count_in_record(globals, g_val_attr, v_val ), 1);
EXPECT_EQ(count_in_record(globals, no_g_attr, v_no ), 0);

CaliperMetadataDB db_imp;

db_imp.import_globals(db);

std::vector<Entry> imp_globals = db_imp.get_globals();

Attribute g_imp_str_attr = db_imp.get_attribute("global.str");
Attribute g_imp_int_attr = db_imp.get_attribute("global.int");
Attribute g_imp_val_attr = db_imp.get_attribute("global.val");

EXPECT_GE(imp_globals.size(), 2);

EXPECT_EQ(count_in_record(imp_globals, g_imp_str_attr, v_str_a), 1);
EXPECT_EQ(count_in_record(imp_globals, g_imp_str_attr, v_str_b), 1);
EXPECT_EQ(count_in_record(imp_globals, g_imp_int_attr, v_int ), 1);
EXPECT_EQ(count_in_record(imp_globals, g_imp_val_attr, v_val ), 1);
}
58 changes: 36 additions & 22 deletions test/cali-annotation-perftest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,8 @@
#endif


cali::Annotation test_annotation("test.attr", CALI_ATTR_DEFAULT);

int foo(int d, int w)
{
if (d <= 0)
return 0;

std::string str("foo.");

str.append(std::to_string(d));
str.append(".");
str.append(std::to_string(w));

cali::Annotation::Guard
g_a(test_annotation.begin(str.c_str()));

return 2 + foo(d-1, w);
}

cali::Annotation test_annotation("test.attr", CALI_ATTR_DEFAULT);
std::vector<std::string> annotation_strings;

struct Config
{
Expand All @@ -99,18 +82,47 @@ struct Config
};


int foo(int d, int w, const Config& cfg)
{
if (d <= 0)
return 0;

cali::Annotation::Guard
g_a(test_annotation.begin(annotation_strings[d*cfg.tree_width+w].c_str()));

return 2 + foo(d-1, w, cfg);
}

int run(const Config& cfg)
{
int n_updates = 0;

#pragma omp parallel for schedule(static) reduction(+:n_updates)
for (int i = 0; i < cfg.iter; ++i) {
n_updates += foo(cfg.tree_depth, i % cfg.tree_width);
n_updates += foo(cfg.tree_depth, i % cfg.tree_width, cfg);
}

return n_updates;
}

int make_strings(const Config& cfg)
{
int depth = cfg.tree_depth + 1;
int width = std::max(1, cfg.tree_width);

annotation_strings.resize(depth * width);

for (int d = 0; d < depth; ++d)
for (int w = 0; w < width; ++w) {
std::string str("foo.");

str.append(std::to_string(d));
str.append(".");
str.append(std::to_string(w));

annotation_strings[d*width+w] = std::move(str);
}
}

int main(int argc, char* argv[])
{
Expand Down Expand Up @@ -175,6 +187,8 @@ int main(int argc, char* argv[])
cali::Annotation("perftest.threads", CALI_ATTR_GLOBAL).set(threads);
#endif

make_strings(cfg);

// --- print info

bool print_csv = args.is_set("csv");
Expand Down Expand Up @@ -218,8 +232,8 @@ int main(int argc, char* argv[])
auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(etime-stime).count();

if (print_csv)
std::cout << cfg.tree_width
<< "," << cfg.tree_depth
std::cout << cfg.tree_depth
<< "," << cfg.tree_width
<< "," << updates
<< "," << threads
<< "," << msec/1000.0
Expand Down

0 comments on commit 898277c

Please sign in to comment.