summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f2e2845)
Old gcc versions do not allow adding std::string fields to plain old
structures. We could fix the commit, but our time is sparse these days.
This reverts commit
23141ea49d9f51ecda69abe8cd02736b92254726.
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_daxparse, sd, "Parsing DAX files");
extern "C" {
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_daxparse, sd, "Parsing DAX files");
extern "C" {
-#undef CLEANUP
-#include "dax_dtd.h"
-#define register /* g++ don't like register, so don't say it */
-#include "dax_dtd.c"
-#undef register
+ #undef CLEANUP
+ #include "dax_dtd.h"
+ #define register /* g++ don't like register, so don't say it */
+ #include "dax_dtd.c"
+ #undef register
+}
+
+/* Ensure that transfer tasks have unique names even though a file is used several times */
+
+void uniq_transfer_task_name(SD_task_t task)
+{
+ SD_task_t child = *(task->successors->begin());
+ SD_task_t parent = *(task->predecessors->begin());
+
+ char *new_name = bprintf("%s_%s_%s", SD_task_get_name(parent), SD_task_get_name(task), SD_task_get_name(child));
+
+ SD_task_set_name(task, new_name);
+
+ free(new_name);
}
static bool children_are_marked(SD_task_t task){
}
static bool children_are_marked(SD_task_t task){
//test if all tasks are marked
xbt_dynar_foreach(dag,count,task){
if(task->kind != SD_TASK_COMM_E2E && task->marked == 0){
//test if all tasks are marked
xbt_dynar_foreach(dag,count,task){
if(task->kind != SD_TASK_COMM_E2E && task->marked == 0){
- XBT_WARN("the task %s is not marked",task->name.c_str());
+ XBT_WARN("the task %s is not marked",task->name);
all_marked = false;
break;
}
all_marked = false;
break;
}
all_marked = true;
xbt_dynar_foreach(dag,count,task){
if(task->kind != SD_TASK_COMM_E2E && task->marked == 0){
all_marked = true;
xbt_dynar_foreach(dag,count,task){
if(task->kind != SD_TASK_COMM_E2E && task->marked == 0){
- XBT_WARN("the task %s is in a cycle",task->name.c_str());
+ XBT_WARN("the task %s is in a cycle",task->name);
static YY_BUFFER_STATE input_buffer;
static xbt_dynar_t result;
static YY_BUFFER_STATE input_buffer;
static xbt_dynar_t result;
-static xbt_dict_t files;
+static xbt_dict_t files;
static SD_task_t current_job;
static SD_task_t current_job;
+static SD_task_t root_task;
+static SD_task_t end_task;
static void dax_task_free(void *task)
{
static void dax_task_free(void *task)
{
result = xbt_dynar_new(sizeof(SD_task_t), dax_task_free);
files = xbt_dict_new_homogeneous(&dax_task_free);
jobs = xbt_dict_new_homogeneous(nullptr);
result = xbt_dynar_new(sizeof(SD_task_t), dax_task_free);
files = xbt_dict_new_homogeneous(&dax_task_free);
jobs = xbt_dict_new_homogeneous(nullptr);
- SD_task_t root_task = SD_task_create_comp_seq("root", nullptr, 0);
+ root_task = SD_task_create_comp_seq("root", nullptr, 0);
/* by design the root task is always SCHEDULABLE */
SD_task_set_state(root_task, SD_SCHEDULABLE);
xbt_dynar_push(result, &root_task);
/* by design the root task is always SCHEDULABLE */
SD_task_set_state(root_task, SD_SCHEDULABLE);
xbt_dynar_push(result, &root_task);
- SD_task_t end_task = SD_task_create_comp_seq("end", nullptr, 0);
+ end_task = SD_task_create_comp_seq("end", nullptr, 0);
int res = dax_lex();
if (res != 0)
int res = dax_lex();
if (res != 0)
SD_task_t newfile;
if (file->predecessors->empty()) {
for (SD_task_t it : *file->successors) {
SD_task_t newfile;
if (file->predecessors->empty()) {
for (SD_task_t it : *file->successors) {
- newfile = SD_task_create_comm_e2e(file->name.c_str(), nullptr, file->amount);
+ newfile = SD_task_create_comm_e2e(file->name, nullptr, file->amount);
SD_task_dependency_add(nullptr, nullptr, root_task, newfile);
SD_task_dependency_add(nullptr, nullptr, newfile, it);
xbt_dynar_push(result, &newfile);
}
} else if (file->successors->empty()) {
for (SD_task_t it : *file->predecessors){
SD_task_dependency_add(nullptr, nullptr, root_task, newfile);
SD_task_dependency_add(nullptr, nullptr, newfile, it);
xbt_dynar_push(result, &newfile);
}
} else if (file->successors->empty()) {
for (SD_task_t it : *file->predecessors){
- newfile = SD_task_create_comm_e2e(file->name.c_str(), nullptr, file->amount);
+ newfile = SD_task_create_comm_e2e(file->name, nullptr, file->amount);
SD_task_dependency_add(nullptr, nullptr, it, newfile);
SD_task_dependency_add(nullptr, nullptr, newfile, end_task);
xbt_dynar_push(result, &newfile);
SD_task_dependency_add(nullptr, nullptr, it, newfile);
SD_task_dependency_add(nullptr, nullptr, newfile, end_task);
xbt_dynar_push(result, &newfile);
for (SD_task_t it2 : *file->successors) {
if (it == it2) {
XBT_WARN ("File %s is produced and consumed by task %s."
for (SD_task_t it2 : *file->successors) {
if (it == it2) {
XBT_WARN ("File %s is produced and consumed by task %s."
- "This loop dependency will prevent the execution of the task.",
- file->name.c_str(), it->name.c_str());
+ "This loop dependency will prevent the execution of the task.", file->name, it->name);
- newfile = SD_task_create_comm_e2e(file->name.c_str(), nullptr, file->amount);
+ newfile = SD_task_create_comm_e2e(file->name, nullptr, file->amount);
SD_task_dependency_add(nullptr, nullptr, it, newfile);
SD_task_dependency_add(nullptr, nullptr, newfile, it2);
xbt_dynar_push(result, &newfile);
SD_task_dependency_add(nullptr, nullptr, it, newfile);
SD_task_dependency_add(nullptr, nullptr, newfile, it2);
xbt_dynar_push(result, &newfile);
unsigned int cpt;
xbt_dynar_foreach(result, cpt, file) {
if (SD_task_get_kind(file) == SD_TASK_COMM_E2E) {
unsigned int cpt;
xbt_dynar_foreach(result, cpt, file) {
if (SD_task_get_kind(file) == SD_TASK_COMM_E2E) {
- /* Ensure that transfer tasks have unique names even though a file is used several times */
- file->name = std::string((*file->predecessors->begin())->name+ "_" + file->name + "_" +
- (*file->successors->begin())->name);
+ uniq_transfer_task_name(file);
} else if (SD_task_get_kind(file) == SD_TASK_COMP_SEQ){
/* If some tasks do not take files as input, connect them to the root
* if they don't produce files, connect them to the end node.
} else if (SD_task_get_kind(file) == SD_TASK_COMP_SEQ){
/* If some tasks do not take files as input, connect them to the root
* if they don't produce files, connect them to the end node.
- double version = xbt_str_parse_double(A_dax__adag_version, "Parse error: %s is not a double");
+ XBT_ATTRIB_UNUSED double version;
+ version = xbt_str_parse_double(A_dax__adag_version, "Parse error: %s is not a double");
xbt_assert(version == 2.1, "Expected version 2.1 in <adag> tag, got %f. Fix the parser or your file", version);
}
xbt_assert(version == 2.1, "Expected version 2.1 in <adag> tag, got %f. Fix the parser or your file", version);
}
void STag_dax__job()
{
double runtime = xbt_str_parse_double(A_dax__job_runtime, "Parse error: %s is not a double");
void STag_dax__job()
{
double runtime = xbt_str_parse_double(A_dax__job_runtime, "Parse error: %s is not a double");
- std::string name = std::string(A_dax__job_id) +"@"+ std::string(A_dax__job_name);
+ char *name = bprintf("%s@%s", A_dax__job_id, A_dax__job_name);
runtime *= 4200000000.; /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */
XBT_DEBUG("See <job id=%s runtime=%s %.0f>",A_dax__job_id,A_dax__job_runtime,runtime);
runtime *= 4200000000.; /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */
XBT_DEBUG("See <job id=%s runtime=%s %.0f>",A_dax__job_id,A_dax__job_runtime,runtime);
- current_job = SD_task_create_comp_seq(name.c_str(), nullptr, runtime);
+ current_job = SD_task_create_comp_seq(name, nullptr, runtime);
xbt_dict_set(jobs, A_dax__job_id, current_job, nullptr);
xbt_dict_set(jobs, A_dax__job_id, current_job, nullptr);
xbt_dynar_push(result, ¤t_job);
}
xbt_dynar_push(result, ¤t_job);
}
} else {
SD_task_dependency_add(nullptr, nullptr, current_job, file);
if ((file->predecessors->size() + file->inputs->size()) > 1) {
} else {
SD_task_dependency_add(nullptr, nullptr, current_job, file);
if ((file->predecessors->size() + file->inputs->size()) > 1) {
- XBT_WARN("File %s created at more than one location...", file->name.c_str());
+ XBT_WARN("File %s created at more than one location...", file->name);
{
SD_task_t parent = static_cast<SD_task_t>(xbt_dict_get_or_null(jobs, A_dax__parent_ref));
xbt_assert(parent != nullptr, "Parse error on line %d: Asked to add a dependency from %s to %s, but %s does not exist",
{
SD_task_t parent = static_cast<SD_task_t>(xbt_dict_get_or_null(jobs, A_dax__parent_ref));
xbt_assert(parent != nullptr, "Parse error on line %d: Asked to add a dependency from %s to %s, but %s does not exist",
- dax_lineno, current_child->name.c_str(), A_dax__parent_ref, A_dax__parent_ref);
+ dax_lineno, current_child->name, A_dax__parent_ref, A_dax__parent_ref);
SD_task_dependency_add(nullptr, nullptr, parent, current_child);
SD_task_dependency_add(nullptr, nullptr, parent, current_child);
- XBT_DEBUG("Control-flow dependency from %s to %s", current_child->name.c_str(), parent->name.c_str());
+ XBT_DEBUG("Control-flow dependency from %s to %s", current_child->name, parent->name);
if((performer != -1 && order != -1) && performer < (int) sg_host_count()){
/* required parameters are given and less performers than hosts are required */
if((performer != -1 && order != -1) && performer < (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.c_str(), performer, order);
+ XBT_DEBUG ("Task '%s' is scheduled on workstation '%d' in position '%d'", task->name, performer, order);
computer = static_cast<xbt_dynar_t> (xbt_dict_get_or_null(computers, char_performer));
if(computer == nullptr){
computer = xbt_dynar_new(sizeof(SD_task_t), nullptr);
computer = static_cast<xbt_dynar_t> (xbt_dict_get_or_null(computers, char_performer));
if(computer == nullptr){
computer = xbt_dynar_new(sizeof(SD_task_t), nullptr);
/* the user gave the same order to several tasks */
schedule_success = false;
XBT_VERB("Task '%s' wants to start on performer '%s' at the same position '%s' as task '%s'",
/* the user gave the same order to several tasks */
schedule_success = false;
XBT_VERB("Task '%s' wants to start on performer '%s' at the same position '%s' as task '%s'",
- (*task_test)->name.c_str(), char_performer, char_order, task->name.c_str());
+ (*task_test)->name, char_performer, char_order, task->name);
} else {
/* one of required parameters is not given */
schedule_success = false;
} else {
/* one of required parameters is not given */
schedule_success = false;
- XBT_VERB("The schedule is ignored, task '%s' can not be scheduled on %d hosts", task->name.c_str(), performer);
+ XBT_VERB("The schedule is ignored, task '%s' can not be scheduled on %d hosts", task->name, performer);
}
xbt_dynar_free(&edges);
}
xbt_dynar_free(&edges);
- XBT_DEBUG("All tasks have been created, put %s at the end of the dynar", end->name.c_str());
+ XBT_DEBUG("All tasks have been created, put %s at the end of the dynar", end->name);
xbt_dynar_push(result, &end);
/* Connect entry tasks to 'root', and exit tasks to 'end'*/
xbt_dynar_foreach (result, i, task){
if (task->predecessors->empty() && task->inputs->empty() && task != root) {
xbt_dynar_push(result, &end);
/* Connect entry tasks to 'root', and exit tasks to 'end'*/
xbt_dynar_foreach (result, i, task){
if (task->predecessors->empty() && task->inputs->empty() && task != root) {
- XBT_DEBUG("Task '%s' has no source. Add dependency from 'root'", task->name.c_str());
+ XBT_DEBUG("Task '%s' has no source. Add dependency from 'root'", task->name);
SD_task_dependency_add(nullptr, nullptr, root, task);
}
if (task->successors->empty() && task->outputs->empty() && task != end) {
SD_task_dependency_add(nullptr, nullptr, root, task);
}
if (task->successors->empty() && task->outputs->empty() && task != end) {
- XBT_DEBUG("Task '%s' has no destination. Add dependency to 'end'", task->name.c_str());
+ XBT_DEBUG("Task '%s' has no destination. Add dependency to 'end'", task->name);
SD_task_dependency_add(nullptr, nullptr, task, end);
}
}
SD_task_dependency_add(nullptr, nullptr, task, end);
}
}
task->successors = new std::set<SD_task_t>();
task->data = data;
task->successors = new std::set<SD_task_t>();
task->data = data;
- task->name = std::string(name);
+ task->name = xbt_strdup(name);
task->amount = amount;
task->allocation = new std::vector<sg_host_t>();
task->rate = -1;
task->amount = amount;
task->allocation = new std::vector<sg_host_t>();
task->rate = -1;
if (task->state == SD_SCHEDULED || task->state == SD_RUNNABLE)
__SD_task_destroy_scheduling_data(task);
if (task->state == SD_SCHEDULED || task->state == SD_RUNNABLE)
__SD_task_destroy_scheduling_data(task);
+ xbt_free(task->name);
+
if (task->surf_action != nullptr)
task->surf_action->unref();
if (task->surf_action != nullptr)
task->surf_action->unref();
void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state)
{
std::set<SD_task_t>::iterator idx;
void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state)
{
std::set<SD_task_t>::iterator idx;
- XBT_DEBUG("Set state of '%s' to %d", task->name.c_str(), new_state);
+ XBT_DEBUG("Set state of '%s' to %d", task->name, new_state);
if ((new_state == SD_NOT_SCHEDULED || new_state == SD_SCHEDULABLE) && task->state == SD_FAILED){
sd_global->completed_tasks->erase(task);
sd_global->initial_tasks->insert(task);
if ((new_state == SD_NOT_SCHEDULED || new_state == SD_SCHEDULABLE) && task->state == SD_FAILED){
sd_global->completed_tasks->erase(task);
sd_global->initial_tasks->insert(task);
task->state = new_state;
if (task->watch_points & new_state) {
task->state = new_state;
if (task->watch_points & new_state) {
- XBT_VERB("Watch point reached with task '%s'!", task->name.c_str());
+ XBT_VERB("Watch point reached with task '%s'!", task->name);
sd_global->watch_point_reached = true;
SD_task_unwatch(task, new_state); /* remove the watch point */
}
sd_global->watch_point_reached = true;
SD_task_unwatch(task, new_state); /* remove the watch point */
}
*/
const char *SD_task_get_name(SD_task_t task)
{
*/
const char *SD_task_get_name(SD_task_t task)
{
- return task->name.c_str();
}
/** @brief Allows to change the name of a task */
void SD_task_set_name(SD_task_t task, const char *name)
{
}
/** @brief Allows to change the name of a task */
void SD_task_set_name(SD_task_t task, const char *name)
{
- task->name = std::string(name);
+ xbt_free(task->name);
+ task->name = xbt_strdup(name);
}
/** @brief Returns the dynar of the parents of a task
}
/** @brief Returns the dynar of the parents of a task
if ((task->inputs->size()+ task->predecessors->size()) > 0) {
XBT_INFO(" - pre-dependencies:");
for (auto it : *task->predecessors)
if ((task->inputs->size()+ task->predecessors->size()) > 0) {
XBT_INFO(" - pre-dependencies:");
for (auto it : *task->predecessors)
- XBT_INFO(" %s", it->name.c_str());
+ XBT_INFO(" %s", it->name);
for (auto it: *task->inputs)
for (auto it: *task->inputs)
- XBT_INFO(" %s", it->name.c_str());
+ XBT_INFO(" %s", it->name);
}
if ((task->outputs->size() + task->successors->size()) > 0) {
XBT_INFO(" - post-dependencies:");
for (auto it : *task->successors)
}
if ((task->outputs->size() + task->successors->size()) > 0) {
XBT_INFO(" - post-dependencies:");
for (auto it : *task->successors)
- XBT_INFO(" %s", it->name.c_str());
+ XBT_INFO(" %s", it->name);
for (auto it : *task->outputs)
for (auto it : *task->outputs)
- XBT_INFO(" %s", it->name.c_str());
+ XBT_INFO(" %s", it->name);
void SD_task_dotty(SD_task_t task, void *out)
{
FILE *fout = static_cast<FILE*>(out);
void SD_task_dotty(SD_task_t task, void *out)
{
FILE *fout = static_cast<FILE*>(out);
- fprintf(fout, " T%p [label=\"%.20s\"", task, task->name.c_str());
+ fprintf(fout, " T%p [label=\"%.20s\"", task, task->name);
switch (task->kind) {
case SD_TASK_COMM_E2E:
case SD_TASK_COMM_PAR_MXN_1D_BLOCK:
switch (task->kind) {
case SD_TASK_COMM_E2E:
case SD_TASK_COMM_PAR_MXN_1D_BLOCK:
if (src->state == SD_DONE || src->state == SD_FAILED)
THROWF(arg_error, 0, "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED, SD_RUNNABLE, or SD_RUNNING",
if (src->state == SD_DONE || src->state == SD_FAILED)
THROWF(arg_error, 0, "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED, SD_RUNNABLE, or SD_RUNNING",
if (dst->state == SD_DONE || dst->state == SD_FAILED || dst->state == SD_RUNNING)
THROWF(arg_error, 0, "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED, or SD_RUNNABLE",
if (dst->state == SD_DONE || dst->state == SD_FAILED || dst->state == SD_RUNNING)
THROWF(arg_error, 0, "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED, or SD_RUNNABLE",
if (dst->inputs->find(src) != dst->inputs->end() || src->outputs->find(dst) != src->outputs->end() ||
src->successors->find(dst) != src->successors->end() || dst->predecessors->find(src) != dst->predecessors->end())
if (dst->inputs->find(src) != dst->inputs->end() || src->outputs->find(dst) != src->outputs->end() ||
src->successors->find(dst) != src->successors->end() || dst->predecessors->find(src) != dst->predecessors->end())
- THROWF(arg_error, 0, "A dependency already exists between task '%s' and task '%s'", src->name.c_str(), dst->name.c_str());
+ THROWF(arg_error, 0, "A dependency already exists between task '%s' and task '%s'", src->name, dst->name);
- XBT_DEBUG("SD_task_dependency_add: src = %s, dst = %s", src->name.c_str(), dst->name.c_str());
+ XBT_DEBUG("SD_task_dependency_add: src = %s, dst = %s", src->name, dst->name);
if (src->kind == SD_TASK_COMM_E2E || src->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK){
if (dst->kind == SD_TASK_COMP_SEQ || dst->kind == SD_TASK_COMP_PAR_AMDAHL)
if (src->kind == SD_TASK_COMM_E2E || src->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK){
if (dst->kind == SD_TASK_COMP_SEQ || dst->kind == SD_TASK_COMP_PAR_AMDAHL)
/* if the task was runnable, the task goes back to SD_SCHEDULED because of the new dependency*/
if (dst->state == SD_RUNNABLE) {
/* if the task was runnable, the task goes back to SD_SCHEDULED because of the new dependency*/
if (dst->state == SD_RUNNABLE) {
- XBT_DEBUG("SD_task_dependency_add: %s was runnable and becomes scheduled!", dst->name.c_str());
+ XBT_DEBUG("SD_task_dependency_add: %s was runnable and becomes scheduled!", dst->name);
SD_task_set_state(dst, SD_SCHEDULED);
}
}
SD_task_set_state(dst, SD_SCHEDULED);
}
}
if (src->successors->find(dst) == src->successors->end() && src->outputs->find(dst) == src->outputs->end())
THROWF(arg_error, 0, "No dependency found between task '%s' and '%s': task '%s' is not a successor of task '%s'",
if (src->successors->find(dst) == src->successors->end() && src->outputs->find(dst) == src->outputs->end())
THROWF(arg_error, 0, "No dependency found between task '%s' and '%s': task '%s' is not a successor of task '%s'",
- src->name.c_str(), dst->name.c_str(), dst->name.c_str(), src->name.c_str());
+ src->name, dst->name, dst->name, src->name);
if (src->kind == SD_TASK_COMM_E2E || src->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK){
if (dst->kind == SD_TASK_COMP_SEQ || dst->kind == SD_TASK_COMP_PAR_AMDAHL)
if (src->kind == SD_TASK_COMM_E2E || src->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK){
if (dst->kind == SD_TASK_COMP_SEQ || dst->kind == SD_TASK_COMP_PAR_AMDAHL)
void SD_task_unschedule(SD_task_t task)
{
if (task->state == SD_NOT_SCHEDULED || task->state == SD_SCHEDULABLE)
void SD_task_unschedule(SD_task_t task)
{
if (task->state == SD_NOT_SCHEDULED || task->state == SD_SCHEDULABLE)
- THROWF(arg_error, 0, "Task %s: the state must be SD_SCHEDULED, SD_RUNNABLE, SD_RUNNING or SD_FAILED", task->name.c_str());
+ THROWF(arg_error, 0, "Task %s: the state must be SD_SCHEDULED, SD_RUNNABLE, SD_RUNNING or SD_FAILED", task->name);
if ((task->state == SD_SCHEDULED || task->state == SD_RUNNABLE) /* if the task is scheduled or runnable */
&& ((task->kind == SD_TASK_COMP_PAR_AMDAHL) || (task->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK))) {
if ((task->state == SD_SCHEDULED || task->state == SD_RUNNABLE) /* if the task is scheduled or runnable */
&& ((task->kind == SD_TASK_COMP_PAR_AMDAHL) || (task->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK))) {
/* Runs a task. */
void SD_task_run(SD_task_t task)
{
/* Runs a task. */
void SD_task_run(SD_task_t task)
{
- xbt_assert(task->state == SD_RUNNABLE, "Task '%s' is not runnable! Task state: %d", task->name.c_str(), (int) task->state);
- xbt_assert(task->allocation != nullptr, "Task '%s': host_list is nullptr!", task->name.c_str());
+ xbt_assert(task->state == SD_RUNNABLE, "Task '%s' is not runnable! Task state: %d", task->name, (int) task->state);
+ xbt_assert(task->allocation != nullptr, "Task '%s': host_list is nullptr!", task->name);
- XBT_VERB("Executing task '%s'", task->name.c_str());
+ XBT_VERB("Executing task '%s'", task->name);
/* Copy the elements of the task into the action */
int host_nb = task->allocation->size();
/* Copy the elements of the task into the action */
int host_nb = task->allocation->size();
void SD_task_distribute_comp_amdahl(SD_task_t task, int count)
{
xbt_assert(task->kind == SD_TASK_COMP_PAR_AMDAHL, "Task %s is not a SD_TASK_COMP_PAR_AMDAHL typed task."
void SD_task_distribute_comp_amdahl(SD_task_t task, int count)
{
xbt_assert(task->kind == SD_TASK_COMP_PAR_AMDAHL, "Task %s is not a SD_TASK_COMP_PAR_AMDAHL typed task."
- "Cannot use this function.", task->name.c_str());
+ "Cannot use this function.", task->name);
task->flops_amount = xbt_new0(double, count);
task->bytes_amount = xbt_new0(double, count * count);
task->flops_amount = xbt_new0(double, count);
task->bytes_amount = xbt_new0(double, count * count);
void SD_task_build_MxN_1D_block_matrix(SD_task_t task, int src_nb, int dst_nb){
xbt_assert(task->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK, "Task %s is not a SD_TASK_COMM_PAR_MXN_1D_BLOCK typed task."
void SD_task_build_MxN_1D_block_matrix(SD_task_t task, int src_nb, int dst_nb){
xbt_assert(task->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK, "Task %s is not a SD_TASK_COMM_PAR_MXN_1D_BLOCK typed task."
- "Cannot use this function.", task->name.c_str());
+ "Cannot use this function.", task->name);
xbt_free(task->bytes_amount);
task->bytes_amount = xbt_new0(double,task->allocation->size() * task->allocation->size());
xbt_free(task->bytes_amount);
task->bytes_amount = xbt_new0(double,task->allocation->size() * task->allocation->size());
for(int i =0; i<count; i++)
task->allocation->push_back(list[i]);
for(int i =0; i<count; i++)
task->allocation->push_back(list[i]);
- XBT_VERB("Schedule computation task %s on %zu host(s)", task->name.c_str(), task->allocation->size());
+ XBT_VERB("Schedule computation task %s on %zu host(s)", task->name, task->allocation->size());
if (task->kind == SD_TASK_COMP_SEQ) {
if (!task->flops_amount){ /*This task has failed and is rescheduled. Reset the flops_amount*/
if (task->kind == SD_TASK_COMP_SEQ) {
if (!task->flops_amount){ /*This task has failed and is rescheduled. Reset the flops_amount*/
int src_nb = input->allocation->size();
int dst_nb = count;
if (input->allocation->empty())
int src_nb = input->allocation->size();
int dst_nb = count;
if (input->allocation->empty())
- XBT_VERB("Sender side of '%s' not scheduled. Set receiver side to '%s''s allocation", input->name.c_str(), task->name.c_str());
+ XBT_VERB("Sender side of '%s' not scheduled. Set receiver side to '%s''s allocation", input->name, task->name);
for (int i=0; i<count;i++)
input->allocation->push_back(task->allocation->at(i));
for (int i=0; i<count;i++)
input->allocation->push_back(task->allocation->at(i));
SD_task_do_schedule(input);
XBT_VERB ("Auto-Schedule Communication task '%s'. Send %.f bytes from %d hosts to %d hosts.",
SD_task_do_schedule(input);
XBT_VERB ("Auto-Schedule Communication task '%s'. Send %.f bytes from %d hosts to %d hosts.",
- input->name.c_str(),input->amount, src_nb, dst_nb);
+ input->name,input->amount, src_nb, dst_nb);
int src_nb = count;
int dst_nb = output->allocation->size();
if (output->allocation->empty())
int src_nb = count;
int dst_nb = output->allocation->size();
if (output->allocation->empty())
- XBT_VERB("Receiver side of '%s' not scheduled. Set sender side to '%s''s allocation", output->name.c_str(), task->name.c_str());
+ XBT_VERB("Receiver side of '%s' not scheduled. Set sender side to '%s''s allocation", output->name, task->name);
for (int i=0; i<count;i++)
output->allocation->insert(output->allocation->begin()+i, task->allocation->at(i));
for (int i=0; i<count;i++)
output->allocation->insert(output->allocation->begin()+i, task->allocation->at(i));
SD_task_do_schedule(output);
XBT_VERB ("Auto-Schedule Communication task %s. Send %.f bytes from %d hosts to %d hosts.",
SD_task_do_schedule(output);
XBT_VERB ("Auto-Schedule Communication task %s. Send %.f bytes from %d hosts to %d hosts.",
- output->name.c_str(), output->amount, src_nb, dst_nb);
+ output->name, output->amount, src_nb, dst_nb);
typedef struct SD_task {
e_SD_task_state_t state;
void *data; /* user data */
typedef struct SD_task {
e_SD_task_state_t state;
void *data; /* user data */
e_SD_task_kind_t kind;
double amount;
double alpha; /* used by typed parallel tasks */
e_SD_task_kind_t kind;
double amount;
double alpha; /* used by typed parallel tasks */
XBT_PRIVATE void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state);
XBT_PRIVATE void SD_task_run(SD_task_t task);
XBT_PRIVATE bool acyclic_graph_detail(xbt_dynar_t dag);
XBT_PRIVATE void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state);
XBT_PRIVATE void SD_task_run(SD_task_t task);
XBT_PRIVATE bool acyclic_graph_detail(xbt_dynar_t dag);
+XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state);
SG_END_DECL()
#endif
XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state);
SG_END_DECL()
#endif