in string componentName )
raises (SALOME::SALOME_Exception);
+ MachineParameters GetMachineParameters( in string hostname );
+
void Shutdown();
void ShutdownContainers();
return _id;
}
+Engines::MachineParameters* SALOME_ContainerManager::GetMachineParameters(const char *hostname)
+{
+ return _ResManager->GetMachineParameters(hostname);
+}
char* FindFirst(const Engines::MachineList& possibleComputers);
+ Engines::MachineParameters* GetMachineParameters(const char *hostname);
+
void Shutdown();
void ShutdownContainers();
int cmax=0;
int fmin=10;
int fmax=0;
+ int nbpmax;
for(map<string,int>::iterator iter=cycle.begin();iter!=cycle.end();iter++){
if(strcmp((*iter).first.c_str(),"localhost")!=0){
- if(cycle[(*iter).first]<cmin) cmin=cycle[(*iter).first];
- if(cycle[(*iter).first]>cmax) cmax=cycle[(*iter).first];
- if(first[(*iter).first]<fmin) fmin=first[(*iter).first];
- if(first[(*iter).first]>fmax) fmax=first[(*iter).first];
+ Engines::MachineParameters *p = _ContManager->GetMachineParameters((*iter).first.c_str());
+ int nbproc = p->nb_node * p->nb_proc_per_node;
+ if(cycle[(*iter).first]/nbproc<cmin) cmin=cycle[(*iter).first]/nbproc;
+ if(cycle[(*iter).first]/nbproc>cmax) cmax=cycle[(*iter).first]/nbproc;
+ if(first[(*iter).first]/nbproc<fmin) fmin=first[(*iter).first]/nbproc;
+ if(first[(*iter).first]/nbproc>fmax){
+ fmax=first[(*iter).first]/nbproc;
+ nbpmax = nbproc;
+ }
}
}
- if( ((cmax-cmin) <= 1) && (fmax == 10) && !error ){
+ if( ((cmax-cmin) <= 1) && (fmax == 10/nbpmax) && !error ){
string msg;
if(bestImplemented)
msg = "TEST OK";
return string(hosts[0]);
}
-string SALOME_LoadRateManager::FindNext(const Engines::MachineList& hosts,SALOME_NamingService *ns)
+string SALOME_LoadRateManager::FindNext(const Engines::MachineList& hosts,MapOfParserResourcesType& resList,SALOME_NamingService *ns)
{
MESSAGE("SALOME_LoadRateManager::FindNext " << hosts.length());
map<string, int> machines;
}
int imin = 0;
- int min = machines[string(hosts[0])];
+ ParserResourcesType resource = resList[string(hosts[0])];
+ int nbproc = resource.DataForSort._nbOfProcPerNode * resource.DataForSort._nbOfNodes;
+ int min = machines[string(hosts[0])]/nbproc;
for(int i=1;i<hosts.length();i++){
- if( machines[string(hosts[i])] < min ){
+ resource = resList[string(hosts[i])];
+ nbproc = resource.DataForSort._nbOfProcPerNode * resource.DataForSort._nbOfNodes;
+ if( machines[string(hosts[i])]/nbproc < min ){
imin = i;
- min = machines[string(hosts[i])];
+ min = machines[string(hosts[i])]/nbproc;
}
}
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
#include <string>
+#include "SALOME_ResourcesCatalog_Parser.hxx"
#include "SALOME_NamingService.hxx"
#if defined RESOURCESMANAGER_EXPORTS
public:
std::string FindFirst(const Engines::MachineList& hosts);
- std::string FindNext(const Engines::MachineList& hosts,SALOME_NamingService *ns);
+ std::string FindNext(const Engines::MachineList& hosts,MapOfParserResourcesType& resList,SALOME_NamingService *ns);
std::string FindBest(const Engines::MachineList& hosts) throw (SALOME_Exception);
};
string
SALOME_ResourcesManager::FindNext(const Engines::MachineList& listOfMachines)
{
- return _dynamicResourcesSelecter.FindNext(listOfMachines,_NS);
+ return _dynamicResourcesSelecter.FindNext(listOfMachines,_resourcesList,_NS);
}
//=============================================================================
/*!
}
-
-
-
+Engines::MachineParameters* SALOME_ResourcesManager::GetMachineParameters(const char *hostname)
+{
+ ParserResourcesType resource = _resourcesList[string(hostname)];
+ Engines::MachineParameters *p_ptr = new Engines::MachineParameters;
+ p_ptr->container_name = CORBA::string_dup("");
+ p_ptr->hostname = CORBA::string_dup("hostname");
+ p_ptr->OS = CORBA::string_dup(resource.OS.c_str());
+ p_ptr->mem_mb = resource.DataForSort._memInMB;
+ p_ptr->cpu_clock = resource.DataForSort._CPUFreqMHz;
+ p_ptr->nb_proc_per_node = resource.DataForSort._nbOfProcPerNode;
+ p_ptr->nb_node = resource.DataForSort._nbOfNodes;
+ return p_ptr;
+}
const MapOfParserResourcesType& GetList() const;
+ Engines::MachineParameters* GetMachineParameters(const char *hostname);
+
protected:
SALOME_NamingService *_NS;