@@ -33,7 +33,7 @@ void Boinc::run() {
3333
3434 // log debugging info
3535 Log::get ().info (" Platform: " + Version::PLATFORM +
36- " , user name: " + user_name + " , hostid : " + hostid);
36+ " , user name: " + user_name + " , host ID : " + hostid);
3737
3838 // initialize setup
3939 Setup::setLodaHome (project_dir);
@@ -58,8 +58,36 @@ void Boinc::run() {
5858 }
5959#endif
6060
61- // pick a random miner profile if not mining in parallel
62- if (!settings.parallel_mining || settings.num_miner_instances == 1 ) {
61+ // read input data
62+ auto input_str = getFileAsString (slot_dir + " input" );
63+ if (!input_str.empty () && input_str[0 ] == ' {' ) {
64+ auto input = jute::parser::parse (input_str);
65+
66+ auto minSequenceTerms = input[" minSequenceTerms" ];
67+ if (minSequenceTerms.get_type () == jute::JNUMBER) {
68+ settings.num_terms = minSequenceTerms.as_int ();
69+ Log::get ().info (" Setting minimum sequence terms to " +
70+ std::to_string (settings.num_terms ));
71+ }
72+
73+ auto maxCycles = input[" maxCycles" ];
74+ if (maxCycles.get_type () == jute::JNUMBER) {
75+ settings.max_cycles = maxCycles.as_int ();
76+ Log::get ().info (" Setting maximum cycles to " +
77+ std::to_string (settings.max_cycles ));
78+ }
79+
80+ auto minerProfile = input[" minerProfile" ];
81+ if (minerProfile.get_type () == jute::JSTRING) {
82+ settings.miner_profile = minerProfile.as_string ();
83+ Log::get ().info (" Setting miner profile to \" " + settings.miner_profile +
84+ " \" " );
85+ }
86+ }
87+
88+ // pick a random miner profile if not set already
89+ if ((!settings.parallel_mining || settings.num_miner_instances == 1 ) &&
90+ settings.miner_profile .empty ()) {
6391 settings.miner_profile = std::to_string (Random::get ().gen () % 100 );
6492 }
6593
0 commit comments