|
|
@@ -22,9 +22,10 @@ struct Subproblem {
|
|
|
unsigned int dpfreq;
|
|
|
unsigned char desc[1 + SUBPROBLEM_DESC_LEN];
|
|
|
|
|
|
- Subproblem(unsigned short id, const ZZ &b, const ZZ &t, const ZZ &m,
|
|
|
- const ZZ &o, unsigned int dpf) : problemid(id), base(b),
|
|
|
- target(t), modulus(m), order(o), dpfreq(dpf) {
|
|
|
+ // Update the binary description of the subproblem. This is what
|
|
|
+ // gets sent to the dpnodes and workers.
|
|
|
+ void updatedesc(void)
|
|
|
+ {
|
|
|
desc[0] = 'P';
|
|
|
memmove(desc+1, &problemid, 2);
|
|
|
BytesFromZZ(desc+3, base, WORDS*sizeof(unsigned int));
|
|
|
@@ -38,6 +39,12 @@ struct Subproblem {
|
|
|
sizeof(unsigned int));
|
|
|
}
|
|
|
|
|
|
+ Subproblem(unsigned short id, const ZZ &b, const ZZ &t, const ZZ &m,
|
|
|
+ const ZZ &o, unsigned int dpf) : problemid(id), base(b),
|
|
|
+ target(t), modulus(m), order(o), dpfreq(dpf) {
|
|
|
+ updatedesc();
|
|
|
+ }
|
|
|
+
|
|
|
// Initilize the Subproblem from the binary description, *without*
|
|
|
// the leading 'P'
|
|
|
Subproblem(const unsigned char *descnoP) {
|