Skip to content

bug: same solid.txt filename conflicts with multi-threads run #50

@yunjunz

Description

@yunjunz

A bug found with a solution suggested by @fastice:

I ran into a problem with pysolid.calc_solid_earth_tides_grid().

Basically I am running multiple threads at the same time from the same directory, which means that the individual threads are overwriting or deleting the solid.txt file.

As simple fix so that files from multiple threads would not conflict would be to make the file names unique with something like.

import uuid

txt_file = os.path.abspath(fsolid.{uuid.uuid1().hex}.txt')
if os.path.isfile(txt_file):
  os.remove(txt_file)

No need to change soon on my account, I found a workaround but others might run into a similar problem in a production environment.

This unique TXT filename should be passed to the Fortran code directly as a function argument.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions