TornadoVM
TornadoVM copied to clipboard
Inconsistent naming of tasks in GridScheduler
Checking of the presence of WorkerGrid in GridScheduler is implemented inconsistently:
- In uk.ac.manchester.tornado.runtime.tasks.TornadoTaskGraph#isTaskNamePresent check name of the task is concatinated with the name of the task graph, and then it is compared with a key stored in GridScheduler.
private boolean isTaskNamePresent(String taskName) {
for (TaskPackage taskPackage : taskPackages) {
if (taskName.equals(STR."\{taskGraphName}.\{taskPackage.getId()}")) {
return true;
}
}
return false;
}
So, it is forcing the user to prepend the name of the task graph with the name of the task during the addition of WorkerGrid to the GridScheduler.
2. In method uk.ac.manchester.tornado.api.GridScheduler#contains the name of the task graph is added by GridScheduler itself, so if the user follows that first approach, this method always returns false.
From my point of view, the first case is implemented incorrectly because, at the current stage, there is no validation of the correctness of the fact that the user provided the correct name to the GridScheduler, and there is no clear demand to do that in the GridScheduler contract.
So IMHO, both cases should be implemented over the call to GridScheduler#contains, and usage of the same scheduler for two task graphs at once should be prohibited (which is quite simple to implement).