Too many communicators

Description

I have a working fortran code with CGNS Parallel IO.
I am writing many files (1,000's) from one simulation in parallel.
At some point the simulation crashes and I get the following error:

MPIR_Get_contextid_sparse_group(1193): Too many communicators (0/2048 free on this process; ignore_id=0)
Fatal error in PMPI_Comm_dup: Other MPI error, error stack:
PMPI_Comm_dup(175)...................: MPI_Comm_dup(comm=0xc40033f2, new_comm=0x7fff806461c4) failed
PMPI_Comm_dup(160)...................:
MPIR_Comm_dup_impl(55)...............:
MPIR_Comm_copy(1598).................:
MPIR_Get_contextid(825)..............:

Has anyone faced this issue before?
I don't understand why new communicators are created every time I write a file.
I create the MPI communicator once in the beginning of the code.

Thanks,

Tony

Environment

None

Assignee

Unassigned

Reporter

Scot Breitenfeld

Components

Fix versions

Affects versions

Priority

Critical
Configure