9#define BOOST_TEST_DYN_LINK
10#include <boost/test/unit_test.hpp>
13#include "VCluster_unit_test_util.hpp"
14#include "Point_test.hpp"
15#include "VCluster_base.hpp"
16#include "Vector/vector_test_util.hpp"
17#include "VCluster/VCluster.hpp"
18#include "VCluster/cuda/VCluster_unit_test_util_cuda.cuh"
20BOOST_AUTO_TEST_SUITE( VCluster_test )
22BOOST_AUTO_TEST_CASE (Vcluster_robustness)
29BOOST_AUTO_TEST_CASE( VCluster_use_reductions)
39 unsigned short us = 1;
43 unsigned long int uli = 1;
116#define N_V_ELEMENTS 16
118BOOST_AUTO_TEST_CASE(VCluster_send_recv)
122 test_send_recv_complex(N_V_ELEMENTS,vcl);
123 test_send_recv_primitives<unsigned char>(N_V_ELEMENTS,vcl);
124 test_send_recv_primitives<char>(N_V_ELEMENTS,vcl);
125 test_send_recv_primitives<short>(N_V_ELEMENTS,vcl);
126 test_send_recv_primitives<unsigned short>(N_V_ELEMENTS,vcl);
127 test_send_recv_primitives<int>(N_V_ELEMENTS,vcl);
128 test_send_recv_primitives<unsigned int>(N_V_ELEMENTS,vcl);
129 test_send_recv_primitives<long int>(N_V_ELEMENTS,vcl);
130 test_send_recv_primitives<unsigned long int>(N_V_ELEMENTS,vcl);
131 test_send_recv_primitives<float>(N_V_ELEMENTS,vcl);
132 test_send_recv_primitives<double>(N_V_ELEMENTS,vcl);
135BOOST_AUTO_TEST_CASE(VCluster_allgather)
140 test_single_all_gather_primitives<unsigned char>(vcl);
143 test_single_all_gather_primitives<char>(vcl);
145 test_single_all_gather_primitives<short>(vcl);
146 test_single_all_gather_primitives<unsigned short>(vcl);
147 test_single_all_gather_primitives<int>(vcl);
148 test_single_all_gather_primitives<unsigned int>(vcl);
149 test_single_all_gather_primitives<long int>(vcl);
150 test_single_all_gather_primitives<unsigned long int>(vcl);
151 test_single_all_gather_primitives<float>(vcl);
152 test_single_all_gather_primitives<double>(vcl);
161BOOST_AUTO_TEST_CASE(VCluster_bcast_test)
165 std::cout <<
"Broadcast test " << std::endl;
167 test_single_all_broadcast_primitives<unsigned char,HeapMemory,memory_traits_lin>(vcl);
168 test_single_all_broadcast_primitives<char,HeapMemory,memory_traits_lin>(vcl);
169 test_single_all_broadcast_primitives<short,HeapMemory,memory_traits_lin>(vcl);
170 test_single_all_broadcast_primitives<unsigned short,HeapMemory,memory_traits_lin>(vcl);
171 test_single_all_broadcast_primitives<int,HeapMemory,memory_traits_lin>(vcl);
172 test_single_all_broadcast_primitives<unsigned int,HeapMemory,memory_traits_lin>(vcl);
173 test_single_all_broadcast_primitives<long int,HeapMemory,memory_traits_lin>(vcl);
174 test_single_all_broadcast_primitives<unsigned long int,HeapMemory,memory_traits_lin>(vcl);
175 test_single_all_broadcast_primitives<float,HeapMemory,memory_traits_lin>(vcl);
176 test_single_all_broadcast_primitives<double,HeapMemory,memory_traits_lin>(vcl);
179BOOST_AUTO_TEST_CASE(VCluster_bcast_complex_test)
183 std::cout <<
"Broadcast complex test " << std::endl;
189BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_short_unkn)
191 std::cout <<
"VCluster unit test start sendrecv short unknown" <<
"\n";
194 test_short<NBX>(RECEIVE_UNKNOWN);
196 std::cout <<
"VCluster unit test stop sendrecv short unknown" <<
"\n";
199BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_short_unkn_async)
201 std::cout <<
"VCluster unit test start sendrecv short unknown async" <<
"\n";
204 test_short<NBX_ASYNC>(RECEIVE_UNKNOWN);
206 std::cout <<
"VCluster unit test stop sendrecv short unknown async" <<
"\n";
209BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_short_unkn_async_multiple)
211 std::cout <<
"VCluster unit test start sendrecv short unknown async multiple" <<
"\n";
214 test_short_multiple<NBX_ASYNC>(RECEIVE_UNKNOWN);
216 std::cout <<
"VCluster unit test stop sendrecv short unknown async multiple" <<
"\n";
219BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_rand_unkn)
221 std::cout <<
"VCluster unit test start sendrecv random unknown" <<
"\n";
224 test_random<NBX>(RECEIVE_UNKNOWN);
226 std::cout <<
"VCluster unit test stop sendrecv random unknown" <<
"\n";
229BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_rand_unkn_async)
231 std::cout <<
"VCluster unit test start sendrecv random unknown async" <<
"\n";
234 test_random<NBX_ASYNC>(RECEIVE_UNKNOWN);
236 std::cout <<
"VCluster unit test stop sendrecv random unknown async" <<
"\n";
239BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_rand_unkn_async_multiple)
241 std::cout <<
"VCluster unit test start sendrecv random unknown async" <<
"\n";
244 test_random_multiple<NBX_ASYNC>(RECEIVE_UNKNOWN);
246 std::cout <<
"VCluster unit test stop sendrecv random unknown async" <<
"\n";
250BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_someempty)
252 std::cout <<
"VCluster unit test start sendrecv some empty" <<
"\n";
255 test_no_send_some_peer<NBX>();
257 std::cout <<
"VCluster unit test stop sendrecv some empty" <<
"\n";
260BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_short_prc_known)
262 std::cout <<
"VCluster unit test start sendrecv short known prc" <<
"\n";
265 test_short<NBX>(RECEIVE_SIZE_UNKNOWN);
267 std::cout <<
"VCluster unit test stop sendrecv short known prc" <<
"\n";
270BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_short_prc_known_multiple)
272 std::cout <<
"VCluster unit test start sendrecv short known prc" <<
"\n";
275 test_short_multiple<NBX>(RECEIVE_SIZE_UNKNOWN);
277 std::cout <<
"VCluster unit test stop sendrecv short known prc" <<
"\n";
280BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_random_prc_known)
282 std::cout <<
"VCluster unit test start sendrecv random known prc" <<
"\n";
285 test_random<NBX>(RECEIVE_SIZE_UNKNOWN);
287 std::cout <<
"VCluster unit test stop sendrecv random known prc" <<
"\n";
290BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known )
292 std::cout <<
"VCluster unit test start known" <<
"\n";
296 std::cout <<
"VCluster unit test stop known" <<
"\n";
299BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known_async )
301 std::cout <<
"VCluster unit test start known" <<
"\n";
303 test_known<NBX_ASYNC>(0);
305 std::cout <<
"VCluster unit test stop known" <<
"\n";
308BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known_async_multiple )
310 std::cout <<
"VCluster unit test start known" <<
"\n";
312 test_known_multiple<NBX_ASYNC>(0);
314 std::cout <<
"VCluster unit test stop known" <<
"\n";
317BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known_prc )
319 std::cout <<
"VCluster unit test start known prc" <<
"\n";
321 test_known<NBX>(KNOWN_PRC);
323 std::cout <<
"VCluster unit test stop known prc" <<
"\n";
326BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known_prc_async )
328 std::cout <<
"VCluster unit test start known prc" <<
"\n";
330 test_known<NBX_ASYNC>(KNOWN_PRC);
332 std::cout <<
"VCluster unit test stop known prc" <<
"\n";
335BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv_known_prc_async_multiple )
337 std::cout <<
"VCluster unit test start known prc" <<
"\n";
339 test_known_multiple<NBX_ASYNC>(KNOWN_PRC);
341 std::cout <<
"VCluster unit test stop known prc" <<
"\n";
344BOOST_AUTO_TEST_SUITE_END()
This class allocate, and destroy CPU memory.
void execute()
Execute all the requests.
void sum(T &num)
Sum the numbers across all processors and get the result.
size_t getProcessUnitID()
Get the process unit id.
size_t getProcessingUnits()
Get the total number of processors.
void max(T &num)
Get the maximum number across all processors (or reduction with infinity norm)
Implementation of VCluster class.
Transform the boost::fusion::vector into memory specification (memory_traits)
Transform the boost::fusion::vector into memory specification (memory_traits)