From a7e72b30b6568bc438d27deac9f009ff3697de56 Mon Sep 17 00:00:00 2001 From: Kristi Belcher Date: Wed, 23 Nov 2022 15:17:29 -0800 Subject: [PATCH 01/22] adding asan sanitizer support for hip --- src/umpire/util/memory_sanitizers.hpp | 6 ++++-- tests/tools/sanitizers/CMakeLists.txt | 9 ++++++++- tests/tools/sanitizers/sanitizer_tests.cpp | 10 ++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/umpire/util/memory_sanitizers.hpp b/src/umpire/util/memory_sanitizers.hpp index 7003b9699..65a06fae4 100644 --- a/src/umpire/util/memory_sanitizers.hpp +++ b/src/umpire/util/memory_sanitizers.hpp @@ -35,12 +35,14 @@ #if defined(__UMPIRE_USE_MEMORY_SANITIZER__) #define UMPIRE_POISON_MEMORY_REGION(allocator, ptr, size) \ - if (allocator->getPlatform() == umpire::Platform::host) { \ + if (allocator->getPlatform() == umpire::Platform::host || \ + allocator->getPlatform() == umpire::Platform::hip) { \ ASAN_POISON_MEMORY_REGION((ptr), (size)); \ } #define UMPIRE_UNPOISON_MEMORY_REGION(allocator, ptr, size) \ - if (allocator->getPlatform() == umpire::Platform::host) { \ + if (allocator->getPlatform() == umpire::Platform::host || \ + allocator->getPlatform() == umpire::Platform::hip) { \ ASAN_UNPOISON_MEMORY_REGION((ptr), (size)); \ } diff --git a/tests/tools/sanitizers/CMakeLists.txt b/tests/tools/sanitizers/CMakeLists.txt index 54338a388..044983294 100644 --- a/tests/tools/sanitizers/CMakeLists.txt +++ b/tests/tools/sanitizers/CMakeLists.txt @@ -4,11 +4,18 @@ # # SPDX-License-Identifier: (MIT) ############################################################################## +set (sanitizer_depends umpire) + +if (UMPIRE_ENABLE_HIP) + set (sanitizer_depends + ${sanitizer_depends} + blt::hip) +endif () blt_add_executable( NAME sanitizer_tests SOURCES sanitizer_tests.cpp - DEPENDS_ON umpire) + DEPENDS_ON ${sanitizer_depends}) include(FindPythonInterp) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index 5c4f2620d..cf610d6e8 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -52,13 +52,19 @@ int main(int argc, char* argv[]) const std::string strategy{argv[1]}; const std::string test_type{argv[2]}; +#if defined(UMPIRE_ENABLE_HIP) + const std::string resource_type{"DEVICE"}; +#else + const std::string resource_type{"HOST"}; +#endif + auto& rm = umpire::ResourceManager::getInstance(); if (strategy.find("QuickPool") != std::string::npos) { - auto pool = rm.makeAllocator("test_allocator", rm.getAllocator("HOST")); + auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); UMPIRE_USE_VAR(pool); } else if (strategy.find("DynamicPoolList") != std::string::npos) { - auto pool = rm.makeAllocator("test_allocator", rm.getAllocator("HOST")); + auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); UMPIRE_USE_VAR(pool); } From f90a7af4396cd44485ca999971e83e0fb0eec07f Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 23 Nov 2022 23:20:42 +0000 Subject: [PATCH 02/22] Apply style updates --- src/umpire/util/memory_sanitizers.hpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/umpire/util/memory_sanitizers.hpp b/src/umpire/util/memory_sanitizers.hpp index 65a06fae4..433a721d1 100644 --- a/src/umpire/util/memory_sanitizers.hpp +++ b/src/umpire/util/memory_sanitizers.hpp @@ -34,16 +34,14 @@ #if defined(__UMPIRE_USE_MEMORY_SANITIZER__) -#define UMPIRE_POISON_MEMORY_REGION(allocator, ptr, size) \ - if (allocator->getPlatform() == umpire::Platform::host || \ - allocator->getPlatform() == umpire::Platform::hip) { \ - ASAN_POISON_MEMORY_REGION((ptr), (size)); \ +#define UMPIRE_POISON_MEMORY_REGION(allocator, ptr, size) \ + if (allocator->getPlatform() == umpire::Platform::host || allocator->getPlatform() == umpire::Platform::hip) { \ + ASAN_POISON_MEMORY_REGION((ptr), (size)); \ } -#define UMPIRE_UNPOISON_MEMORY_REGION(allocator, ptr, size) \ - if (allocator->getPlatform() == umpire::Platform::host || \ - allocator->getPlatform() == umpire::Platform::hip) { \ - ASAN_UNPOISON_MEMORY_REGION((ptr), (size)); \ +#define UMPIRE_UNPOISON_MEMORY_REGION(allocator, ptr, size) \ + if (allocator->getPlatform() == umpire::Platform::host || allocator->getPlatform() == umpire::Platform::hip) { \ + ASAN_UNPOISON_MEMORY_REGION((ptr), (size)); \ } #else // !defined(__UMPIRE_USE_MEMORY_SANITIZER__) From 00e3f43e184a70496188e88c4592f7ec4875c282 Mon Sep 17 00:00:00 2001 From: Kristi Belcher Date: Tue, 6 Dec 2022 09:56:34 -0800 Subject: [PATCH 03/22] WIP adding a hip kernel sanitizer test --- tests/tools/sanitizers/sanitizer_tests.cpp | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index cf610d6e8..2d4c7e1a9 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -5,11 +5,21 @@ // SPDX-License-Identifier: (MIT) ////////////////////////////////////////////////////////////////////////////// #include +#include #include "umpire/ResourceManager.hpp" #include "umpire/strategy/DynamicPoolList.hpp" #include "umpire/strategy/QuickPool.hpp" +__global__ void test_read_after_free(double** data_ptr, std::size_t INDEX) +{ + if (threadIdx.x == 0) { + *data_ptr[INDEX] = 100; + printf("data_ptr[INDEX] = %f", *data_ptr[INDEX]); + printf("data_ptr[256] = %f", *data_ptr[256]); + } +} + void test_read_after_free() { auto& rm = umpire::ResourceManager::getInstance(); @@ -53,7 +63,7 @@ int main(int argc, char* argv[]) const std::string test_type{argv[2]}; #if defined(UMPIRE_ENABLE_HIP) - const std::string resource_type{"DEVICE"}; + const std::string resource_type{"UM"}; #else const std::string resource_type{"HOST"}; #endif @@ -69,9 +79,26 @@ int main(int argc, char* argv[]) } if (test_type.find("read") != std::string::npos) { - test_read_after_free(); + //test_read_after_free(); + #if defined(UMPIRE_ENABLE_HIP) + auto allocator = rm.getAllocator("test_allocator"); + const std::size_t SIZE = 1356; + const std::size_t INDEX = SIZE / 2; + double** ptr_to_data = static_cast(allocator.allocate(sizeof(double*))); + hipLaunchKernelGGL(test_read_after_free, dim3(1), dim3(16), 0, 0, ptr_to_data, INDEX); + + // Test read after free from host + allocator.deallocate(ptr_to_data); + std::cout << "data[256] = " << *ptr_to_data[256] << std::endl; + #endif } else if (test_type.find("write") != std::string::npos) { test_write_after_free(); + //#if defined(UMPIRE_ENABLE_HIP) + // const std::size_t SIZE = 1356; + // const std::size_t INDEX = SIZE / 2; + // double** ptr_to_data = static_cast(allocator.allocate(sizeof(double*))); + // hipLaunchKernelGGL(test_write_after_free, dim3(1), dim3(16), 0, 0, ptr_to_data, INDEX); + //#endif } return 0; From ac5cd6283cb240874bf4af926904c7e40571c212 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 6 Dec 2022 17:57:56 +0000 Subject: [PATCH 04/22] Apply style updates --- tests/tools/sanitizers/sanitizer_tests.cpp | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index 2d4c7e1a9..864b2a644 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -4,9 +4,10 @@ // // SPDX-License-Identifier: (MIT) ////////////////////////////////////////////////////////////////////////////// -#include #include +#include + #include "umpire/ResourceManager.hpp" #include "umpire/strategy/DynamicPoolList.hpp" #include "umpire/strategy/QuickPool.hpp" @@ -79,18 +80,18 @@ int main(int argc, char* argv[]) } if (test_type.find("read") != std::string::npos) { - //test_read_after_free(); - #if defined(UMPIRE_ENABLE_HIP) - auto allocator = rm.getAllocator("test_allocator"); - const std::size_t SIZE = 1356; - const std::size_t INDEX = SIZE / 2; - double** ptr_to_data = static_cast(allocator.allocate(sizeof(double*))); - hipLaunchKernelGGL(test_read_after_free, dim3(1), dim3(16), 0, 0, ptr_to_data, INDEX); - - // Test read after free from host - allocator.deallocate(ptr_to_data); - std::cout << "data[256] = " << *ptr_to_data[256] << std::endl; - #endif +// test_read_after_free(); +#if defined(UMPIRE_ENABLE_HIP) + auto allocator = rm.getAllocator("test_allocator"); + const std::size_t SIZE = 1356; + const std::size_t INDEX = SIZE / 2; + double** ptr_to_data = static_cast(allocator.allocate(sizeof(double*))); + hipLaunchKernelGGL(test_read_after_free, dim3(1), dim3(16), 0, 0, ptr_to_data, INDEX); + + // Test read after free from host + allocator.deallocate(ptr_to_data); + std::cout << "data[256] = " << *ptr_to_data[256] << std::endl; +#endif } else if (test_type.find("write") != std::string::npos) { test_write_after_free(); //#if defined(UMPIRE_ENABLE_HIP) From 522a4a90ea407e998620341584e5e603b6ca00e3 Mon Sep 17 00:00:00 2001 From: Kristi Belcher Date: Wed, 7 Dec 2022 11:39:06 -0800 Subject: [PATCH 05/22] adding usage checkers to sanitizer test --- tests/tools/sanitizers/sanitizer_tests.cpp | 99 ++++++++++------------ 1 file changed, 45 insertions(+), 54 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index 864b2a644..a5647747c 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -4,60 +4,68 @@ // // SPDX-License-Identifier: (MIT) ////////////////////////////////////////////////////////////////////////////// -#include - #include #include "umpire/ResourceManager.hpp" #include "umpire/strategy/DynamicPoolList.hpp" #include "umpire/strategy/QuickPool.hpp" -__global__ void test_read_after_free(double** data_ptr, std::size_t INDEX) +__global__ void test_for_hip(double** data_ptr, std::size_t INDEX) { if (threadIdx.x == 0) { *data_ptr[INDEX] = 100; - printf("data_ptr[INDEX] = %f", *data_ptr[INDEX]); - printf("data_ptr[256] = %f", *data_ptr[256]); } } -void test_read_after_free() +void sanitizer_test(const std::string test_type) { auto& rm = umpire::ResourceManager::getInstance(); auto allocator = rm.getAllocator("test_allocator"); const std::size_t SIZE = 1356; const std::size_t INDEX = SIZE / 2; - double* data = static_cast(allocator.allocate(SIZE * sizeof(double))); - - data[INDEX] = 100; - std::cout << "data[INDEX] = " << data[INDEX] << std::endl; - - allocator.deallocate(data); - std::cout << "data[256] = " << data[256] << std::endl; -} - -void test_write_after_free() -{ - auto& rm = umpire::ResourceManager::getInstance(); - auto allocator = rm.getAllocator("test_allocator"); + double** data = static_cast(allocator.allocate(SIZE * sizeof(double*))); - const std::size_t SIZE = 1356; - const std::size_t INDEX = SIZE / 2; - double* data = static_cast(allocator.allocate(SIZE * sizeof(double))); + if (test_type.find("read") != std::string::npos) { +#if defined(UMPIRE_ENABLE_HIP) + hipLaunchKernelGGL(test_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); + hipDeviceSynchronize(); +#else + *data[INDEX] = 100; + std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; +#endif - data[INDEX] = 100; - std::cout << "data[INDEX] = " << data[INDEX] << std::endl; + // Test read after free from host + allocator.deallocate(data); + std::cout << "data[256] = " << *data[256] << std::endl; + //test_read_after_free(allocator, ptr_to_data, INDEX); + } else { + if (test_type.find("write") == std::string::npos) { + std::cout << "Test type did not match either option - using write" << std::endl; + } +#if defined(UMPIRE_ENABLE_HIP) + hipLaunchKernelGGL(test_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); + hipDeviceSynchronize(); +#else + *data[INDEX] = 100; + std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; +#endif - allocator.deallocate(data); - data[INDEX] = -1; - std::cout << "data[INDEX] = " << data[INDEX] << std::endl; + // Test write after free from host + allocator.deallocate(data); + *data[INDEX] = -1; + std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; + //test_write_after_free(allocator, ptr_to_data, INDEX); + } } int main(int argc, char* argv[]) { if (argc < 3) { - std::cout << argv[0] << " requires 2 arguments, test type and allocation strategy" << std::endl; + std::cout << "Usage: requires 2 arguments." << std::endl; + std::cout << "First, an allocation strategy (QuickPool or DynamicPoolList)." << std::endl; + std::cout << "Second, a test type (read or write). Try again." << std::endl; + return 0; } const std::string strategy{argv[1]}; @@ -71,36 +79,19 @@ int main(int argc, char* argv[]) auto& rm = umpire::ResourceManager::getInstance(); - if (strategy.find("QuickPool") != std::string::npos) { - auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); - UMPIRE_USE_VAR(pool); - } else if (strategy.find("DynamicPoolList") != std::string::npos) { + if (strategy.find("DynamicPoolList") != std::string::npos) { auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); UMPIRE_USE_VAR(pool); + } else { + if (strategy.find("QuickPool") == std::string::npos) { + std::cout << "Allocation strategy did not match either option - using QuickPool." << std::endl; + } + auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); + UMPIRE_USE_VAR(pool); } - if (test_type.find("read") != std::string::npos) { -// test_read_after_free(); -#if defined(UMPIRE_ENABLE_HIP) - auto allocator = rm.getAllocator("test_allocator"); - const std::size_t SIZE = 1356; - const std::size_t INDEX = SIZE / 2; - double** ptr_to_data = static_cast(allocator.allocate(sizeof(double*))); - hipLaunchKernelGGL(test_read_after_free, dim3(1), dim3(16), 0, 0, ptr_to_data, INDEX); - - // Test read after free from host - allocator.deallocate(ptr_to_data); - std::cout << "data[256] = " << *ptr_to_data[256] << std::endl; -#endif - } else if (test_type.find("write") != std::string::npos) { - test_write_after_free(); - //#if defined(UMPIRE_ENABLE_HIP) - // const std::size_t SIZE = 1356; - // const std::size_t INDEX = SIZE / 2; - // double** ptr_to_data = static_cast(allocator.allocate(sizeof(double*))); - // hipLaunchKernelGGL(test_write_after_free, dim3(1), dim3(16), 0, 0, ptr_to_data, INDEX); - //#endif - } + // Conduct the test + sanitizer_test(test_type); return 0; } From 3ac6a7c4270673db3471852060ed90101e11ec84 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 7 Dec 2022 19:40:26 +0000 Subject: [PATCH 06/22] Apply style updates --- tests/tools/sanitizers/sanitizer_tests.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index a5647747c..89298337f 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -38,7 +38,7 @@ void sanitizer_test(const std::string test_type) // Test read after free from host allocator.deallocate(data); std::cout << "data[256] = " << *data[256] << std::endl; - //test_read_after_free(allocator, ptr_to_data, INDEX); + // test_read_after_free(allocator, ptr_to_data, INDEX); } else { if (test_type.find("write") == std::string::npos) { std::cout << "Test type did not match either option - using write" << std::endl; @@ -55,7 +55,7 @@ void sanitizer_test(const std::string test_type) allocator.deallocate(data); *data[INDEX] = -1; std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; - //test_write_after_free(allocator, ptr_to_data, INDEX); + // test_write_after_free(allocator, ptr_to_data, INDEX); } } @@ -64,7 +64,7 @@ int main(int argc, char* argv[]) if (argc < 3) { std::cout << "Usage: requires 2 arguments." << std::endl; std::cout << "First, an allocation strategy (QuickPool or DynamicPoolList)." << std::endl; - std::cout << "Second, a test type (read or write). Try again." << std::endl; + std::cout << "Second, a test type (read or write). Try again." << std::endl; return 0; } @@ -83,9 +83,9 @@ int main(int argc, char* argv[]) auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); UMPIRE_USE_VAR(pool); } else { - if (strategy.find("QuickPool") == std::string::npos) { - std::cout << "Allocation strategy did not match either option - using QuickPool." << std::endl; - } + if (strategy.find("QuickPool") == std::string::npos) { + std::cout << "Allocation strategy did not match either option - using QuickPool." << std::endl; + } auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); UMPIRE_USE_VAR(pool); } From a4f007aebb9717ed14c805d4d5f453e45757c8b0 Mon Sep 17 00:00:00 2001 From: Kristi Belcher Date: Wed, 7 Dec 2022 15:13:16 -0800 Subject: [PATCH 07/22] more updates to sanitizer test for error checking --- tests/tools/sanitizers/sanitizer_tests.cpp | 69 +++++++++++++--------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index a5647747c..cf8d6b650 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -17,7 +17,7 @@ __global__ void test_for_hip(double** data_ptr, std::size_t INDEX) } } -void sanitizer_test(const std::string test_type) +void sanitizer_test(const std::string test_type, const std::string resource_type) { auto& rm = umpire::ResourceManager::getInstance(); auto allocator = rm.getAllocator("test_allocator"); @@ -27,71 +27,82 @@ void sanitizer_test(const std::string test_type) double** data = static_cast(allocator.allocate(SIZE * sizeof(double*))); if (test_type.find("read") != std::string::npos) { -#if defined(UMPIRE_ENABLE_HIP) - hipLaunchKernelGGL(test_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); - hipDeviceSynchronize(); -#else - *data[INDEX] = 100; - std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; -#endif + if (resource_type != "HOST") { + hipLaunchKernelGGL(test_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); + hipDeviceSynchronize(); + } else { + *data[INDEX] = 100; + std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; + } // Test read after free from host allocator.deallocate(data); std::cout << "data[256] = " << *data[256] << std::endl; - //test_read_after_free(allocator, ptr_to_data, INDEX); } else { if (test_type.find("write") == std::string::npos) { std::cout << "Test type did not match either option - using write" << std::endl; } -#if defined(UMPIRE_ENABLE_HIP) - hipLaunchKernelGGL(test_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); - hipDeviceSynchronize(); -#else - *data[INDEX] = 100; - std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; -#endif + if (resource_type != "HOST") { + hipLaunchKernelGGL(test_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); + hipDeviceSynchronize(); + } else { + *data[INDEX] = 100; + std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; + } // Test write after free from host allocator.deallocate(data); *data[INDEX] = -1; std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; - //test_write_after_free(allocator, ptr_to_data, INDEX); } } int main(int argc, char* argv[]) { - if (argc < 3) { - std::cout << "Usage: requires 2 arguments." << std::endl; + if (argc < 4) { + std::cout << "Usage: requires 3 arguments." << std::endl; std::cout << "First, an allocation strategy (QuickPool or DynamicPoolList)." << std::endl; - std::cout << "Second, a test type (read or write). Try again." << std::endl; + std::cout << "Second, a test type (read or write)." << std::endl; + std::cout << "Third, a resource type (DEVICE, HOST, or UM)." << std::endl; return 0; } - const std::string strategy{argv[1]}; - const std::string test_type{argv[2]}; - -#if defined(UMPIRE_ENABLE_HIP) - const std::string resource_type{"UM"}; -#else - const std::string resource_type{"HOST"}; -#endif + std::string strategy{argv[1]}; + std::string test_type{argv[2]}; + std::string resource_type{argv[3]}; auto& rm = umpire::ResourceManager::getInstance(); + if ((resource_type.find("DEVICE") != std::string::npos) || + (resource_type.find("UM") != std::string::npos)) { +#if !defined (UMPIRE_ENABLE_HIP) + UMPIRE_ERROR(runtime_error, + umpire::fmt::format("The resource, \"{}\", can't be used if HIP is not enabled.", resource_type)); +#endif + } else { + if (resource_type.find("HOST") == std::string::npos) { + std::cout << "Resource type did not match any available options - using HOST." << std::endl; + resource_type = "HOST"; + } + } + if (strategy.find("DynamicPoolList") != std::string::npos) { auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); UMPIRE_USE_VAR(pool); } else { if (strategy.find("QuickPool") == std::string::npos) { std::cout << "Allocation strategy did not match either option - using QuickPool." << std::endl; + strategy = "QuickPool"; } auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); UMPIRE_USE_VAR(pool); } + + std::cout << " Conducting sanitizer test with " << strategy << " strategy, " << test_type + << " test type, and the " << resource_type << " resource." << std::endl; // Conduct the test - sanitizer_test(test_type); + sanitizer_test(test_type, resource_type); return 0; } From 8b9e19419bcd91c28ebcf578774a21c9698259c4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 7 Dec 2022 23:18:35 +0000 Subject: [PATCH 08/22] Apply style updates --- tests/tools/sanitizers/sanitizer_tests.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index f42bdc73f..20977381f 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -62,8 +62,8 @@ int main(int argc, char* argv[]) if (argc < 4) { std::cout << "Usage: requires 3 arguments." << std::endl; std::cout << "First, an allocation strategy (QuickPool or DynamicPoolList)." << std::endl; - std::cout << "Second, a test type (read or write)." << std::endl; - std::cout << "Third, a resource type (DEVICE, HOST, or UM)." << std::endl; + std::cout << "Second, a test type (read or write)." << std::endl; + std::cout << "Third, a resource type (DEVICE, HOST, or UM)." << std::endl; return 0; } @@ -73,11 +73,10 @@ int main(int argc, char* argv[]) auto& rm = umpire::ResourceManager::getInstance(); - if ((resource_type.find("DEVICE") != std::string::npos) || - (resource_type.find("UM") != std::string::npos)) { -#if !defined (UMPIRE_ENABLE_HIP) - UMPIRE_ERROR(runtime_error, - umpire::fmt::format("The resource, \"{}\", can't be used if HIP is not enabled.", resource_type)); + if ((resource_type.find("DEVICE") != std::string::npos) || (resource_type.find("UM") != std::string::npos)) { +#if !defined(UMPIRE_ENABLE_HIP) + UMPIRE_ERROR(runtime_error, + umpire::fmt::format("The resource, \"{}\", can't be used if HIP is not enabled.", resource_type)); #endif } else { if (resource_type.find("HOST") == std::string::npos) { @@ -85,7 +84,7 @@ int main(int argc, char* argv[]) resource_type = "HOST"; } } - + if (strategy.find("DynamicPoolList") != std::string::npos) { auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); UMPIRE_USE_VAR(pool); @@ -97,9 +96,9 @@ int main(int argc, char* argv[]) auto pool = rm.makeAllocator("test_allocator", rm.getAllocator(resource_type)); UMPIRE_USE_VAR(pool); } - - std::cout << " Conducting sanitizer test with " << strategy << " strategy, " << test_type - << " test type, and the " << resource_type << " resource." << std::endl; + + std::cout << " Conducting sanitizer test with " << strategy << " strategy, " << test_type << " test type, and the " + << resource_type << " resource." << std::endl; // Conduct the test sanitizer_test(test_type, resource_type); From 6617aba01e4a819b21494081365605613ecdaf18 Mon Sep 17 00:00:00 2001 From: Kristi Belcher Date: Wed, 7 Dec 2022 15:39:30 -0800 Subject: [PATCH 09/22] adding hip define macros --- tests/tools/sanitizers/CMakeLists.txt | 2 +- tests/tools/sanitizers/sanitizer_tests.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/tools/sanitizers/CMakeLists.txt b/tests/tools/sanitizers/CMakeLists.txt index 044983294..bc320c64d 100644 --- a/tests/tools/sanitizers/CMakeLists.txt +++ b/tests/tools/sanitizers/CMakeLists.txt @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: (MIT) ############################################################################## -set (sanitizer_depends umpire) +set (sanitizer_depends umpire umpire_util) if (UMPIRE_ENABLE_HIP) set (sanitizer_depends diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index 20977381f..40b2536fb 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -6,16 +6,20 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include "umpire/util/Macros.hpp" +#include "umpire/util/error.hpp" #include "umpire/ResourceManager.hpp" #include "umpire/strategy/DynamicPoolList.hpp" #include "umpire/strategy/QuickPool.hpp" +#if defined(UMPIRE_ENABLE_HIP) __global__ void test_for_hip(double** data_ptr, std::size_t INDEX) { if (threadIdx.x == 0) { *data_ptr[INDEX] = 100; } } +#endif void sanitizer_test(const std::string test_type, const std::string resource_type) { @@ -28,8 +32,10 @@ void sanitizer_test(const std::string test_type, const std::string resource_type if (test_type.find("read") != std::string::npos) { if (resource_type != "HOST") { +#if defined(UMPIRE_ENABLE_HIP) hipLaunchKernelGGL(test_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); hipDeviceSynchronize(); +#endif } else { *data[INDEX] = 100; std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; @@ -43,8 +49,10 @@ void sanitizer_test(const std::string test_type, const std::string resource_type std::cout << "Test type did not match either option - using write" << std::endl; } if (resource_type != "HOST") { +#if defined(UMPIRE_ENABLE_HIP) hipLaunchKernelGGL(test_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); hipDeviceSynchronize(); +#endif } else { *data[INDEX] = 100; std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; @@ -75,7 +83,7 @@ int main(int argc, char* argv[]) if ((resource_type.find("DEVICE") != std::string::npos) || (resource_type.find("UM") != std::string::npos)) { #if !defined(UMPIRE_ENABLE_HIP) - UMPIRE_ERROR(runtime_error, + UMPIRE_ERROR(umpire::runtime_error, umpire::fmt::format("The resource, \"{}\", can't be used if HIP is not enabled.", resource_type)); #endif } else { From 4c172807c8e665f16b4da50646fb0c7612c9da1d Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 7 Dec 2022 23:40:46 +0000 Subject: [PATCH 10/22] Apply style updates --- tests/tools/sanitizers/sanitizer_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index 40b2536fb..93f53e678 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -6,11 +6,11 @@ ////////////////////////////////////////////////////////////////////////////// #include -#include "umpire/util/Macros.hpp" -#include "umpire/util/error.hpp" #include "umpire/ResourceManager.hpp" #include "umpire/strategy/DynamicPoolList.hpp" #include "umpire/strategy/QuickPool.hpp" +#include "umpire/util/Macros.hpp" +#include "umpire/util/error.hpp" #if defined(UMPIRE_ENABLE_HIP) __global__ void test_for_hip(double** data_ptr, std::size_t INDEX) From 5379807e781cd0801df4520d3b79b7350101ed0b Mon Sep 17 00:00:00 2001 From: Kristi Belcher Date: Thu, 8 Dec 2022 14:23:53 -0800 Subject: [PATCH 11/22] getting rid of double pointer --- tests/tools/sanitizers/sanitizer_tests.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index 93f53e678..967b31756 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -13,10 +13,10 @@ #include "umpire/util/error.hpp" #if defined(UMPIRE_ENABLE_HIP) -__global__ void test_for_hip(double** data_ptr, std::size_t INDEX) +__global__ void test_for_hip(double* data_ptr, std::size_t INDEX) { if (threadIdx.x == 0) { - *data_ptr[INDEX] = 100; + data_ptr[INDEX] = 100; } } #endif @@ -28,7 +28,7 @@ void sanitizer_test(const std::string test_type, const std::string resource_type const std::size_t SIZE = 1356; const std::size_t INDEX = SIZE / 2; - double** data = static_cast(allocator.allocate(SIZE * sizeof(double*))); + double* data = static_cast(allocator.allocate(SIZE * sizeof(double))); if (test_type.find("read") != std::string::npos) { if (resource_type != "HOST") { @@ -37,13 +37,13 @@ void sanitizer_test(const std::string test_type, const std::string resource_type hipDeviceSynchronize(); #endif } else { - *data[INDEX] = 100; - std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; + data[INDEX] = 100; + std::cout << "data[INDEX] = " << data[INDEX] << std::endl; } // Test read after free from host allocator.deallocate(data); - std::cout << "data[256] = " << *data[256] << std::endl; + std::cout << "data[256] = " << data[256] << std::endl; } else { if (test_type.find("write") == std::string::npos) { std::cout << "Test type did not match either option - using write" << std::endl; @@ -54,14 +54,14 @@ void sanitizer_test(const std::string test_type, const std::string resource_type hipDeviceSynchronize(); #endif } else { - *data[INDEX] = 100; - std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; + data[INDEX] = 100; + std::cout << "data[INDEX] = " << data[INDEX] << std::endl; } // Test write after free from host allocator.deallocate(data); - *data[INDEX] = -1; - std::cout << "data[INDEX] = " << *data[INDEX] << std::endl; + data[INDEX] = -1; + std::cout << "data[INDEX] = " << data[INDEX] << std::endl; } } From 4e4804f52309f5ef2aaaf0050f65c6ba1e91073f Mon Sep 17 00:00:00 2001 From: Kristi Belcher Date: Wed, 21 Dec 2022 09:31:50 -0800 Subject: [PATCH 12/22] updating sanitizer test --- tests/tools/sanitizers/sanitizer_tests.cpp | 40 ++++++++++------------ 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index 967b31756..30c151977 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -13,15 +13,23 @@ #include "umpire/util/error.hpp" #if defined(UMPIRE_ENABLE_HIP) -__global__ void test_for_hip(double* data_ptr, std::size_t INDEX) +__global__ void test_read_for_hip(double* data_ptr, std::size_t INDEX) { if (threadIdx.x == 0) { - data_ptr[INDEX] = 100; + double dummy = data_ptr[INDEX]; + dummy = dummy + 42; + } +} +__global__ void test_write_for_hip(double* data_ptr, std::size_t INDEX) +{ + if (threadIdx.x == 0) { + data_ptr[INDEX] = 256; + data_ptr[INDEX] = INDEX + 42; } } #endif -void sanitizer_test(const std::string test_type, const std::string resource_type) +void sanitizer_test(const std::string test_type) { auto& rm = umpire::ResourceManager::getInstance(); auto allocator = rm.getAllocator("test_allocator"); @@ -29,37 +37,25 @@ void sanitizer_test(const std::string test_type, const std::string resource_type const std::size_t SIZE = 1356; const std::size_t INDEX = SIZE / 2; double* data = static_cast(allocator.allocate(SIZE * sizeof(double))); + + data[INDEX] = 100; + std::cout << "data[INDEX] = " << data[INDEX] << std::endl; + allocator.deallocate(data); if (test_type.find("read") != std::string::npos) { - if (resource_type != "HOST") { #if defined(UMPIRE_ENABLE_HIP) - hipLaunchKernelGGL(test_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); + hipLaunchKernelGGL(test_read_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); hipDeviceSynchronize(); #endif - } else { - data[INDEX] = 100; - std::cout << "data[INDEX] = " << data[INDEX] << std::endl; - } - - // Test read after free from host - allocator.deallocate(data); std::cout << "data[256] = " << data[256] << std::endl; } else { if (test_type.find("write") == std::string::npos) { std::cout << "Test type did not match either option - using write" << std::endl; } - if (resource_type != "HOST") { #if defined(UMPIRE_ENABLE_HIP) - hipLaunchKernelGGL(test_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); + hipLaunchKernelGGL(test_write_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); hipDeviceSynchronize(); #endif - } else { - data[INDEX] = 100; - std::cout << "data[INDEX] = " << data[INDEX] << std::endl; - } - - // Test write after free from host - allocator.deallocate(data); data[INDEX] = -1; std::cout << "data[INDEX] = " << data[INDEX] << std::endl; } @@ -109,7 +105,7 @@ int main(int argc, char* argv[]) << resource_type << " resource." << std::endl; // Conduct the test - sanitizer_test(test_type, resource_type); + sanitizer_test(test_type); return 0; } From 4b9250244c65b901c07efbfc381a666169e780db Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 21 Dec 2022 17:33:11 +0000 Subject: [PATCH 13/22] Apply style updates --- tests/tools/sanitizers/sanitizer_tests.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index 30c151977..933160de6 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -16,7 +16,7 @@ __global__ void test_read_for_hip(double* data_ptr, std::size_t INDEX) { if (threadIdx.x == 0) { - double dummy = data_ptr[INDEX]; + double dummy = data_ptr[INDEX]; dummy = dummy + 42; } } @@ -37,15 +37,15 @@ void sanitizer_test(const std::string test_type) const std::size_t SIZE = 1356; const std::size_t INDEX = SIZE / 2; double* data = static_cast(allocator.allocate(SIZE * sizeof(double))); - + data[INDEX] = 100; std::cout << "data[INDEX] = " << data[INDEX] << std::endl; allocator.deallocate(data); if (test_type.find("read") != std::string::npos) { #if defined(UMPIRE_ENABLE_HIP) - hipLaunchKernelGGL(test_read_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); - hipDeviceSynchronize(); + hipLaunchKernelGGL(test_read_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); + hipDeviceSynchronize(); #endif std::cout << "data[256] = " << data[256] << std::endl; } else { @@ -53,8 +53,8 @@ void sanitizer_test(const std::string test_type) std::cout << "Test type did not match either option - using write" << std::endl; } #if defined(UMPIRE_ENABLE_HIP) - hipLaunchKernelGGL(test_write_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); - hipDeviceSynchronize(); + hipLaunchKernelGGL(test_write_for_hip, dim3(1), dim3(16), 0, 0, data, INDEX); + hipDeviceSynchronize(); #endif data[INDEX] = -1; std::cout << "data[INDEX] = " << data[INDEX] << std::endl; From e9bf9f66665cc9afe73d37fc20e3ec18fecb1139 Mon Sep 17 00:00:00 2001 From: Kristi Belcher Date: Mon, 22 Jan 2024 10:40:31 -0800 Subject: [PATCH 14/22] adding flag for hip asan --- .gitlab/jobs/lassen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/jobs/lassen.yml b/.gitlab/jobs/lassen.yml index d510e3b56..8826a7398 100644 --- a/.gitlab/jobs/lassen.yml +++ b/.gitlab/jobs/lassen.yml @@ -43,7 +43,7 @@ clang_12_0_1_libcpp: clang_12_0_1_gcc_8_3_1_memleak: variables: - SPEC: "~shared +asan +sanitizer_tests +tools tests=basic %clang@12.0.1.gcc.8.3.1 cxxflags==-fsanitize=address" + SPEC: "~shared +asan +sanitizer_tests +tools tests=basic %clang@12.0.1.gcc.8.3.1 cxxflags==\"-fsanitize=address -Wl,-rpath=/opt/rocm-6.0.0/llvm/lib/clang/17.0.0/lib/linux/\"" ASAN_OPTIONS: "detect_leaks=1" extends: .job_on_lassen From 0232f2c49dfc97697db432ae9c963008f5b8e15f Mon Sep 17 00:00:00 2001 From: Kristi Belcher Date: Mon, 22 Jan 2024 14:23:50 -0800 Subject: [PATCH 15/22] updates for rocm test --- .gitlab/jobs/lassen.yml | 2 +- .gitlab/jobs/tioga.yml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitlab/jobs/lassen.yml b/.gitlab/jobs/lassen.yml index 8826a7398..efeb5c247 100644 --- a/.gitlab/jobs/lassen.yml +++ b/.gitlab/jobs/lassen.yml @@ -43,7 +43,7 @@ clang_12_0_1_libcpp: clang_12_0_1_gcc_8_3_1_memleak: variables: - SPEC: "~shared +asan +sanitizer_tests +tools tests=basic %clang@12.0.1.gcc.8.3.1 cxxflags==\"-fsanitize=address -Wl,-rpath=/opt/rocm-6.0.0/llvm/lib/clang/17.0.0/lib/linux/\"" + SPEC: "~shared +asan +sanitizer_tests +tools tests=basic %clang@12.0.1.gcc.8.3.1 cxxflags==\"-fsanitize=address\"" ASAN_OPTIONS: "detect_leaks=1" extends: .job_on_lassen diff --git a/.gitlab/jobs/tioga.yml b/.gitlab/jobs/tioga.yml index 9ed9e9df9..094241abd 100644 --- a/.gitlab/jobs/tioga.yml +++ b/.gitlab/jobs/tioga.yml @@ -34,3 +34,10 @@ rocmcc_5_6_0_hip_openmp_device_alloc: SPEC: "~shared +fortran +openmp +rocm +device_alloc tests=basic amdgpu_target=gfx90a %rocmcc@5.6.0 ^hip@5.6.0" extends: .job_on_tioga +# To be added when support for rocm 6.0.0 is added +#rocmcc_6_0_0_hip_memleak: +# variables: +# SPEC: "~shared +asan +sanitizer_tests +tools +rocm tests=basic cxxflags==\"-fsanitize=address -Wl,-rpath=/opt/rocm-6.0.0/llvm/lib/clang/17.0.0/lib/linux/\" %rocmcc@6.0.0 ^hip@6.0.0" +# ASAN_OPTIONS: "detect_leaks=1" +# extends: .job_on_corona +# From f154c0880ca4687a6dd0504ec68a177b36967bae Mon Sep 17 00:00:00 2001 From: Kristi Belcher Date: Tue, 23 Jan 2024 09:44:10 -0800 Subject: [PATCH 16/22] had to update the test runner to handle new paramter --- tests/tools/sanitizers/sanitizer_test_runner.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/tools/sanitizers/sanitizer_test_runner.py b/tests/tools/sanitizers/sanitizer_test_runner.py index 544f74693..74197addc 100644 --- a/tests/tools/sanitizers/sanitizer_test_runner.py +++ b/tests/tools/sanitizers/sanitizer_test_runner.py @@ -31,13 +31,14 @@ def check_output(file_object, expected): print("{BLUE}[ OK]{END} Found \"{expected}\"".format(expected=expected, **formatters)) -def run_sanitizer_test(strategy, kind): +def run_sanitizer_test(strategy, kind, resource): import subprocess import os cmd_args = ['./sanitizer_tests'] cmd_args.append(strategy) cmd_args.append(kind) + cmd_args.append(resource) test_program = subprocess.Popen(cmd_args, stdout=subprocess.PIPE, @@ -57,9 +58,9 @@ def run_sanitizer_test(strategy, kind): import sys print("{BLUE}[--------]{END}".format(**formatters)) - run_sanitizer_test('DynamicPoolList', 'read') - run_sanitizer_test('DynamicPoolList', 'write') - run_sanitizer_test('QuickPool', 'read') - run_sanitizer_test('QuickPool', 'write') + run_sanitizer_test('DynamicPoolList', 'read', 'HOST') + run_sanitizer_test('DynamicPoolList', 'write', 'HOST') + run_sanitizer_test('QuickPool', 'read', 'HOST') + run_sanitizer_test('QuickPool', 'write', 'HOST') print("{BLUE}[--------]{END}".format(**formatters)) sys.exit(errors) From 417b66d32bec5dabd95561c69b0a5a88f4ddc211 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 6 Jun 2024 13:30:03 -0700 Subject: [PATCH 17/22] Remove umpire namespace from fmt call --- tests/tools/sanitizers/sanitizer_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tools/sanitizers/sanitizer_tests.cpp b/tests/tools/sanitizers/sanitizer_tests.cpp index bddfe959d..cb458256e 100644 --- a/tests/tools/sanitizers/sanitizer_tests.cpp +++ b/tests/tools/sanitizers/sanitizer_tests.cpp @@ -80,7 +80,7 @@ int main(int argc, char* argv[]) if ((resource_type.find("DEVICE") != std::string::npos) || (resource_type.find("UM") != std::string::npos)) { #if !defined(UMPIRE_ENABLE_HIP) UMPIRE_ERROR(umpire::runtime_error, - umpire::fmt::format("The resource, \"{}\", can't be used if HIP is not enabled.", resource_type)); + fmt::format("The resource, \"{}\", can't be used if HIP is not enabled.", resource_type)); #endif } else { if (resource_type.find("HOST") == std::string::npos) { From 43f08756e5dc61e2ec5cee165d7078f0d3b3f1ff Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Fri, 7 Jun 2024 10:19:30 -0700 Subject: [PATCH 18/22] Allow +tools+rocm in Umpire package --- scripts/radiuss-spack-configs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs index 7b49b844e..fb2882036 160000 --- a/scripts/radiuss-spack-configs +++ b/scripts/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 7b49b844e90f9b10101bec6236952c1047c1d0f4 +Subproject commit fb2882036f9fda449b0ad955026a31711fe810e2 From f76f5be60ad69232dab96c559c951834c7719d73 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Fri, 7 Jun 2024 11:01:51 -0700 Subject: [PATCH 19/22] Add amdgpu_target for new memleak job --- .gitlab/jobs/tioga.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/jobs/tioga.yml b/.gitlab/jobs/tioga.yml index e589163f2..24d2be644 100644 --- a/.gitlab/jobs/tioga.yml +++ b/.gitlab/jobs/tioga.yml @@ -43,6 +43,6 @@ rocmcc_6_1_1_hip_openmp_device_alloc: rocmcc_6_1_1_hip_memleak: variables: - SPEC: "~shared +asan +sanitizer_tests +tools +rocm tests=basic cxxflags==\"-fsanitize=address -Wl,-rpath=/opt/rocm-6.0.0/llvm/lib/clang/17.0.0/lib/linux/\" %rocmcc@6.1.1 ^hip@6.1.1" + SPEC: "~shared +asan +sanitizer_tests +tools +rocm tests=basic amdgpu_target=gfx90a cxxflags==\"-fsanitize=address -Wl,-rpath=/opt/rocm-6.0.0/llvm/lib/clang/17.0.0/lib/linux/\" %rocmcc@6.1.1 ^hip@6.1.1" ASAN_OPTIONS: "detect_leaks=1" extends: .job_on_tioga From f2eb907fa1f4fa3c39143da9b1264ca3981acf2c Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Fri, 7 Jun 2024 11:36:37 -0700 Subject: [PATCH 20/22] remove extra linker flags --- .gitlab/jobs/tioga.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/jobs/tioga.yml b/.gitlab/jobs/tioga.yml index 24d2be644..d5d6dad59 100644 --- a/.gitlab/jobs/tioga.yml +++ b/.gitlab/jobs/tioga.yml @@ -43,6 +43,6 @@ rocmcc_6_1_1_hip_openmp_device_alloc: rocmcc_6_1_1_hip_memleak: variables: - SPEC: "~shared +asan +sanitizer_tests +tools +rocm tests=basic amdgpu_target=gfx90a cxxflags==\"-fsanitize=address -Wl,-rpath=/opt/rocm-6.0.0/llvm/lib/clang/17.0.0/lib/linux/\" %rocmcc@6.1.1 ^hip@6.1.1" + SPEC: "~shared +asan +sanitizer_tests +tools +rocm tests=basic amdgpu_target=gfx90a cxxflags==\"-fsanitize=address\" %rocmcc@6.1.1 ^hip@6.1.1" ASAN_OPTIONS: "detect_leaks=1" extends: .job_on_tioga From 133230151e268af70960d11afc3485787ab28f67 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Fri, 7 Jun 2024 12:01:54 -0700 Subject: [PATCH 21/22] Add xnack+ to target for memleak job --- .gitlab/jobs/tioga.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/jobs/tioga.yml b/.gitlab/jobs/tioga.yml index d5d6dad59..879b08a74 100644 --- a/.gitlab/jobs/tioga.yml +++ b/.gitlab/jobs/tioga.yml @@ -43,6 +43,6 @@ rocmcc_6_1_1_hip_openmp_device_alloc: rocmcc_6_1_1_hip_memleak: variables: - SPEC: "~shared +asan +sanitizer_tests +tools +rocm tests=basic amdgpu_target=gfx90a cxxflags==\"-fsanitize=address\" %rocmcc@6.1.1 ^hip@6.1.1" + SPEC: "~shared +asan +sanitizer_tests +tools +rocm tests=basic amdgpu_target=gfx90a:xnack+ cxxflags==\"-fsanitize=address\" %rocmcc@6.1.1 ^hip@6.1.1" ASAN_OPTIONS: "detect_leaks=1" extends: .job_on_tioga From 9022631f5802b3f9df32638698d4a908edf07669 Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Mon, 10 Jun 2024 11:09:47 +0200 Subject: [PATCH 22/22] Increase allocation on tioga due to memleak job --- .gitlab/custom-jobs-and-variables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml index 2222c26a3..885467997 100644 --- a/.gitlab/custom-jobs-and-variables.yml +++ b/.gitlab/custom-jobs-and-variables.yml @@ -45,7 +45,7 @@ variables: # Tioga # Arguments for top level allocation - TIOGA_SHARED_ALLOC: "--queue=pci --exclusive --time-limit=15m --nodes=1" + TIOGA_SHARED_ALLOC: "--queue=pci --exclusive --time-limit=60m --nodes=1" # Arguments for job level allocation TIOGA_JOB_ALLOC: "--nodes=1 --begin-time=+5s" # Project specific variants for tioga