From 2430ee1eace0b87714aa281f6a415f783bd03bb0 Mon Sep 17 00:00:00 2001 From: Treece Burgess Date: Thu, 7 Nov 2024 03:29:24 +0000 Subject: [PATCH] Update to all_native_events.c to optionally test for Cuda component. --- .github/workflows/ci.sh | 20 +++++++------------- src/ctests/all_native_events.c | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.sh b/.github/workflows/ci.sh index 8eb67eee5..6205aa7e1 100755 --- a/.github/workflows/ci.sh +++ b/.github/workflows/ci.sh @@ -45,11 +45,6 @@ else ./configure --with-debug=$DEBUG --enable-warnings --with-components="$COMPONENTS" fi -#touch /tmp/component_names.txt -#for component in $COMPONENTS; do -# echo "Name: $component" >> /tmp/component_names.txt -#done - CHECK_COMPONENTS=$(echo $COMPONENTS | sed 's/ /|/g') echo $CHECK_COMPONENTS @@ -60,12 +55,11 @@ utils/papi_component_avail # Make sure the list of components are active utils/papi_component_avail | grep -A1000 'Active components' | grep -E $CHECK_COMPONENTS -#if [ "$COMPONENTS" != "cuda nvml" ]; then -# echo Testing -# ./run_tests.sh -#fi - -if [ "$SHLIB" = "with" ]; then - echo "Running single component test for active components" - ./run_tests_shlib.sh TESTS_QUIET +# Run test suite +if [ "$SHLIB" = "without" ]; then + echo Testing + ./run_tests.sh +else + echo "Running single component test for active components" + ./run_tests_shlib.sh TESTS_QUIET fi diff --git a/src/ctests/all_native_events.c b/src/ctests/all_native_events.c index 0dc788a1e..53c76cd03 100644 --- a/src/ctests/all_native_events.c +++ b/src/ctests/all_native_events.c @@ -80,6 +80,7 @@ main( int argc, char **argv ) PAPI_event_info_t info, info1; const PAPI_hw_info_t *hwinfo = NULL; const PAPI_component_info_t* cmpinfo; + char enableCuda[PAPI_MIN_STR_LEN] = "no"; int event_code; int numcmp, cid; int quiet; @@ -87,6 +88,12 @@ main( int argc, char **argv ) /* Set quiet variable */ quiet=tests_quiet( argc, argv ); + for (i = 0; i < argc; i++) { + if (strncmp(argv[i], "--enable_cuda_evts=", 19) == 0) { + strcpy(enableCuda, argv[i] + 19); + } + } + /* Init PAPI library */ retval = PAPI_library_init( PAPI_VER_CURRENT ); if ( retval != PAPI_VER_CURRENT ) { @@ -107,7 +114,7 @@ main( int argc, char **argv ) numcmp = PAPI_num_components( ); int rocm_id = PAPI_get_component_index("rocm"); - + int cuda_id = PAPI_get_component_index("cuda"); /* Loop through all components */ for( cid = 0; cid < numcmp; cid++ ) { @@ -117,6 +124,15 @@ main( int argc, char **argv ) continue; } + /* possible option to fix the long run time of this file for ci, by completing skipping cuda tests */ +// if (cid == cuda_id) +// continue; + + /* possible option to fix the long run time of this file for CI, by using an option */ + if (strcmp(enableCuda, "no") == 0 && cid == cuda_id) { + continue; + } + cmpinfo = PAPI_get_component_info( cid ); if (cmpinfo == NULL) { test_fail( __FILE__, __LINE__, "PAPI_get_component_info", 2 );