2. The only problem is the time it takes to open a large file to write one line. That's why everything was so slow. With a table, even just with an Int *var array, everything happens much faster. I accumulated 1024 points, opened the file and wrote it down, and so on in a circle. There you just need to add a counter and conditions, rewrite the File2save() function. But I have already rewritten it, which I advise you to do as well. I agree this will take some time. Github has not been updated.
After these changes, the speed increased.
3. The periods for preserving the working herd of kangaroos are set once every 10 minutes. Flags are set based on the timer, and based on the presence of flags, data from the GPU is uploaded to the array. Next, they are written from the array to the work file. Function SaveWorkKangaroosToFile(). And when the program is restarted, on the contrary, the start keys are not generated, but are unloaded from the file. Function LoadWorkKangaroosFromFile().
4. Text files provide an advantage, since you do not need to process a large table with data every time. The table is cleared - this is also time. And the array can simply be rewritten. There is a difference? I saved a small file and spat it out to the server via a socket.
I already tried all these steps. Some physical maximum is around 600 Mkeys - if you manage to hack the CUDA kernel (+GPU BIOS modding) we will probably reach 1000-1200 Mkeys as stated by the Philosopher.
I think more and more that we need a very fast (predefined?) database(via unix socket) - instead of text files.
Has anyone tried to make Kangaroo in PHP?
Just thoughts from my notes:
Create a MySQL database that will store the data for the tame and wild herds.
Create tables to store the data, with appropriate fields such as 'x' and 'y' for points.
Create a PHP script that connects to the MySQL database and performs the required operations.
Use PHP's mysqli or PDO to establish a connection to your MySQL database.
Create a PHP class similar to the 'Point' class in the code to represent points on the elliptic curve.
Translate the mathematical functions egcd, rev, mul2, add, mulk, X2Y*(or whatever you call them), and check into PHP.
Replace specific libraries or functions with their PHP equivalents.
Modify the file reading/writing functions to interact with your MySQL database.
Replace file I/O operations with database query and update operations.
Use PHP's rand() or random_int() to generate random numbers.
Define the constants (modulo, order, Gx, Gy, etc.) in your PHP script.
Modify the output to store results or print information as needed. etc...
Share a Kangaroo MySQL database across the globe. (Peer-to-Peer)