From 1d07c1f860eb6a5d7ddb4c048c378ec6adbf6f2c Mon Sep 17 00:00:00 2001 From: Mark Berrill Date: Mon, 28 Jun 2021 13:50:45 -0400 Subject: [PATCH] Modifying GPU aware MPI test to send multiple messages --- tests/test_MPI.cpp | 69 +++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/tests/test_MPI.cpp b/tests/test_MPI.cpp index fd1e1778..9e3df9f2 100644 --- a/tests/test_MPI.cpp +++ b/tests/test_MPI.cpp @@ -1199,7 +1199,8 @@ void testCommDup( UnitTest *ut ) // Test GPU aware MPI void test_GPU_aware( UnitTest *ut ) { - size_t N = 1024*1024; + constexpr size_t N = 1024*1024; + constexpr size_t N_msg = 64; bool test = true; // Get the comm to use MPI_CLASS comm( MPI_COMM_WORLD ); @@ -1208,39 +1209,55 @@ void test_GPU_aware( UnitTest *ut ) try { // Initialize the device int device = ScaLBL_SetDevice(rank); - // Allocate buffers + // Allocate and initialize the buffers size_t bytes = N*sizeof(double); - double *device_send = nullptr, *device_recv = nullptr; - ScaLBL_AllocateDeviceMemory((void**)&device_send,bytes); - ScaLBL_AllocateDeviceMemory((void**)&device_recv,bytes); - auto host_send = new double[N]; - auto host_recv = new double[N]; - // Initialize the data - for ( size_t i=0; i