Skip to content

Commit

Permalink
Update to all_native_events.c to optionally test for Cuda component.
Browse files Browse the repository at this point in the history
  • Loading branch information
Treece Burgess committed Nov 7, 2024
1 parent 4a0a693 commit 2430ee1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
18 changes: 17 additions & 1 deletion src/ctests/all_native_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,20 @@ 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;

/* 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 ) {
Expand All @@ -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++ ) {

Expand All @@ -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 );
Expand Down

0 comments on commit 2430ee1

Please sign in to comment.