Parallel error when generating mesh

I encountered a warning while trying to generate a mesh in parallel. The warning message is as follows:
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 13 Broken Pipe: Likely while reading or writing to a socket
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see FAQ — PETSc 3.21.1 documentation and FAQ — PETSc 3.21.1 documentation
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
Abort(59) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0

I was hoping to use MPI.COMM_SELF to avoid the error, but it doesn’t seem to be working. Is my understanding incorrect? The details of my code are as follows:

def gen_once(vertices,freq,grid_size,if_poisson,sample_num):
datagenerator = ConstantCoeffEqu(num_vertices=vertices, num_freq=freq,grid_size=grid_size)
for i in range(sample_num):
if if_poisson:
data = datagenerator.poisson()
else:
data = datagenerator.constant_elliptic()
to_pop_list = [‘points0’,‘points1’,‘cell’]
for key in to_pop_list:
data.pop(key)
datalist.append(data)
logging.info(f’num_point: {vertices:2d}, freq: {freq}, sample_num: {sample_num:3d}, sample_id: {i:3d}')
datainfo.append([vertices,freq,if_poisson,i])

with ProcessPoolExecutor(max_workers=num_worker) as executor:
futures =
for if_poisson in [True,False]:
for vertices in [4,6,8,10,12]:
for freq in [2,3,4,5,6]:
future = executor.submit(gen_once,vertices,freq,grid_size,if_poisson,sample_num)
futures.append(future)

for future in futures:
    future.result()

    msh = mesh.create_mesh(
            comm = MPI.COMM_SELF,
            cells = self.mesh_generator.mesh.cells_dict["triangle"],
            x = self.mesh_generator.mesh.points,
            e = ufl.Mesh(basix.ufl.element("Lagrange", 'triangle', 1, shape=(2,), dtype=np.float64))
        )

Read Read before posting: How do I get my question answered?. In particular: information on how you installed dolfinx may be relevant here, the code is incomplete, the code is badly formatted.