@@ -313,30 +313,32 @@ std::unique_ptr<UnsignedObject> UnsignedObject::from_bytes(mutils::Deserializati
313313}
314314
315315/* *
316- * Command-line arguments: <one_field_size> <two_field_size> <unsigned_size> <num_updates>
316+ * Command-line arguments: <one_field_size> <two_field_size> <unsigned_size> <num_updates> <update_size>
317317 * one_field_size: Maximum size of the subgroup that replicates the one-field signed object
318318 * two_field_size: Maximum size of the subgroup that replicates the two-field signed object
319319 * mixed_field_size: Maximum size of the subgroup that replicates the mixed-signed-and-unsigned-field object
320320 * unsigned_size: Maximum size of the subgroup that replicates the persistent-but-not-signed object
321- * num_updates: Number of randomly-generated 32-byte updates to send to each subgroup
321+ * num_updates: Number of randomly-generated updates to send to each subgroup
322+ * update_size: Size of the updates, in bytes
322323 */
323324int main (int argc, char ** argv) {
324325 pthread_setname_np (pthread_self (), " test_main" );
325326 const std::string characters (" abcdefghijklmnopqrstuvwxyz" );
326327 std::mt19937 random_generator (getpid ());
327328 std::uniform_int_distribution<std::size_t > char_distribution (0 , characters.size () - 1 );
328- const int num_args = 5 ;
329+ const int num_args = 6 ;
329330 if (argc < (num_args + 1 ) || (argc > (num_args + 1 ) && strcmp (" --" , argv[argc - (num_args + 1 )]) != 0 )) {
330331 std::cout << " Invalid command line arguments." << std::endl;
331- std::cout << " Usage: " << argv[0 ] << " [derecho-config-options -- ] one_field_size two_field_size mixed_field_size unsigned_size num_updates" << std::endl;
332+ std::cout << " Usage: " << argv[0 ] << " [derecho-config-options -- ] one_field_size two_field_size mixed_field_size unsigned_size num_updates update_size " << std::endl;
332333 return -1 ;
333334 }
334335
335336 const unsigned int subgroup_1_size = std::stoi (argv[argc - num_args]);
336337 const unsigned int subgroup_2_size = std::stoi (argv[argc - num_args + 1 ]);
337338 const unsigned int subgroup_mixed_size = std::stoi (argv[argc - num_args + 2 ]);
338339 const unsigned int subgroup_unsigned_size = std::stoi (argv[argc - num_args + 3 ]);
339- const unsigned int num_updates = std::stoi (argv[argc - 1 ]);
340+ const unsigned int num_updates = std::stoi (argv[argc - num_args + 4 ]);
341+ const unsigned int update_size = std::stoi (argv[argc - 1 ]);
340342 derecho::Conf::initialize (argc, argv);
341343
342344 derecho::SubgroupInfo subgroup_info (
@@ -401,7 +403,7 @@ int main(int argc, char** argv) {
401403 test_state.my_subgroup_is_unsigned = false ;
402404 // Send random updates
403405 for (unsigned counter = 0 ; counter < num_updates; ++counter) {
404- std::string new_string (' a' , 32 );
406+ std::string new_string (' a' , update_size );
405407 std::generate (new_string.begin (), new_string.end (),
406408 [&]() { return characters[char_distribution (random_generator)]; });
407409 object_handle.ordered_send <RPC_NAME (update_state)>(new_string);
@@ -414,8 +416,8 @@ int main(int argc, char** argv) {
414416 test_state.my_subgroup_is_unsigned = false ;
415417 // Send random updates
416418 for (unsigned counter = 0 ; counter < num_updates; ++counter) {
417- std::string new_foo (' a' , 32 );
418- std::string new_bar (' a' , 32 );
419+ std::string new_foo (' a' , update_size );
420+ std::string new_bar (' a' , update_size );
419421 std::generate (new_foo.begin (), new_foo.end (),
420422 [&]() { return characters[char_distribution (random_generator)]; });
421423 std::generate (new_bar.begin (), new_bar.end (),
@@ -430,7 +432,7 @@ int main(int argc, char** argv) {
430432 test_state.my_subgroup_is_unsigned = false ;
431433 // Send random updates, alternating between the signed, unsigned, and nonpersistent fields
432434 for (unsigned counter = 0 ; counter < num_updates; ++counter) {
433- std::string new_string_value (' a' , 32 );
435+ std::string new_string_value (' a' , update_size );
434436 std::generate (new_string_value.begin (), new_string_value.end (),
435437 [&]() { return characters[char_distribution (random_generator)]; });
436438 if (counter % 3 == 0 ) {
@@ -449,7 +451,7 @@ int main(int argc, char** argv) {
449451 test_state.my_subgroup_is_unsigned = true ;
450452 // Send random updates
451453 for (unsigned counter = 0 ; counter < num_updates; ++counter) {
452- std::string new_string (' a' , 32 );
454+ std::string new_string (' a' , update_size );
453455 std::generate (new_string.begin (), new_string.end (),
454456 [&]() { return characters[char_distribution (random_generator)]; });
455457 object_handle.ordered_send <RPC_NAME (update_state)>(new_string);
0 commit comments