voxcraft / voxcraft-sim

a GPU-accelerated voxel-based physics engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

liusida opened this issue · comments

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.

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.