Salome HOME
Merge branch 'V9_2_2_BR'
[tools/yacsgen.git] / module_generator / mpi_tmpl.py
index 6ce3172bc92f18b5ff55ff12b2fafdf0a54cd5dd..acf3df95bd68576308c2c2a680f244273ff98970 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2015  EDF R&D
+# Copyright (C) 2009-2019  EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -20,7 +20,7 @@
 try:
   from string import Template
 except:
-  from compat import Template,set
+  from module_generator.compat import Template,set
 
 # cxx file of a MPI component.
 # template parameters:
@@ -110,10 +110,7 @@ extern "C"
     }
     
     MPI_Comm_rank( MPI_COMM_WORLD, &numproc );
-    if( numproc == 0 )
-      regist = true;
-    else
-      regist = false;
+    regist = ( numproc == 0 );
     ${component}_i * myEngine = new ${component}_i(orb, poa, contId, instanceName, interfaceName, regist);
     return myEngine->getId() ;
   }
@@ -275,10 +272,6 @@ ${body}
   catch ( const SALOME_Exception & ex)
     {
       THROW_SALOME_CORBA_EXCEPTION(CORBA::string_dup(ex.what()), SALOME::INTERNAL_ERROR);
-/*      SALOME::ExceptionStruct es;
-      es.text=CORBA::string_dup(ex.what());
-      es.type=SALOME::INTERNAL_ERROR;
-      throw SALOME::SALOME_Exception(es);*/
     }
   catch ( const SALOME::SALOME_Exception & ex)
     {
@@ -287,20 +280,10 @@ ${body}
   catch ( const std::exception& ex)
     {
       THROW_SALOME_CORBA_EXCEPTION(CORBA::string_dup(ex.what()), SALOME::INTERNAL_ERROR);
-/*      //std::cerr << typeid(ex).name() << std::endl;
-      SALOME::ExceptionStruct es;
-      es.text=CORBA::string_dup(ex.what());
-      es.type=SALOME::INTERNAL_ERROR;
-      throw SALOME::SALOME_Exception(es);*/
     }
   catch (...)
     {
       THROW_SALOME_CORBA_EXCEPTION("unknown exception", SALOME::INTERNAL_ERROR);
-/*      std::cerr << "unknown exception" << std::endl;
-      SALOME::ExceptionStruct es;
-      es.text=CORBA::string_dup(" unknown exception");
-      es.type=SALOME::INTERNAL_ERROR;
-      throw SALOME::SALOME_Exception(es);*/
     }
   endService("${component}_i::${service}");
 }