Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
javadsaberlatibari authored Apr 2, 2024
1 parent fa197ec commit df432b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
21 changes: 9 additions & 12 deletions wellcoordination/benchmark/rubis-benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

int main(int argc, char* argv[]) {
std::string loc =
"/home/prithviraj/Documents/Hamband/wellcoordination/workload/";
"/home/pyuvaraj/";

int nr_procs = static_cast<int>(std::atoi(argv[1]));
int num_ops = static_cast<int>(std::atoi(argv[2]));
Expand Down Expand Up @@ -94,11 +94,11 @@ int main(int argc, char* argv[]) {
int count = 0;
for (; count < expected_calls_per_update_method;) {
// storeBuyNow
// Sell items with id 0 - 99.
// Buy items with id 0 - 99. 0-5
std::string callStr;
if (type == 0) {
std::string i_id = std::to_string(std::rand() % 100);
std::string value = std::to_string(std::rand() % 1000);
std::string value = std::to_string(std::rand() % 5);
callStr = "1 " + i_id + "-" + value;
}
MethodCall call = ReplicatedObject::createCall("id", callStr);
Expand Down Expand Up @@ -136,8 +136,6 @@ int main(int argc, char* argv[]) {
for (int type = 0; type <= 1; type++) {
int count = 0;
for (; count < expected_calls_per_update_method;) {
// registerUser
// add users from 100 - 199.
std::string callStr;
if (type == 0) {
// placeBid
Expand All @@ -150,11 +148,11 @@ int main(int argc, char* argv[]) {
}
if (type == 1) {
//Close Auctions
std::string i_id = std::to_string(100 + std::rand() % 100); //auction id
std::string i_id = std::to_string(std::rand() % 100); //auction id
//std::string stock = std::to_string(1 + std::rand() % 1000); //stock

//open[i - 1].push_back(i_id);
callStr = "5 " + i_id
callStr = "5 " + i_id;
}
MethodCall call = ReplicatedObject::createCall("id", callStr);
if (test->isPermissible(call)) {
Expand All @@ -173,12 +171,11 @@ int main(int argc, char* argv[]) {
expected_nonconflicting_write_calls_per_follower; count++) {
std::string callStr;
if (type == 0) {
// sellitem
std::string s_id = std::to_string(100 + std::rand() % 100);
std::string value = std::to_string(std::rand() % 1000);
callStr = "0 " + s_id+ "-"+ value;
// sellitem
std::string s_id = std::to_string(100 + std::rand() % 100);
std::string value = std::to_string(std::rand() % 1000);
callStr = "0 " + s_id+ "-"+ value;
}

if (type == 1) {
//Open Auctions
// Open 100 - 199, with different stock values
Expand Down
3 changes: 2 additions & 1 deletion wellcoordination/benchmark/rubis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ class Rubis : public ReplicatedObject
synch_groups.push_back(g3);

for (int i = 0; i < 100; i++) {
directbuysell[i] = 1000;
directbuysell[i] = 1000;
openauctions.insert(i);
registeredusers.insert(i);
}
}
Expand Down

0 comments on commit df432b8

Please sign in to comment.