Commit 2d484922 authored by Millian Poquet's avatar Millian Poquet

Space characters harmonization

parent 74e512e6
......@@ -58,7 +58,7 @@ msg_error_t deploy_all(const char *platform_file, bool smpi_used)
if (!smpi_used)
MSG_config("host/model", "ptask_L07");
MSG_create_environment(platform_file);
all_hosts = MSG_hosts_as_dynar();
......@@ -95,21 +95,21 @@ int main(int argc, char *argv[])
printf("example: %s ../platforms/small_platform.xml ../workload_profiles/test_workload_profile.json\n", argv[0]);
exit(1);
}
json_t *json_workload_profile;
json_workload_profile = load_json_workload_profile(argv[2]);
retrieve_jobs(json_workload_profile);
retrieve_profiles(json_workload_profile);
checkJobsAndProfilesValidity();
MSG_init(&argc, argv);
// Register all smpi jobs app and init SMPI
bool smpi_used = register_smpi_app_instances();
msg_error_t res = deploy_all(argv[1], smpi_used);
json_decref(json_workload_profile);
// Let's clear global allocated data
freeJobStructures();
......
......@@ -669,7 +669,7 @@ msg_error_t deploy_all(const char *platform_file, const char * masterHostName, c
{
if (!smpi_used)
MSG_config("host/model", "ptask_L07");
MSG_create_environment(platform_file);
xbt_dynar_t all_hosts = MSG_hosts_as_dynar();
......
......@@ -53,7 +53,7 @@ int smpi_replay(int argc, char *argv[])
for(index = 0; index < argc; index++) {
printf("The %d is %s\n",index,argv[index]);
}
smpi_replay_run(&argc, &argv);
//printf("smpi_rank %d\n", smpi_comm_rank(MPI_));
return 0;
......@@ -211,7 +211,7 @@ int profile_exec(const char *profile_str, int job_id, int nb_res, msg_host_t *jo
}
else if (strcmp(profile->type, "smpi") == 0)
{
xbt_dynar_t traceFilenamesDynar = ((s_smpi_t *)(profile->data))->trace_filenames_dynar;
for (int i = 0; i < nb_res; i++)
......@@ -219,7 +219,7 @@ int profile_exec(const char *profile_str, int job_id, int nb_res, msg_host_t *jo
char *str_instance_id = NULL;
int ret = asprintf(&str_instance_id, "%d", job_id);
xbt_assert(ret != -1, "asprintf failed (not enough memory?)");
char *str_rank_id = NULL;
ret = asprintf(&str_rank_id, "%d", i);
xbt_assert(ret != -1, "asprintf failed (not enough memory?)");
......@@ -227,7 +227,7 @@ int profile_exec(const char *profile_str, int job_id, int nb_res, msg_host_t *jo
char *str_pname = NULL;
ret = asprintf(&str_pname, "%d_%d", job_id, i);
xbt_assert(ret != -1, "asprintf failed (not enough memory?)");
char **argv = xbt_new(char*, 5);
argv[0] = xbt_strdup("1"); // Fonction_replay_label (can be ignored, for log only),
argv[1] = str_instance_id; // Instance Id (application) job_id is used
......@@ -236,10 +236,10 @@ int profile_exec(const char *profile_str, int job_id, int nb_res, msg_host_t *jo
argv[4] = xbt_strdup("0"); //
MSG_process_create_with_arguments(str_pname, smpi_replay, NULL, job_res[i], 5, argv );
free(str_pname);
}
}
else
xbt_die("Cannot execute job %d: the profile type '%s' is unknown", job_id, profile->type);
......@@ -265,17 +265,17 @@ int job_exec(int job_id, int nb_res, int *res_idxs, msg_host_t *nodes, double wa
bool register_smpi_app_instances()
{
bool smpi_used = false;
bool smpi_used = false;
s_job_t *job;
profile_t profile;
unsigned int job_index;
int nb_traces;
xbt_dynar_foreach(jobs_dynar, job_index, job)
{
profile = xbt_dict_get(profiles,job->profile);
if (strcmp(profile->type, "smpi") == 0)
{
smpi_used = true;
......@@ -290,6 +290,6 @@ bool register_smpi_app_instances()
}
if (smpi_used)
SMPI_init();
return(smpi_used);
}
......@@ -46,7 +46,7 @@ json_t *load_json_workload_profile(char *filename)
}
dirname_workload_file = dirname(xbt_strdup(filename));
root = json_load_file(filename, 0, &error);
if(!root)
......@@ -287,7 +287,7 @@ void retrieve_profiles(json_t *root)
{
s_smpi_t * smpi_prof = xbt_new(s_smpi_t, 1);
profile->data = smpi_prof;
e = json_object_get(j_profile, "trace");
xbt_assert(e != NULL, "The smpi profile '%s' must have a 'trace' field", key);
xbt_assert(json_typeof(e) == JSON_STRING, "The 'trace' field of the smpi profile '%s' must be a string", key);
......@@ -299,13 +299,13 @@ void retrieve_profiles(json_t *root)
char *line = NULL;
size_t n = 0;
char *dname = NULL;
dirname(xbt_strdup(filename));
int ret = asprintf(&filename, "%s/%s", dirname_workload_file, json_string_value(e));
xbt_assert(ret != -1, "asprintf failed (not enough memory?)");
dname = dirname(xbt_strdup(filename));
xbt_dynar_t traceFilenamesDynar = xbt_dynar_new(sizeof(char *), NULL);
fp = fopen(filename, "r");
if (fp == NULL)
......@@ -314,17 +314,17 @@ void retrieve_profiles(json_t *root)
xbt_str_trim(line, NULL);
ret = asprintf(&trace_filename, "%s/%s", dname, line);
xbt_assert(ret != -1, "asprintf failed (not enough memory?)");
xbt_dynar_push_as(traceFilenamesDynar, char *, trace_filename);
}
smpi_prof->trace_filenames_dynar = traceFilenamesDynar;
smpi_prof->trace_filenames_dynar = traceFilenamesDynar;
smpi_prof->nb_traces = xbt_dynar_length(traceFilenamesDynar);
free(filename);
free(dname);
}
else
xbt_die("Invalid profile '%s' : type '%s' is not supported", key, profile->type);
......@@ -358,7 +358,7 @@ void freeProfile(void * profile)
}
else if (strcmp(prof->type, "smpi") == 0)
{
s_smpi_t * data = prof->data;
xbt_dynar_free(&data->trace_filenames_dynar);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment