Personal tools
You are here: Home Forum Other... (new forum, problems, etc.) Crash in parallel mode due to static variables in class SMDS_MeshCell

Crash in parallel mode due to static variables in class SMDS_MeshCell

Up to Other... (new forum, problems, etc.)

Crash in parallel mode due to static variables in class SMDS_MeshCell

Posted by vico at September 19. 2016

class SMDS_MeshCell with these static methods it's not thread safe, they will cause crash even in reading mode when access SMDS_MeshElement->nodeIterator();

  static VTKCellType         toVtkType (SMDSAbs_EntityType vtkType);
  static SMDSAbs_EntityType  toSmdsType(VTKCellType vtkType);

  static const std::vector<int>& toVtkOrder(VTKCellType vtkType);
  static const std::vector<int>& toVtkOrder(SMDSAbs_EntityType smdsType);
  static const std::vector<int>& fromVtkOrder(VTKCellType vtkType);
  static const std::vector<int>& fromVtkOrder(SMDSAbs_EntityType smdsType);

  static const std::vector<int>& reverseSmdsOrder(SMDSAbs_EntityType smdsType);
  static const std::vector<int>& interlacedSmdsOrder(SMDSAbs_EntityType smdsType);

Re: Crash in parallel mode due to static variables in class SMDS_MeshCell

Posted by SMESH expert at September 26. 2016

Hello vico

You are right, currently SMESH is not ready to parallel use.

Best regards

Edward

Re: Crash in parallel mode due to static variables in class SMDS_MeshCell

Posted by vico at September 27. 2016

Hello Edward,

I workaround by initializing these static variables (calling these static meshods) before entering parallel mode.

Will SMESH have plan for parallel data access in the first stage by eliminating global and satic data from code?

Best Regards,
Vico

 

Re: Crash in parallel mode due to static variables in class SMDS_MeshCell

Posted by SMESH expert at September 27. 2016

Dear Vico

There is no such a plan. But if you identify and report not thread-safe codes, I will fix them, if not too difficult.

Best regards

Edward

Re: Crash in parallel mode due to static variables in class SMDS_MeshCell

Posted by vico at September 28. 2016

Dear Edward,

SMESH will works well in parallel mode if several few static and global variables are eliminated.

Could you please fix these static methods reported in this threads firstly? They are listed as below:

  static VTKCellType         toVtkType (SMDSAbs_EntityType vtkType);
  static SMDSAbs_EntityType  toSmdsType(VTKCellType vtkType);

  static const std::vector<int>& toVtkOrder(VTKCellType vtkType);
  static const std::vector<int>& toVtkOrder(SMDSAbs_EntityType smdsType);
  static const std::vector<int>& fromVtkOrder(VTKCellType vtkType);
  static const std::vector<int>& fromVtkOrder(SMDSAbs_EntityType smdsType);

  static const std::vector<int>& reverseSmdsOrder(SMDSAbs_EntityType smdsType);
  static const std::vector<int>& interlacedSmdsOrder(SMDSAbs_EntityType smdsType);

Best Regards,

Vico

Quick reply
URLs will be automatically hyperlinked. Basic HTML tags are OK.
Powered by Ploneboard
History
Activate by vico on Sep 19, 2016 02:48 PM
Document Actions