//
#include "SALOME_ResourcesCatalog_Handler.hxx"
#include "Basics_Utils.hxx"
+#include "utilities.h"
#include <iostream>
#include <sstream>
#include <map>
iter != _resources_list.end();
iter++)
{
- std::cerr << "************************************************" << std::endl;
- std::cerr << "Resource " << (*iter).first << " found:" << std::endl;
- std::cerr << (*iter).second;
- std::cerr << "************************************************" << std::endl;
+ MESSAGE( "************************************************" );
+ MESSAGE( "Resource " << (*iter).first << " found:" );
+ MESSAGE( (*iter).second );
+ MESSAGE( "************************************************" );
}
#endif
}
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! found a cluster without a hostname" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! this cluster will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! found a cluster without a hostname" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! this cluster will not be added" );
return false;
}
{
resource.Name = resource.HostName;
resource.DataForSort._Name = resource.HostName;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! No Name found use Hostname for resource: " << resource.Name << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! No Name found use Hostname for resource: " << resource.Name );
}
if (xmlHasProp(cluster_descr, (const xmlChar*)test_use))
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! found a cluster without a use" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! this cluster will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! found a cluster without a use" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! this cluster will not be added" );
return false;
}
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! found a cluster without a nbOfProc" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! this cluster will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! found a cluster without a nbOfProc" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! this cluster will not be added" );
return false;
}
// Test: Il faut au moins un membre pour que le cluster soit correct !
if (resource.ClusterMembersList.empty())
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! found a cluster without a member" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! this cluster will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! found a cluster without a member" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessCluster : !!! Warning !!! this cluster will not be added" );
return false;
}
return true;
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a hostname" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a hostname" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" );
return false;
}
}
catch (const ResourcesException & )
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" );
return false;
}
xmlFree(protocol);
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a protocol" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a protocol" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" );
return false;
}
}
catch (const ResourcesException &)
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" );
return false;
}
xmlFree(iprotocol);
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a protocol" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a protocol" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" );
return false;
}
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a user name" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a user name" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" );
return false;
}
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a nbOfNodes" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a nbOfNodes" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" );
return false;
}
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a nbOfProcPerNode" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a nbOfProcPerNode" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" );
return false;
}
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a AppliPath" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine without a AppliPath" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" );
return false;
}
return true;
}
else
{
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMachine : Warning found a machine without a hostname" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMachine : Warning this machine will not be added" << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMachine : Warning found a machine without a hostname" );
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMachine : Warning this machine will not be added" );
return false;
}
{
resource.Name = resource.HostName;
resource.DataForSort._Name = resource.HostName;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMachine : !!! Warning !!! No Name found use Hostname for resource: " << resource.Name << std::endl;
+ MESSAGE( "SALOME_ResourcesCatalog_Handler::ProcessMachine : !!! Warning !!! No Name found use Hostname for resource: " << resource.Name );
}
// This block is for compatibility with files created in Salome 6.
// It can safely be removed in Salome 8.
if (xmlHasProp(machine_descr, (const xmlChar*)test_mode))
{
- cerr << "Warning: parameter \"" << test_mode << "\" defined for resource \"" <<
+ MESSAGE( "Warning: parameter \"" << test_mode << "\" defined for resource \"" <<
resource.Name << "\" is deprecated. It will be replaced when your resource " <<
- "file is saved." << endl;
+ "file is saved." );
xmlChar* mode=xmlGetProp(machine_descr, (const xmlChar*)test_mode);
switch ( mode[0] )
{
if (xmlHasProp(machine_descr, (const xmlChar*)test_is_cluster_head))
{
- cerr << "Warning: parameter \"" << test_is_cluster_head << "\" defined for resource \"" <<
+ MESSAGE( "Warning: parameter \"" << test_is_cluster_head << "\" defined for resource \"" <<
resource.Name << "\" is deprecated. It will be replaced when your resource " <<
- "file is saved." << endl;
+ "file is saved." );
xmlChar* is_cluster_head = xmlGetProp(machine_descr, (const xmlChar*)test_is_cluster_head);
std::string str_ich = (const char*)is_cluster_head;
if (str_ich == "true")
}
catch (const ResourcesException &)
{
- cerr << "Warning, invalid type \"" << (const char*)type << "\" for resource \"" <<
+ MESSAGE( "Warning, invalid type \"" << (const char*)type << "\" for resource \"" <<
resource.Name << "\", using default value \"" << resource.getResourceTypeStr() <<
- "\"" << endl;
+ "\"" ) ;
}
xmlFree(type);
}
else
{
- cerr << "Warning, no type found for resource \"" << resource.Name <<
- "\", using default value \"" << resource.getResourceTypeStr() << "\"" << endl;
+ MESSAGE( "Warning, no type found for resource \"" << resource.Name <<
+ "\", using default value \"" << resource.getResourceTypeStr() << "\"");
}
if (xmlHasProp(machine_descr, (const xmlChar*)test_batch_queue))
}
catch (const ResourcesException &)
{
- cerr << "Warning, invalid protocol \"" << (const char*)protocol << "\" for resource \"" <<
+ MESSAGE( "Warning, invalid protocol \"" << (const char*)protocol << "\" for resource \"" <<
resource.Name << "\", using default value \"" <<
- resource.getAccessProtocolTypeStr() << "\"" << endl;
+ resource.getAccessProtocolTypeStr() << "\"" );
}
xmlFree(protocol);
}
}
catch (const ResourcesException &)
{
- cerr << "Warning, invalid internal protocol \"" << (const char*)iprotocol <<
+ MESSAGE( "Warning, invalid internal protocol \"" << (const char*)iprotocol <<
"\" for resource \"" << resource.Name << "\", using default value \"" <<
- resource.getClusterInternalProtocolStr() << "\"" << endl;
+ resource.getClusterInternalProtocolStr() << "\"" );
}
xmlFree(iprotocol);
}
}
catch (const ResourcesException &)
{
- cerr << "Warning, invalid batch manager \"" << (const char*)batch <<
+ MESSAGE( "Warning, invalid batch manager \"" << (const char*)batch <<
"\" for resource \"" << resource.Name << "\", using default value \"" <<
- resource.getBatchTypeStr() << "\"" << endl;
+ resource.getBatchTypeStr() << "\"" );
}
xmlFree(batch);
}
}
catch (const ResourcesException &)
{
- cerr << "Warning, invalid MPI implementation \"" << (const char*)mpi <<
+ MESSAGE( "Warning, invalid MPI implementation \"" << (const char*)mpi <<
"\" for resource \"" << resource.Name << "\", using default value \"" <<
- resource.getMpiImplTypeStr() << "\"" << endl;
+ resource.getMpiImplTypeStr() << "\"" );
}
xmlFree(mpi);
}
}
catch (const ResourcesException &)
{
- cerr << "Warning, invalid can_launch_batch_jobs parameter value \"" <<
+ MESSAGE( "Warning, invalid can_launch_batch_jobs parameter value \"" <<
(const char*)can_launch_batch_jobs << "\" for resource \"" << resource.Name <<
- "\", using default value \"" << resource.getCanLaunchBatchJobsStr() << "\"" << endl;
+ "\", using default value \"" << resource.getCanLaunchBatchJobsStr() << "\"" );
}
xmlFree(can_launch_batch_jobs);
}
}
catch (const ResourcesException &)
{
- cerr << "Warning, invalid can_run_containers parameter value \"" <<
+ MESSAGE( "Warning, invalid can_run_containers parameter value \"" <<
(const char*)can_run_containers << "\" for resource \"" << resource.Name <<
- "\", using default value \"" << resource.getCanRunContainersStr() << "\"" << endl;
+ "\", using default value \"" << resource.getCanRunContainersStr() << "\"" );
}
xmlFree(can_run_containers);
}