Goddard-Fortran-Ecosystem / pFlogger

A parallel Fortran logger (based on the design of the Python logger)
Other
18 stars 8 forks source link

Feature/shared resources #36

Closed weiyuan-jiang closed 4 years ago

weiyuan-jiang commented 4 years ago

Move shared resource to LoggerManager and free resources through LoggerManager instead of through individual logger

tclune commented 4 years ago

The other change to this PR that somehow did not make it into the review:

We need two types of Handler containers. The first uses ALLOCATABLE (as per the original code), and the other uses POINTER (as per how this PR has done it). LoggerManager should have a HandlerVector, and Logger's should have HandlerPtrVector's.

This will prevent a memory leak when the LoggerManager goes out of scope.

weiyuan-jiang commented 4 years ago

LoggerManager has a handleMap which uses allocatable. So We don't need to worry about it.

weiyuan-jiang commented 4 years ago

@tclune I have made some minor changes and tested it with the logging.yaml posted by Ben. It works.