voxcraft / voxcraft-sim

a GPU-accelerated voxel-based physics engine
Creative Commons Zero v1.0 Universal
43 stars 10 forks source link

[Bug] If running voxcraft-sim in parallel, the message from voxcraft-sim to vx-node-worker might be interfered with each other #46

Closed liusida closed 3 years ago

liusida commented 3 years ago

Because the way voxcraft-sim passing message to vx-node-worker is to create a file and pass the filename.

But the filename in the ./workspace/locally/ folder is depend only on time, so the filename might be the same for different runs of voxcraft-sim.

Should add additional info to the filename to avoid collision.

liusida commented 3 years ago

https://github.com/voxcraft/voxcraft-sim/blob/master/src/Executables/voxcraft-sim.cpp#L108 Should change this to:

        std::string str_hash_number = std::to_string(std::hash<std::string>{}( input.to_string() ));
        std::string vxt = str_time + "." + str_hash_number + ".vxt";
        std::string vxr = str_time + "." + str_hash_number + ".vxr";

So it will be unique again.