@@ -62,27 +62,27 @@ phase4::output_t create_plot( const int num_threads,
6262{
6363 const auto total_begin = get_wall_time_micros ();
6464
65- std::cout << " Process ID: " << GETPID () << std::endl;
66- std::cout << " Number of Threads: " << num_threads << std::endl;
67- std::cout << " Number of Buckets: 2^" << log_num_buckets
65+ std::cout << get_curr_datetime () << " Process ID: " << GETPID () << std::endl;
66+ std::cout << get_curr_datetime () << " Number of Threads: " << num_threads << std::endl;
67+ std::cout << get_curr_datetime () << " Number of Buckets: 2^" << log_num_buckets
6868 << " (" << (1 << log_num_buckets) << " )" << std::endl;
6969
7070 bls::G1Element pool_key;
7171 bls::G1Element farmer_key;
7272 try {
7373 pool_key = bls::G1Element::FromByteVector (pool_key_bytes);
7474 } catch (std::exception& ex) {
75- std::cout << " Invalid poolkey: " << bls::Util::HexStr (pool_key_bytes) << std::endl;
75+ std::cout << get_curr_datetime () << " Invalid poolkey: " << bls::Util::HexStr (pool_key_bytes) << std::endl;
7676 throw ;
7777 }
7878 try {
7979 farmer_key = bls::G1Element::FromByteVector (farmer_key_bytes);
8080 } catch (std::exception& ex) {
81- std::cout << " Invalid farmerkey: " << bls::Util::HexStr (farmer_key_bytes) << std::endl;
81+ std::cout << get_curr_datetime () << " Invalid farmerkey: " << bls::Util::HexStr (farmer_key_bytes) << std::endl;
8282 throw ;
8383 }
84- std::cout << " Pool Public Key: " << bls::Util::HexStr (pool_key.Serialize ()) << std::endl;
85- std::cout << " Farmer Public Key: " << bls::Util::HexStr (farmer_key.Serialize ()) << std::endl;
84+ std::cout << get_curr_datetime () << " Pool Public Key: " << bls::Util::HexStr (pool_key.Serialize ()) << std::endl;
85+ std::cout << get_curr_datetime () << " Farmer Public Key: " << bls::Util::HexStr (farmer_key.Serialize ()) << std::endl;
8686
8787 vector<uint8_t > seed (32 );
8888 randombytes_buf (seed.data (), seed.size ());
@@ -109,9 +109,9 @@ phase4::output_t create_plot( const int num_threads,
109109 const std::string plot_name = " plot-k32-" + get_date_string_ex (" %Y-%m-%d-%H-%M" )
110110 + " -" + bls::Util::HexStr (params.id .data (), params.id .size ());
111111
112- std::cout << " Working Directory: " << (tmp_dir.empty () ? " $PWD" : tmp_dir) << std::endl;
113- std::cout << " Working Directory 2: " << (tmp_dir_2.empty () ? " $PWD" : tmp_dir_2) << std::endl;
114- std::cout << " Plot Name: " << plot_name << std::endl;
112+ std::cout << get_curr_datetime () << " Working Directory: " << (tmp_dir.empty () ? " $PWD" : tmp_dir) << std::endl;
113+ std::cout << get_curr_datetime () << " Working Directory 2: " << (tmp_dir_2.empty () ? " $PWD" : tmp_dir_2) << std::endl;
114+ std::cout << get_curr_datetime () << " Plot Name: " << plot_name << std::endl;
115115
116116 // memo = bytes(pool_public_key) + bytes(farmer_public_key) + bytes(local_master_sk)
117117 params.memo .insert (params.memo .end (), pool_key_bytes.begin (), pool_key_bytes.end ());
@@ -135,7 +135,7 @@ phase4::output_t create_plot( const int num_threads,
135135 phase4::compute (out_3, out_4, num_threads, log_num_buckets, plot_name, tmp_dir, tmp_dir_2);
136136
137137 const auto time_secs = (get_wall_time_micros () - total_begin) / 1e6 ;
138- std::cout << " Total plot creation time was "
138+ std::cout << get_curr_datetime () << " Total plot creation time was "
139139 << time_secs << " sec (" << time_secs / 60 . << " min)" << std::endl;
140140 return out_4;
141141}
@@ -312,11 +312,11 @@ int main(int argc, char** argv)
312312 std::cout << " - " << GIT_COMMIT_HASH;
313313 #endif
314314 std::cout << std::endl;
315- std::cout << " Final Directory: " << final_dir << std::endl;
315+ std::cout << get_curr_datetime () << " Final Directory: " << final_dir << std::endl;
316316 if (num_plots >= 0 ) {
317- std::cout << " Number of Plots: " << num_plots << std::endl;
317+ std::cout << get_curr_datetime () << " Number of Plots: " << num_plots << std::endl;
318318 } else {
319- std::cout << " Number of Plots: infinite" << std::endl;
319+ std::cout << get_curr_datetime () << " Number of Plots: infinite" << std::endl;
320320 }
321321
322322 Thread<std::pair<std::string, std::string>> copy_thread (
@@ -327,11 +327,11 @@ int main(int argc, char** argv)
327327 const auto bytes = final_copy (from_to.first , from_to.second );
328328
329329 const auto time = (get_wall_time_micros () - total_begin) / 1e6 ;
330- std::cout << " Copy to " << from_to.second << " finished, took " << time << " sec, "
330+ std::cout << get_curr_datetime () << " Copy to " << from_to.second << " finished, took " << time << " sec, "
331331 << ((bytes / time) / 1024 / 1024 ) << " MB/s avg." << std::endl;
332332 break ;
333333 } catch (const std::exception& ex) {
334- std::cout << " Copy to " << from_to.second << " failed with: " << ex.what () << std::endl;
334+ std::cout << get_curr_datetime () << " Copy to " << from_to.second << " failed with: " << ex.what () << std::endl;
335335 std::this_thread::sleep_for (std::chrono::minutes (5 ));
336336 }
337337 }
@@ -343,13 +343,13 @@ int main(int argc, char** argv)
343343 std::cout << std::endl << " Process has been interrupted, waiting for copy/rename operations to finish ..." << std::endl;
344344 break ;
345345 }
346- std::cout << " Crafting plot " << i+1 << " out of " << num_plots << std::endl;
346+ std::cout << get_curr_datetime () << " Crafting plot " << i+1 << " out of " << num_plots << std::endl;
347347 const auto out = create_plot (num_threads, log_num_buckets, pool_key, farmer_key, tmp_dir, tmp_dir2);
348348
349349 if (final_dir != tmp_dir)
350350 {
351351 const auto dst_path = final_dir + out.params .plot_name + " .plot" ;
352- std::cout << " Started copy to " << dst_path << std::endl;
352+ std::cout << get_curr_datetime () << " Started copy to " << dst_path << std::endl;
353353 copy_thread.take_copy (std::make_pair (out.plot_file_name , dst_path));
354354 }
355355 }
0 commit comments