diff --git a/next/Test/main.cpp b/next/Test/main.cpp index 4387e3d..39479e2 100644 --- a/next/Test/main.cpp +++ b/next/Test/main.cpp @@ -72,8 +72,8 @@ void TestArray(int argc, char* argv[]) { MultiversoInit(&argc, argv); - ArrayWorker* shared_array = new ArrayWorker(10); - ArrayServer* server_array = new ArrayServer(10); + ArrayWorker* shared_array = new ArrayWorker(1000000); + ArrayServer* server_array = new ArrayServer(1000000); MultiversoBarrier(); Log::Info("Create tables OK\n"); @@ -85,17 +85,17 @@ void TestArray(int argc, char* argv[]) { // std::vector& vec = shared_array->raw(); // shared_array->Get(); - float data[10]; + float* data = new float[1000000]; - std::vector delta(10); - for (int i = 0; i < 10; ++i) + std::vector delta(1000000); + for (int i = 0; i < 1000000; ++i) delta[i] = static_cast(i); - shared_array->Add(delta.data(), 10); + shared_array->Add(delta.data(), 1000000); Log::Info("Rank %d Add OK\n", MultiversoRank()); - shared_array->Get(data, 10); + shared_array->Get(data, 1000000); Log::Info("Rank %d Get OK\n", MultiversoRank()); for (int i = 0; i < 10; ++i) std::cout << data[i] << " "; std::cout << std::endl; @@ -148,8 +148,8 @@ void TestMultipleThread(int argc, char* argv[]) //Log::ResetLogLevel(LogLevel::Debug); MultiversoInit(&argc, argv); - ArrayWorker* shared_array = new ArrayWorker(10); - ArrayServer* server_array = new ArrayServer(10); + ArrayWorker* shared_array = new ArrayWorker(1000000); + ArrayServer* server_array = new ArrayServer(1000000); std::thread* m_prefetchThread = nullptr; MultiversoBarrier(); Log::Info("Create tables OK\n"); @@ -158,10 +158,11 @@ void TestMultipleThread(int argc, char* argv[]) // std::vector& vec = shared_array->raw(); // shared_array->Get(); - float data[10]; + float* data = new float[1000000]; - std::vector delta(10); - for (int i = 0; i < 10; ++i) + + std::vector delta(1000000); + for (int i = 0; i < 1000000; ++i) delta[i] = static_cast(i); if (m_prefetchThread != nullptr && m_prefetchThread->joinable()) @@ -173,7 +174,7 @@ void TestMultipleThread(int argc, char* argv[]) std::mt19937_64 eng{ std::random_device{}() }; std::uniform_int_distribution<> dist{ 50, 500 }; std::this_thread::sleep_for(std::chrono::milliseconds{ dist(eng) }); - shared_array->Add(delta.data(), 10); + shared_array->Add(delta.data(), 1000000); Log::Info("Rank %d Add OK\n", MultiversoRank()); m_prefetchThread = new std::thread([&](){ @@ -181,7 +182,7 @@ void TestMultipleThread(int argc, char* argv[]) std::mt19937_64 eng{ std::random_device{}() }; std::uniform_int_distribution<> dist{ 50, 500 }; std::this_thread::sleep_for(std::chrono::milliseconds{ dist(eng) }); - shared_array->Get(data, 10); + shared_array->Get(data, 1000000); Log::Info("Rank %d Get OK\n", MultiversoRank()); for (int i = 0; i < 10; ++i) std::cout << data[i] << " "; std::cout << std::endl; diff --git a/next/include/multiverso/net/mpi_net.h b/next/include/multiverso/net/mpi_net.h index b515d82..3a429f5 100644 --- a/next/include/multiverso/net/mpi_net.h +++ b/next/include/multiverso/net/mpi_net.h @@ -48,7 +48,7 @@ public: int flag; MPI_Testall(count, handles_.data(), &flag, status); delete[] status; - return true; + return flag; } private: std::vector handles_;