|
@@ -28,6 +28,9 @@ NTL_CLIENT
|
|
|
|
|
|
|
|
// #undef VERBOSE
|
|
// #undef VERBOSE
|
|
|
|
|
|
|
|
|
|
+// Used to prefix output from this process
|
|
|
|
|
+std::string output_prefix;
|
|
|
|
|
+
|
|
|
struct SubproblemProgress;
|
|
struct SubproblemProgress;
|
|
|
|
|
|
|
|
typedef std::set<struct bufferevent *> BESet;
|
|
typedef std::set<struct bufferevent *> BESet;
|
|
@@ -403,8 +406,14 @@ static void computation_complete(void)
|
|
|
sprintf(length_buf, "%lld.%03lld s", computation_length_ms / 1000,
|
|
sprintf(length_buf, "%lld.%03lld s", computation_length_ms / 1000,
|
|
|
computation_length_ms % 1000);
|
|
computation_length_ms % 1000);
|
|
|
|
|
|
|
|
- cout << "expon = " << expon << "\n";
|
|
|
|
|
- cout << ctrlstate.worklist[0].first << " ";
|
|
|
|
|
|
|
+ char timestamp[20];
|
|
|
|
|
+ sprintf(timestamp, "%d.%06d",
|
|
|
|
|
+ (int)ended_working.tv_sec, (int)ended_working.tv_usec);
|
|
|
|
|
+
|
|
|
|
|
+ cout << timestamp << ":" << output_prefix << ": " <<
|
|
|
|
|
+ "expon = " << expon << "\n";
|
|
|
|
|
+ cout << timestamp << ":" << output_prefix << ": " <<
|
|
|
|
|
+ ctrlstate.worklist[0].first << " ";
|
|
|
ZZ base_exp = PowerMod(ctrlstate.base, expon, ctrlstate.rho);
|
|
ZZ base_exp = PowerMod(ctrlstate.base, expon, ctrlstate.rho);
|
|
|
if (base_exp == ctrlstate.target) {
|
|
if (base_exp == ctrlstate.target) {
|
|
|
cout << "CORRECT in " << length_buf << "\n";
|
|
cout << "CORRECT in " << length_buf << "\n";
|
|
@@ -821,6 +830,12 @@ int controller_main(const Worklist &worklist, unsigned short bindport,
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Initialize the output prefix
|
|
|
|
|
+ char prefix[300];
|
|
|
|
|
+ gethostname(prefix, 256);
|
|
|
|
|
+ strcat(prefix, "-C");
|
|
|
|
|
+ output_prefix = std::string(prefix);
|
|
|
|
|
+
|
|
|
ctrlstate.worklist = worklist;
|
|
ctrlstate.worklist = worklist;
|
|
|
|
|
|
|
|
// Read the modulus and the factorization of its totient from the
|
|
// Read the modulus and the factorization of its totient from the
|