Exemple #1
0
 void run_threaded_string_sends_0(size_t length, size_t numthreads) {
   if (rmi.procid() == 1) {
     rmi.full_barrier();
     return;
   }
   timer ti;
   std::cout << numthreads << " threaded " << SEND_LIMIT_PRINT <<" sends, "
                                           << length << " bytes\n";
   ti.start();
   size_t numsends = SEND_LIMIT / (length * numthreads);
   size_t rd = rdtsc();
   thread_group thrgrp;
   for (size_t i = 0; i < numthreads; ++i) {
     thrgrp.launch(boost::bind(&teststruct::perform_string_sends_0, this, length, numsends));
   }
   thrgrp.join();
   size_t rd2 = rdtsc();
   std::cout << (rd2 - rd) / (numthreads * numsends)  << " cycles per call\n";
   double t1 = ti.current_time();
   rmi.dc().flush();
   double t2 = ti.current_time();
   rmi.full_barrier();
   double t3 = ti.current_time();
   print_res(t1,t2,t3);
 }
 void task(size_t i) {
   if (i < 5) std::cout << "Task " << i << std::endl;
   if (i > 0) {
     if (rmi.numprocs() == 1) {
       add_task_local(i - 1);
     }
     else {
       rmi.remote_call((procid_t)((rmi.procid() + 1) % rmi.numprocs()),
                   &simple_engine_test::add_task_local,
                   i - 1);
     }
   }
 }
Exemple #3
0
 void run_short_sends_0() {
   if (rmi.procid() == 1) {
     rmi.full_barrier();
     return;
   }
   timer ti;
   std::cout << "Single Threaded " << SEND_LIMIT_PRINT << " sends, 4 integer blocks\n";
   ti.start();
   size_t numsends = SEND_LIMIT / (sizeof(size_t) * 4);
   perform_short_sends_0(numsends);
   double t1 = ti.current_time();
   rmi.dc().flush();
   double t2 = ti.current_time();
   rmi.full_barrier();
   double t3 = ti.current_time();
   print_res(t1,t2,t3);
 }
Exemple #4
0
 void run_threaded_short_pod_sends_0(size_t numthreads) {
   if (rmi.procid() == 1) {
     rmi.full_barrier();
     return;
   }
   timer ti;
   std::cout << numthreads << " threaded "<< SEND_LIMIT_PRINT <<" POD sends, 4 integers\n";
   size_t numsends = SEND_LIMIT / (sizeof(size_t) * 4 * numthreads);
   ti.start();
   thread_group thrgrp;
   for (size_t i = 0; i < numthreads; ++i) {
     thrgrp.launch(boost::bind(&teststruct::perform_short_pod_sends_0, this, numsends));
   }
   thrgrp.join();
   double t1 = ti.current_time();
   rmi.dc().flush();
   double t2 = ti.current_time();
   rmi.full_barrier();
   double t3 = ti.current_time();
   print_res(t1,t2,t3);
 }
Exemple #5
0
 void run_string_sends_0(size_t length) {
   if (rmi.procid() == 1) {
     rmi.full_barrier();
     return;
   }
   timer ti;
   size_t numsends = SEND_LIMIT / (length);
   std::cout << "Single Threaded " << SEND_LIMIT_PRINT <<" sends, " << length << " bytes * "<< numsends <<  "\n";
   ti.start();
   size_t rd = rdtsc();
   perform_string_sends_0(length, numsends);
   size_t rd2 = rdtsc();
   std::cout << "Completed in: " << ti.current_time() << " seconds\n";
   std::cout << (rd2 - rd) / numsends << " cycles per call\n";
   double t1 = ti.current_time();
   rmi.dc().flush();
   std::cout << "Flush in: " << ti.current_time() << " seconds\n";
   double t2 = ti.current_time();
   rmi.full_barrier();
   std::cout << "Receive Complete in: " << ti.current_time() << " seconds\n";
   double t3 = ti.current_time();
   print_res(t1,t2,t3);
 }