- /* performer is the computer which execute the task */
- performer = ((!char_performer || !strcmp(char_performer,"")) ? -1:atoi(char_performer));
- /* order is giving the task order on one computer */
- order = ((!char_order || !strcmp(char_order, ""))? -1:atoi(char_order));
-
- XBT_DEBUG ("Task '%s' is scheduled on workstation '%d' in position '%d'", task->name, performer, order);
- xbt_dynar_t computer = NULL;
- if(performer != -1 && order != -1){
- /* required parameters are given */
- computer = (xbt_dynar_t)xbt_dict_get_or_null(computers, char_performer);
- if(computer == NULL){
- computer = xbt_dynar_new(sizeof(SD_task_t), NULL);
- xbt_dict_set(computers, char_performer, computer, NULL);
+ /* Tasks will execute on in a given "order" on a given set of "performer" hosts */
+ int performer = ((not char_performer || not strcmp(char_performer, "")) ? -1 : atoi(char_performer));
+ int order = ((not char_order || not strcmp(char_order, "")) ? -1 : atoi(char_order));
+
+ if ((performer != -1 && order != -1) && performer < static_cast<int>(sg_host_count())) {
+ /* required parameters are given and less performers than hosts are required */
+ XBT_DEBUG ("Task '%s' is scheduled on workstation '%d' in position '%d'", task->name, performer, order);
+ auto comp = computers.find(char_performer);
+ if (comp != computers.end()) {
+ computer = comp->second;
+ } else {
+ computer = new std::vector<SD_task_t>;
+ computers.insert({char_performer, computer});