Menu

Querying regarding multiprocessing in IfcOpenShell.

Somesh
2021-08-16
2021-08-17
  • Somesh

    Somesh - 2021-08-16

    Hello Team,
    I am working on parsing IFC file using IfcOpenShell module of python to get all nodes, relations and properties which I will insert in graph database.

    For fast IFC file parsing I am using multiprocessing in python.
    I have opened the IFC file using below code
    ifc_file = ifcopenshell.open(ifc_path)

    I have filled the list with all the element ids and then divided that list into 8 equal groups (because I have 8 core CPU).
    Then I tried to passing ifc_file object to my multiprocessing methods as argument but is gives me exception that "can't pickle swigpyobject objects".
    To avoid this exception in each process method I have opened the IFC file again using below code.
    ifc_file = ifcopenshell.open(ifc_path)

    This gives me very good results while parsing. But I have two questions
    1. If I open IFC file in each process method the will it give me problem with CPU memory because I have to parse IFC file of size 1 GB ?
    2. Is there any way by which I can avoid "can't pickle swigpyobject objects" exception while passing ifc_file as argument to the multiprocessing method ?

     

Log in to post a comment.