string alias;
//! protocol to use to start a remote container (ssh or rsh)
string protocol;
+ //! cluster internal protocol to use to start a remote container (ssh or rsh) on the cluster
+ string iprotocol;
//! login name to use to start a remote container
string username;
//! salome application to use to start a remote container
LAUNCHER_MESSAGE("State received is: " << par[STATE].str());
// Patch until new LIBBATCH version
- // eSSH Client and ePBS Client
- if (par[STATE].str() == "Running" or par[STATE].str() == "E" or par[STATE].str() == "R")
+ // eSSH Client and ePBS Client and eSGE
+ if (par[STATE].str() == "Running" or par[STATE].str() == "E" or par[STATE].str() == "R" or par[STATE].str() == "r")
_state = "RUNNING";
else if (par[STATE].str() == "Stopped")
_state = "PAUSED";
- else if (par[STATE].str() == "Done" or par[STATE].str() == "U")
+ else if (par[STATE].str() == "Done" or par[STATE].str() == "U" or par[STATE].str() == "e")
_state = "FINISHED";
- else if (par[STATE].str() == "Dead")
+ else if (par[STATE].str() == "Dead" or par[STATE].str() == "Eqw")
_state = "ERROR";
- else if (par[STATE].str() == "Q")
+ else if (par[STATE].str() == "Q" or par[STATE].str() == "qw")
_state = "QUEUED";
}
#endif
// -- Generates Catalog Resources
std::string machine_protocol = "ssh";
- if (_machine_definition.Protocol == rsh)
+ if (_machine_definition.ClusterInternalProtocol == rsh)
machine_protocol = "rsh";
launch_script_stream << "if [ \"x$LIBBATCH_NODEFILE\" != \"x\" ]; then " << std::endl;
const char *alias,
const char *userName,
AccessModeType mode,
- AccessProtocolType prot)
+ AccessProtocolType prot,
+ AccessProtocolType iprot)
throw(ResourcesException)
{
vector<string>::const_iterator iter = find(componentsOnNewResources.begin(),
newElt.DataForSort._hostName = paramsOfNewResources.hostname;
newElt.Alias = alias;
newElt.Protocol = prot;
+ newElt.ClusterInternalProtocol = iprot;
newElt.Mode = mode;
newElt.UserName = userName;
newElt.ComponentsList = componentsOnNewResources;
const char *alias,
const char *userName,
AccessModeType mode,
- AccessProtocolType prot) throw(ResourcesException);
+ AccessProtocolType prot,
+ AccessProtocolType iprot) throw(ResourcesException);
void DeleteResourceInCatalog(const char *hostname);
test_hostname = "hostname";
test_alias = "alias";
test_protocol = "protocol";
+ test_cluster_internal_protocol = "iprotocol";
test_mode = "mode";
test_batch = "batch";
test_mpi = "mpi";
std::cerr << (*iter).second.AppliPath << std::endl;
std::cerr << (*iter).second.OS << std::endl;
std::cerr << (*iter).second.Protocol << std::endl;
+ std::cerr << (*iter).second.ClusterInternalProtocol << std::endl;
std::cerr << (*iter).second.Mode << std::endl;
}
#endif
return false;
}
+ if (xmlHasProp(member_descr, (const xmlChar*)test_cluster_internal_protocol))
+ {
+ xmlChar* iprotocol= xmlGetProp(member_descr, (const xmlChar*)test_cluster_internal_protocol);
+ switch (iprotocol[0])
+ {
+ case 'r':
+ resource.ClusterInternalProtocol = rsh;
+ break;
+ case 's':
+ resource.ClusterInternalProtocol = ssh;
+ break;
+ default:
+ 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;
+ 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;
+ return false;
+ }
+
if (xmlHasProp(member_descr, (const xmlChar*)test_user_name))
{
xmlChar* user_name= xmlGetProp(member_descr, (const xmlChar*)test_user_name);
else
resource.Protocol = rsh;
+ if (xmlHasProp(machine_descr, (const xmlChar*)test_cluster_internal_protocol))
+ {
+ xmlChar* protocol= xmlGetProp(machine_descr, (const xmlChar*)test_cluster_internal_protocol);
+ switch ( protocol[0])
+ {
+ case 'r':
+ resource.ClusterInternalProtocol = rsh;
+ break;
+ case 's':
+ resource.ClusterInternalProtocol = ssh;
+ break;
+ default:
+ // If it'not in all theses cases, the protocol is affected to rsh
+ resource.ClusterInternalProtocol = rsh;
+ break;
+ }
+ xmlFree(protocol);
+ }
+ else
+ resource.ClusterInternalProtocol = rsh;
+
if (xmlHasProp(machine_descr, (const xmlChar*)test_mode))
{
xmlChar* mode=xmlGetProp(machine_descr, (const xmlChar*)test_mode);
xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh");
}
+ switch ((*iter).second.ClusterInternalProtocol)
+ {
+ case rsh:
+ xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh");
+ break;
+ case ssh:
+ xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "ssh");
+ break;
+ default:
+ xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh");
+ }
+
switch ((*iter).second.Mode)
{
case interactive:
xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh");
}
+ switch ((*iter).second.ClusterInternalProtocol)
+ {
+ case rsh:
+ xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh");
+ break;
+ case ssh:
+ xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "ssh");
+ break;
+ default:
+ xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh");
+ }
+
switch ((*iter).second.Mode)
{
case interactive:
const char *test_hostname;
const char *test_alias;
const char *test_protocol;
+ const char *test_cluster_internal_protocol;
const char *test_mode;
const char *test_batch;
const char *test_mpi;
"CPUFreqMHz : " << DataForSort._CPUFreqMHz << endl <<
"MemInMB : " << DataForSort._memInMB << endl <<
"Protocol : " << Protocol << endl <<
+ "ClusterInternalProtocol : " << ClusterInternalProtocol << endl <<
"Mode : " << Mode << endl <<
"Batch : " << Batch << endl <<
"mpi : " << mpi << endl <<
HostName = "";
Alias = "";
Protocol = rsh;
+ ClusterInternalProtocol = rsh;
Mode = interactive;
Batch = none;
mpi = nompi;
{
std::string HostName;
AccessProtocolType Protocol;
+ AccessProtocolType ClusterInternalProtocol;
std::string UserName;
std::string AppliPath;
ResourceDataToSort DataForSort;
std::string HostName;
std::string Alias;
AccessProtocolType Protocol;
+ AccessProtocolType ClusterInternalProtocol;
AccessModeType Mode;
BatchType Batch;
MpiImplType mpi;
p_ptr->protocol = "rsh";
else if( resource.Protocol == ssh )
p_ptr->protocol = "ssh";
+ if( resource.ClusterInternalProtocol == rsh )
+ p_ptr->iprotocol = "rsh";
+ else if( resource.ClusterInternalProtocol == ssh )
+ p_ptr->iprotocol = "ssh";
p_ptr->username = CORBA::string_dup(resource.UserName.c_str());
p_ptr->applipath = CORBA::string_dup(resource.AppliPath.c_str());
p_ptr->componentList.length(resource.ComponentsList.size());
ParserResourcesClusterMembersType fake_node;
fake_node.HostName = resource.HostName;
fake_node.Protocol = resource.Protocol;
+ fake_node.ClusterInternalProtocol = resource.ClusterInternalProtocol;
fake_node.UserName = resource.UserName;
fake_node.AppliPath = resource.AppliPath;
fake_node.DataForSort = resource.DataForSort;
ParserResourcesClusterMembersType fake_node;
fake_node.HostName = resource.HostName;
fake_node.Protocol = resource.Protocol;
+ fake_node.ClusterInternalProtocol = resource.ClusterInternalProtocol;
fake_node.UserName = resource.UserName;
fake_node.AppliPath = resource.AppliPath;
fake_node.DataForSort = resource.DataForSort;