void ocrModelInitFlat(char * mdFile) { u32 nbHardThreads = ocr_config_default_nb_hardware_threads; if (mdFile != NULL) { //TODO need a file stat to check setMachineDescriptionFromPDL(mdFile); MachineDescription * md = getMachineDescription(); if (md == NULL) { // Something went wrong when reading the machine description file ocr_abort(); } else { nbHardThreads = MachineDescription_getNumHardwareThreads(md); // gHackTotalMemSize = MachineDescription_getDramSize(md); } } // This is the default policy // TODO this should be declared in the default policy model u64 nb_policy_domain = 1; u64 nb_workers_per_policy_domain = nbHardThreads; u64 nb_workpiles_per_policy_domain = nbHardThreads; u64 nb_comp_target_per_policy_domain = nbHardThreads; u64 nb_schedulers_per_policy_domain = 1; ocr_model_policy_t * policy_model = defaultOcrModelPolicy(nb_policy_domain, nb_schedulers_per_policy_domain, nb_workers_per_policy_domain, nb_comp_target_per_policy_domain, nb_workpiles_per_policy_domain); //TODO LIMITATION for now support only one policy n_root_policy_nodes = nb_policy_domain; root_policies = instantiateModel(policy_model); root_policies[0]->n_successors = 0; root_policies[0]->successors = NULL; root_policies[0]->n_predecessors = 0; root_policies[0]->predecessors = NULL; master_worker = root_policies[0]->workers[0]; root_policies[0]->start(root_policies[0]); }
fmiComponent fmiInstantiateModel(fmiString instanceName, fmiString GUID, fmiCallbackFunctions functions, fmiBoolean loggingOn) { return instantiateModel("fmiInstantiateModel", instanceName, GUID, functions, loggingOn); }
fmiComponent fmiInstantiateSlave(fmiString instanceName, fmiString GUID, fmiString fmuLocation, fmiString mimeType, fmiReal timeout, fmiBoolean visible, fmiBoolean interactive, fmiCallbackFunctions functions, fmiBoolean loggingOn) { // ignoring arguments: fmuLocation, mimeType, timeout, visible, interactive return instantiateModel("fmiInstantiateSlave", instanceName, GUID, functions, loggingOn); }