Commit 6f2cf8de authored by MOMMESSIN Clement's avatar MOMMESSIN Clement

Check allocation with nb of resources asked

parent 6c9882c0
......@@ -139,7 +139,7 @@ struct JobRejectedMessage
struct SchedulingAllocation
{
JobIdentifier job_id; //!< The JobIdentifier
MachineRange machine_ids; //!< User defined allocation in range ot machines ids
MachineRange machine_ids; //!< User defined allocation in range of machines ids
std::vector<int> mapping; //!< The mapping from executors (~=ranks) to resource ids. Can be empty, in which case it will NOT be used (a round robin will be used instead). If not empty, must be of the same size of the job, and each value must be in [0,nb_allocated_res[.
std::map<std::string, int> storage_mapping; //!< mapping from label given in the profile and machine id
std::vector<msg_host_t> hosts; //!< The list of SimGrid hosts that would be used (one executor per host)
......
......@@ -344,7 +344,7 @@ Job * Job::from_json(const rapidjson::Value & json_desc,
Workload * workload,
const std::string & error_prefix)
{
// Create and initialyze with default values
// Create and initialize with default values
Job * j = new Job;
j->workload = workload;
j->starting_time = -1;
......
......@@ -858,15 +858,26 @@ void server_on_execute_job(ServerData * data,
// Only this profile is able to manage the following scenario:
// The scheduler allocated a different number of resources than the
// number of requested resources.
if (allocation->mapping.size() != 0
and job->workload->profiles->at(job->profile)->type != ProfileType::MSG_PARALLEL_HOMOGENEOUS_TOTAL_AMOUNT)
if (job->workload->profiles->at(job->profile)->type != ProfileType::MSG_PARALLEL_HOMOGENEOUS_TOTAL_AMOUNT)
{
xbt_assert((int)allocation->mapping.size() == job->requested_nb_res,
"Job '%s' allocation is invalid. The job requires %d machines but only %d were given (%s). "
"Using a different number of machines is only allowed if a custom mapping is specified. "
"This mapping must specify which allocated machine each executor should use.",
job->id.to_string().c_str(), job->requested_nb_res, (int)allocation->mapping.size(),
allocation->machine_ids.to_string_hyphen().c_str());
if (allocation->mapping.size() != 0)
{
xbt_assert((int)allocation->mapping.size() == job->requested_nb_res,
"Job '%s' allocation is invalid. The job requires %d machines but only %d were given (%s). "
"Using a different number of machines is only allowed if a custom mapping is specified. "
"This mapping must specify which allocated machine each executor should use.",
job->id.to_string().c_str(), job->requested_nb_res, (int)allocation->mapping.size(),
allocation->machine_ids.to_string_hyphen().c_str());
}
else
{
xbt_assert((int)allocation->machine_ids.size() == job->requested_nb_res,
"Job '%s' allocation is invalid. The job requires %d machines but only %d were given (%s). "
"Using a different number of machines is only allowed if a custom mapping is specified. "
"This mapping must specify which allocated machine each executor should use.",
job->id.to_string().c_str(), job->requested_nb_res, (int)allocation->machine_ids.size(),
allocation->machine_ids.to_string_hyphen().c_str());
}
}
string pname = "job_" + job->id.to_string();
......
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