10 #ifndef WRENCH_FILETRANSFERTHREAD_H
11 #define WRENCH_FILETRANSFERTHREAD_H
14 #include "wrench/simgrid_S4U_util/S4U_Daemon.h"
15 #include "wrench/services/Service.h"
16 #include "wrench/services/storage/StorageService.h"
22 class SimulationTimestampFileCopyStart;
40 std::shared_ptr<StorageService> parent,
41 std::shared_ptr<DataFile>file,
42 double num_bytes_to_transfer,
43 simgrid::s4u::Mailbox *src_mailbox,
44 std::shared_ptr<FileLocation> dst_location,
45 simgrid::s4u::Mailbox *answer_mailbox_if_read,
46 simgrid::s4u::Mailbox *answer_mailbox_if_write,
47 simgrid::s4u::Mailbox *answer_mailbox_if_copy,
48 unsigned long buffer_size);
51 std::shared_ptr<StorageService> parent,
52 std::shared_ptr<DataFile>file,
53 double num_bytes_to_transfer,
54 std::shared_ptr<FileLocation> src_location,
55 simgrid::s4u::Mailbox *dst_mailbox,
56 simgrid::s4u::Mailbox *answer_mailbox_if_read,
57 simgrid::s4u::Mailbox *answer_mailbox_if_write,
58 simgrid::s4u::Mailbox *answer_mailbox_if_copy,
59 unsigned long buffer_size);
62 std::shared_ptr<StorageService> parent,
63 std::shared_ptr<DataFile>file,
64 double num_bytes_to_transfer,
65 std::shared_ptr<FileLocation> src_location,
66 std::shared_ptr<FileLocation> dsg_location,
67 simgrid::s4u::Mailbox *answer_mailbox_if_read,
68 simgrid::s4u::Mailbox *answer_mailbox_if_write,
69 simgrid::s4u::Mailbox *answer_mailbox_if_copy,
70 unsigned long buffer_size);
73 void cleanup(
bool has_returned_from_main,
int return_value)
override;
78 std::shared_ptr<StorageService> parent;
79 std::shared_ptr<DataFile>file;
82 simgrid::s4u::Mailbox *src_mailbox;
83 std::shared_ptr<FileLocation> src_location;
86 simgrid::s4u::Mailbox *dst_mailbox;
87 std::shared_ptr<FileLocation> dst_location;
89 double num_bytes_to_transfer;
91 simgrid::s4u::Mailbox *answer_mailbox_if_read;
92 simgrid::s4u::Mailbox *answer_mailbox_if_write;
93 simgrid::s4u::Mailbox *answer_mailbox_if_copy;
94 unsigned long buffer_size;
96 void receiveFileFromNetwork(std::shared_ptr<DataFile> file, simgrid::s4u::Mailbox *
mailbox, std::shared_ptr<FileLocation> location);
97 void sendLocalFileToNetwork(std::shared_ptr<DataFile> file, std::shared_ptr<FileLocation> location,
double num_bytes_to_transfer, simgrid::s4u::Mailbox *
mailbox);
98 void downloadFileFromStorageService(std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> src_location, std::shared_ptr<FileLocation> dst_location);
99 void copyFileLocally(std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> src_location, std::shared_ptr<FileLocation> dst_location);
108 #endif //WRENCH_FILETRANSFERTHREAD_H