#include <src/plugins/file_system/FileSystem.hpp>
#include <string>
#define INMEGA (1024 * 1024)
{
simgrid::s4u::File
file(argv[1],
nullptr);
const char* filename =
file.getPath();
XBT_INFO(
"Try to read %llu from '%s'",
file.size(), filename);
XBT_INFO(
"Have read %llu from '%s'. Offset is now at: %llu", read, filename,
file.tell());
XBT_INFO(
"Seek back to the beginning of the stream...");
if (argc > 5) {
simgrid::s4u::File remoteFile(argv[2], nullptr);
filename = remoteFile.getPath();
XBT_INFO(
"Try to write %llu MiB to '%s'", remoteFile.size() / 1024, filename);
sg_size_t write = remoteFile.write(remoteFile.size() * 1024);
XBT_INFO(
"Have written %llu bytes to '%s'.", write, filename);
if (std::stoi(argv[5]) != 0) {
XBT_INFO(
"Move '%s' (of size %llu) from '%s' to '%s'", filename, remoteFile.size(),
} else {
XBT_INFO(
"Copy '%s' (of size %llu) from '%s' to '%s'", filename, remoteFile.size(),
}
}
return 0;
}
int main(
int argc,
char** argv)
{
e.loadPlatform(argv[1]);
e.registerFunction("host", host);
e.loadDeployment(argv[2]);
std::map<std::string, simgrid::s4u::Storage*> allStorages;
for (auto const& s : allStorages) {
}
e.run();
for (auto const& s : allStorages) {
}
return 0;
}