Salome HOME
ok mpi and multithread, see example/ghs3dprh_multithread_cube_one_face.py
[plugins/ghs3dprlplugin.git] / src / GHS3DPRLPlugin / GHS3DPRLPlugin_GHS3DPRL.cxx
index 6e6b0e06e4a9b7554a0906857af984c2cb5816f8..cc1fe0e7a8974b99707eebe159e7d2caa6ed1778 100644 (file)
@@ -261,6 +261,7 @@ bool GHS3DPRLPlugin_GHS3DPRL::Compute(SMESH_Mesh&         theMesh,
     fileskinmesh(""),
     path,
     casenamemed;  //_MEDName.c_str());
+  int res = 0;    // 0 is OK 
 
   casenamemed += (char *)_MEDName.c_str();
   int n=casenamemed.SearchFromEnd('/');
@@ -363,13 +364,20 @@ bool GHS3DPRLPlugin_GHS3DPRL::Compute(SMESH_Mesh&         theMesh,
   //sometimes it is better to wait flushing files on slow filesystem...
   system( "sleep 3" );
   //launch tetrahpc2med which launch mg-tetra_hpc.py which launch mg-tetra_hpc(_mpi?).exe
-  system( run_GHS3DPRL.ToCString() );
+  res = system( run_GHS3DPRL.ToCString() );
+  if (res > 0) 
+  {
+    pluginerror = pluginerror + "PROBLEM tetrahpc2med command";
+    cout<<pluginerror<<endl;
+    error(COMPERR_ALGO_FAILED, pluginerror.ToCString());
+    return false; //but it is not a problem but if true my message is overwritten
+  }
   system( "sleep 3" );
 
   if (_Background) {
     pluginerror = pluginerror + "backgrounding... plugin is not waiting for output files "+ casenamemed + "_*.med";
     cout<<pluginerror<<endl;
-    error(COMPERR_ALGO_FAILED, pluginerror.ToCString());
+    error(COMPERR_NO_MESH_ON_SHAPE, pluginerror.ToCString());
     return false; //but it is not a problem but if true my message is overwritten
     //return true; //but it is not a problem,
   }
@@ -380,9 +388,9 @@ bool GHS3DPRLPlugin_GHS3DPRL::Compute(SMESH_Mesh&         theMesh,
     Ok = false; //but it is not a problem but if true my message is overwritten
     fclose(aResultFile);
     cout<<"GHS3DPRL OK output master file "<<casenamemed<<".xml exist !\n\n";
-    pluginerror = pluginerror + "new tetraedra not in memory, but stored in files "+ casenamemed + "_*.med";
+    pluginerror = pluginerror + "MG-tetra_hpc mesh(es) not loaded in memory, are stored in files "+ casenamemed + "_*.med";
     cout<<pluginerror<<endl;
-    error(COMPERR_ALGO_FAILED, pluginerror.ToCString());
+    error(COMPERR_NO_MESH_ON_SHAPE, pluginerror.ToCString());
     if (!_KeepFiles) system( run_nokeep_files.ToCString() );
   }
   else{