* First version of new replayer, with comments on future TODOs

* plus minor fixes for UT

* Updated format of recorder, especially in binary department, according to replayer's need
Этот коммит содержится в:
Tim
2025-06-13 15:05:34 -04:00
коммит произвёл GitHub
родитель 4486d091b8
Коммит ba97c9c18b
8 изменённых файлов: 768 добавлений и 1129 удалений
+6 -4
Просмотреть файл
@@ -40,16 +40,18 @@ namespace RcclUnitTesting
std::vector<rccl::rcclApiCall> calls;
char entry[4096];
gethostname(entry, 256);
//parse the outfile
std::string filename = "test" + std::to_string(pid) + ".json";
std::ifstream fp("/tmp/test" + std::to_string(pid) + ".json");
std::string filename = "/tmp/test." + std::to_string(pid) + "." + std::string(entry) + ".json";
std::ifstream fp(filename);
fp.getline(entry, 4096);
fp.getline(entry, 4096);
fp.getline(entry, 4096);
parseJsonEntry(entry, calls);
int result = memcmp((char*)&calls[0]+4, (char*)&call+4, sizeof(rccl::rcclApiCall)-4);
// compare only the fields after the pid field
int result = memcmp(&(calls[0].pid)+1, &(call.pid)+1, sizeof(rccl::rcclApiCall)-sizeof(call.pid));
fp.close(); // care that recorder is not designed to anticipate fp closing before destructor
remove(filename.c_str());
//remove(filename.c_str()); TODO: after implement fp closing mechanism via envvar, remove file after test case
unsetenv("RCCL_REPLAY_FILE");
assert(!result);
}