5 #include "SALOME_NamingService.hxx"
6 #include <SALOMEconfig.h>
7 #include CORBA_SERVER_HEADER(SALOME_RessourcesCatalog)
11 int main(int argc,char **argv)
14 CosNaming::NamingContext_var _rootContext;
15 CORBA::Object_var objVar, objVarN;
20 orb = CORBA::ORB_init (argc, argv);
23 // Get CORBA reference of the catalog
24 SALOME_NamingService NS(orb);
25 CORBA::Object_var objVarN = NS.Resolve("/Kernel/RessourcesCatalog");
27 SALOME_RessourcesCatalog::RessourcesCatalog_var Catalogue = SALOME_RessourcesCatalog::RessourcesCatalog::_narrow(objVarN);
28 MESSAGE("Ressources distant catalog found");
30 //Get Computer list information
31 SALOME_RessourcesCatalog::ListOfComputer_var _list = Catalogue->GetComputerList();
32 for (unsigned int ind = 0; ind < _list->length();ind++)
34 MESSAGE("Ressources list : " << _list[ind]);
37 //Get container type list of computer eri
38 SALOME_RessourcesCatalog::ListOfContainerType_var list = Catalogue->GetContainerTypeList("eri");
39 for (unsigned int ind = 0; ind < list->length();ind++)
41 MESSAGE("Container type list of eri : " << list[ind]);
44 // Get processors information of eri
45 SALOME_RessourcesCatalog::computer_info_var computer = Catalogue->GetComputerInfo("eri");
46 MESSAGE("Ressource name : " << computer->name);
47 MESSAGE("Ressource OS : " << computer->OS);
48 MESSAGE("Ressource OS version : " << computer->OS_version);
49 for (unsigned int ind = 0; ind < computer->procs.length();ind++)
51 MESSAGE("Processor number : " << computer->procs[ind].number);
52 MESSAGE("Processor model name : " << computer->procs[ind].model_name);
53 MESSAGE("Processor cpu : " << computer->procs[ind].cpu_mhz);
54 MESSAGE("Processor cache : " << computer->procs[ind].cache_size);
58 catch(SALOME_RessourcesCatalog::NotFound &){
59 INFOS("SALOME_RessourcesCatalog::NotFound");
61 catch(CORBA::SystemException&) {
62 INFOS("Caught CORBA::SystemException.")
64 catch (CosNaming::NamingContext::CannotProceed &) {
65 INFOS("CosNaming::NamingContext::CannotProceed")
67 catch (CosNaming::NamingContext::NotFound &) {
68 INFOS("CosNaming::NamingContext::NotFound")
70 catch (CosNaming::NamingContext::InvalidName &) {
71 INFOS("CosNaming::NamingContext::InvalidName")
73 catch (CosNaming::NamingContext::AlreadyBound &) {
74 INFOS("CosNaming::NamingContext::AlreadyBound")
76 catch (CosNaming::NamingContext::NotEmpty &) {
77 INFOS("CosNaming::NamingContext::NotEmpty")
80 catch(CORBA::Exception &sysEx) {
81 INFOS("Caught CORBA::Exception.")