New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows setup guide, Windows & Linux Compile scripts and RAM drive optimisation #1
Comments
Windows Install Guide for RUST
|
RUST compile script for Windows - Windows batch file ` REM debug switch REM --- REM Setup the CPU optimisation variables REM set EXTRA_RUSTFLAGS=--C target-cpu=native --C opt-level=3 --C lto=yes --C codegen-units=1 --C embed-bitcode=yes REM Setup the compile working area - folder of the script set tmpdir=%cd%\prof-work REM Point RUST profile output to the working area set RUSTFLAGS=-Cprofile-generate=%tmpdir% %EXTRA_RUSTFLAGS% REM debug check variables pause :skipdebug1 REM compile the code cargo build --release --target=x86_64-pc-windows-msvc REM Now run the compiled code to generate the raw profile of the CPU environment %CD%\target\x86_64-pc-windows-msvc\release\polycubes 12 REM merge/convert the raw profile to optimisation format llvm-profdata merge -o %tmpdir%\merged.profdata %tmpdir% REM set the compile optimiser to use the formatted profile data set RUSTFLAGS=-Cprofile-use=%tmpdir%\merged.profdata %EXTRA_RUSTFLAGS% REM Rebuild the code for final use cargo build --release --target=x86_64-pc-windows-msvc IF %scriptdebug%==0 goto skipdebug5 REM clean the working area |
RUST compile script for Linux save as something like "optimize_v3.sh" ` EXTRA_RUSTFLAGS="--C target-cpu=native --C opt-level=3 --C lto=yes --C embed-bitcode=y --C codegen-units=1 --C code-model=small --C debuginfo=0" tmpdir=$(mktemp -d) RUSTFLAGS="-Cprofile-generate=$tmpdir $EXTRA_RUSTFLAGS" cargo build --release --target=x86_64-unknown-linux-gnu ./target/x86_64-unknown-linux-gnu/release/polycubes 11 8 llvm-profdata merge -o "$tmpdir/merged.profdata" "$tmpdir" RUSTFLAGS="-Cprofile-use=$tmpdir/merged.profdata $EXTRA_RUSTFLAGS" cargo build --release --target=x86_64-unknown-linux-gnu rm -rf "$tmpdir" ` |
RUST optimisation for working with a RAM disk on LINUX Ensure there is a decent amount of memory - 4GB may be a normal amount... Next create a new shell script in the folder to Create the ram disk... ` if [ ! -d /tmp/ramdisk ]; then mount | awk '{if ($3 == "/tmp/ramdisk") { exit 0}} ENDFILE{exit -1}' || mount -t tmpfs -o size=4G myramdisk /tmp/ramdisk rsync -ravz --exclude 'target' * /tmp/ramdisk ` Next change to the ramdisk folder - "cd /tmp/ramdisk" you can then run the compiled exe with "/tmp/ramdisk/target/x86_64-unknown-linux-gnu/release/polycubes 12" changing the 12 to be the cube itterations |
This is great! Sorry I couldn't get back to you sooner, I wasn't expecting to get any activity on this project after a while. I'm getting between a 15 and 20% performance improvement, which is pretty significant compared to the 5% improvements I was chasing towards the end of this project. If I had had this earlier, I could have shaved 3 days off my 17 day run, so this is essential for anyone who wants to try n = 20. I've made this PR (#2) using your guide to create 2 build scripts, similar to how @dzamlo has it in his repo. They're mostly the same as your linux optimize_v3.sh, but I made some small modifications and set it up to compile the client as well since that's needed for the distributed system. Unfortunately, I don't have a windows machine on hand to test the windows version, but I've added a link to your guide in case anyone wants to use this on windows. Sorry again for keeping you waiting for so long. I'll merge the PR in a few days, so let me know if there are any problems! |
No need to apologize! And thanks for giving me the credit. I have only expanded on the excellent and interesting work done by yourself and @dzamlo I came to this project quite late in the day and wasn't expecting much, if any, movement. I only picked up on it to start to learn some of the newer programming languages like Python and Rust. I really appreciate you picking it up and then expanding on it even more. Once I get my head around your distributed system processes I will see if I can bundle in any optimizations from using a ram disk for the client and/or server components. (if possible) As well as try and understand the multi-threading you have set up. Not that there is anything wrong with your code. Exactly the opposite. Your code and this project as a whole is how I am learning. |
Not actually issues. Just proposing some enhancements...
Following on from Mike Pounds Opencube project and expanding on your RUST work as well as Loïc Damien's RUST compile shell script I have created a few updates for your review...
Project References
02.01 Mike references other projects
03.01 Loïc References other projects
03.02 Includes shell script for processor optimisation compilation
04.01 pb4j references other contributors projects
Below are 4 sections...
The text was updated successfully, but these errors were encountered: