10 #ifndef WRENCH_SIMULATIONTIMESTAMPTYPES_H
11 #define WRENCH_SIMULATIONTIMESTAMPTYPES_H
14 #include "wrench/data_file//DataFile.h"
15 #include "wrench/workflow/WorkflowTask.h"
16 #include <unordered_map>
23 typedef std::tuple<std::shared_ptr<wrench::DataFile>, std::shared_ptr<wrench::FileLocation>, std::shared_ptr<wrench::StorageService>> FileReadWrite;
24 typedef std::tuple<std::shared_ptr<wrench::DataFile>, std::shared_ptr<wrench::FileLocation>, std::shared_ptr<wrench::FileLocation>> FileCopy;
32 typedef std::tuple<std::string, std::string, int> DiskAccess;
36 struct hash<FileCopy>{
38 size_t operator()(
const FileCopy &file )
const
40 return std::hash<void *>()(std::get<0>(file).get()) ^ std::hash<void *>()(std::get<1>(file).get()) ^ std::hash<void *>()(std::get<2>(file).get());
46 struct hash<FileReadWrite>{
48 size_t operator()(
const FileReadWrite &file )
const
50 return std::hash<void *>()(std::get<0>(file).get()) ^ std::hash<void *>()(std::get<1>(file).get()) ^ std::hash<void *>()(std::get<2>(file).get());
56 struct hash<DiskAccess>{
58 size_t operator()(
const DiskAccess &diskAccess )
const
60 return std::hash<std::string>()(std::get<0>(diskAccess)) ^ std::hash<std::string>()(std::get<1>(diskAccess)) ^ std::hash<int>()(std::get<2>(diskAccess));
104 void setDate(
double date);
135 std::shared_ptr<WorkflowTask>getTask();
145 std::shared_ptr<WorkflowTask>task;
197 std::shared_ptr<DataFile>getFile();
198 std::shared_ptr<FileLocation> getSource();
199 std::shared_ptr<StorageService> getService();
200 std::shared_ptr<WorkflowTask>getTask();
221 std::shared_ptr<WorkflowTask>
task;
226 static std::unordered_multimap<FileReadWrite, std::pair<SimulationTimestampFileRead *, std::shared_ptr<WorkflowTask>>> pending_file_reads;
231 SimulationTimestampFileRead(
double date, std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> src, std::shared_ptr<StorageService> service, std::shared_ptr<WorkflowTask>task =
nullptr);
243 SimulationTimestampFileReadStart(
double date, std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> src, std::shared_ptr<StorageService> service, std::shared_ptr<WorkflowTask>task =
nullptr);
255 SimulationTimestampFileReadFailure(
double date, std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> src, std::shared_ptr<StorageService> service, std::shared_ptr<WorkflowTask>task =
nullptr);
264 SimulationTimestampFileReadCompletion(
double date, std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> src, std::shared_ptr<StorageService> service, std::shared_ptr<WorkflowTask>task =
nullptr);
280 std::shared_ptr<DataFile>getFile();
281 std::shared_ptr<FileLocation> getDestination();
282 std::shared_ptr<StorageService> getService();
283 std::shared_ptr<WorkflowTask>getTask();
289 std::shared_ptr<DataFile>
file;
304 std::shared_ptr<WorkflowTask>
task;
309 static std::unordered_multimap<FileReadWrite, std::pair<SimulationTimestampFileWrite *, std::shared_ptr<WorkflowTask>>> pending_file_writes;
315 SimulationTimestampFileWrite(
double date, std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> dst, std::shared_ptr<StorageService> service, std::shared_ptr<WorkflowTask>task =
nullptr);
329 SimulationTimestampFileWriteStart(
double date, std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> dst, std::shared_ptr<StorageService> service, std::shared_ptr<WorkflowTask>task =
nullptr);
338 SimulationTimestampFileWriteFailure(
double date, std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> dst, std::shared_ptr<StorageService> service, std::shared_ptr<WorkflowTask>task =
nullptr);
347 SimulationTimestampFileWriteCompletion(
double date, std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> dst, std::shared_ptr<StorageService> service, std::shared_ptr<WorkflowTask>task =
nullptr);
363 std::shared_ptr<DataFile>getFile();
364 std::shared_ptr<FileLocation> getSource();
365 std::shared_ptr<FileLocation> getDestination();
368 SimulationTimestampFileCopy(
double date, std::shared_ptr<DataFile> file, std::shared_ptr<FileLocation> src, std::shared_ptr<FileLocation> dst);
373 std::shared_ptr<DataFile>
file;
439 std::string getHostname();
440 std::string getMount();
522 std::string getHostname();
523 std::string getMount();
596 std::string getHostname();
602 std::string hostname;
611 std::string getHostname();
612 double getConsumption();
617 std::string hostname;
626 std::string getLinkname();
632 std::string linkname;
633 double bytes_per_second;
637 #endif //WRENCH_SIMULATIONTIMESTAMPTYPES_H
A base class for simulation timestamps regarding disk reads.
Definition: SimulationTimestampTypes.h:431
A simulation timestamp class for file read failure times.
Definition: SimulationTimestampTypes.h:252
static std::unordered_multimap< FileCopy, SimulationTimestampFileCopy * > pending_file_copies
the data structure that holds the ongoing file writes.
Definition: SimulationTimestampTypes.h:388
int counter
counter to differentiate reads
Definition: SimulationTimestampTypes.h:462
A simulation timestamp class for file read start times.
Definition: SimulationTimestampTypes.h:240
A simulation timestamp class for file read completions.
Definition: SimulationTimestampTypes.h:261
std::shared_ptr< StorageService > service
Service that initiated the read.
Definition: SimulationTimestampTypes.h:216
A base class for simulation timestamps.
Definition: SimulationTimestampTypes.h:110
A simulation timestamp class for disk read completions.
Definition: SimulationTimestampTypes.h:502
A simulation timestamp class for WorkflowTask termination times.
Definition: SimulationTimestampTypes.h:178
A simulation timestamp class for WorkflowTask start times.
Definition: SimulationTimestampTypes.h:151
static std::unordered_multimap< DiskAccess, SimulationTimestampDiskWrite * > pending_disk_writes
the data structure that holds the ongoing disk writes.
Definition: SimulationTimestampTypes.h:551
A simulation timestamp class for file write completions.
Definition: SimulationTimestampTypes.h:344
std::shared_ptr< FileLocation > destination
The location where the DataFile was being write from.
Definition: SimulationTimestampTypes.h:294
A simulation timestamp class for file copy completions.
Definition: SimulationTimestampTypes.h:419
A simulation timestamp class for disk write start times.
Definition: SimulationTimestampTypes.h:564
std::shared_ptr< FileLocation > source
The location where the DataFile was being read from.
Definition: SimulationTimestampTypes.h:211
static std::map< std::string, SimulationTimestampTask * > pending_task_timestamps
A static map of SimulationTimestampTaskStart objects that have yet to matched with SimulationTimestam...
Definition: SimulationTimestampTypes.h:139
A base class for simulation timestamps regarding file reads.
Definition: SimulationTimestampTypes.h:190
A simulation timestamp class for disk read failure times.
Definition: SimulationTimestampTypes.h:493
std::shared_ptr< StorageService > service
Service that initiated the write.
Definition: SimulationTimestampTypes.h:299
std::shared_ptr< DataFile > file
The DataFile that was being copied.
Definition: SimulationTimestampTypes.h:373
int counter
counter to differentiate writes
Definition: SimulationTimestampTypes.h:546
A base class for simulation timestamps regarding file copies.
Definition: SimulationTimestampTypes.h:356
std::string mount
mount point of disk being written to
Definition: SimulationTimestampTypes.h:536
A simulation timestamp class for file copy failure times.
Definition: SimulationTimestampTypes.h:410
Definition: Action.cpp:28
A simulation timestamp class for file copy start times.
Definition: SimulationTimestampTypes.h:399
File, Source, Whoami used to be hashed as key for unordered multimap for ongoing file operations.
Definition: SimulationTimestampTypes.h:91
A base class for simulation timestamps regarding workflow tasks.
Definition: SimulationTimestampTypes.h:132
A simulation timestamp class for link usage.
Definition: SimulationTimestampTypes.h:624
A simulation timestamp class for disk write completions.
Definition: SimulationTimestampTypes.h:585
std::shared_ptr< WorkflowTask > task
Task associated with write.
Definition: SimulationTimestampTypes.h:304
A simulation timestamp class for file write failure times.
Definition: SimulationTimestampTypes.h:335
double bytes
amount of bytes being written
Definition: SimulationTimestampTypes.h:541
std::string mount
mount point of disk being read from
Definition: SimulationTimestampTypes.h:452
static std::unordered_multimap< DiskAccess, SimulationTimestampDiskRead * > pending_disk_reads
the data structure that holds the ongoing disk reads.
Definition: SimulationTimestampTypes.h:468
std::string hostname
hostname of disk being read from
Definition: SimulationTimestampTypes.h:447
A simulation timestamp class for disk write failure times.
Definition: SimulationTimestampTypes.h:576
A class that encodes a file location.
Definition: FileLocation.h:29
A simulation timestamp class for WorkflowTask completion times.
Definition: SimulationTimestampTypes.h:169
double bytes
amount of bytes being read
Definition: SimulationTimestampTypes.h:457
std::shared_ptr< DataFile > file
The DataFile that was being write.
Definition: SimulationTimestampTypes.h:289
std::shared_ptr< FileLocation > source
The location where the DataFile was being copied from.
Definition: SimulationTimestampTypes.h:378
std::shared_ptr< DataFile > file
The DataFile that was being read.
Definition: SimulationTimestampTypes.h:206
A simulation timestamp class for disk read start times.
Definition: SimulationTimestampTypes.h:481
std::shared_ptr< WorkflowTask > task
Task tied to read.
Definition: SimulationTimestampTypes.h:221
A base class for simulation timestamps regarding file writes.
Definition: SimulationTimestampTypes.h:273
A base class for simulation timestamps regarding disk writes.
Definition: SimulationTimestampTypes.h:514
A simulation timestamp class for file write start times.
Definition: SimulationTimestampTypes.h:324
std::string hostname
hostname of disk being written to
Definition: SimulationTimestampTypes.h:531
std::shared_ptr< FileLocation > destination
The location where the DataFile was being copied to.
Definition: SimulationTimestampTypes.h:383
A class that contains post-mortem simulation-generated data.
Definition: SimulationOutput.h:27
A simulation timestamp class for WorkflowTask failure times.
Definition: SimulationTimestampTypes.h:160
A simulation timestamp class for changes in a host's pstate.
Definition: SimulationTimestampTypes.h:594
A simulation timestamp class for energy consumption.
Definition: SimulationTimestampTypes.h:609