time-to-botec/C
2023-11-02 23:52:56 +00:00
..
C-01-simple more work on squiggle_c 2023-06-26 18:44:04 +01:00
C-02-better-algorithm-one-thread savepoint, clean README a bit 2023-09-12 16:47:12 +02:00
out add gavin howard's bc to README 2023-11-02 23:52:56 +00:00
perf savepoint: C perf + readme tweaks 2023-10-15 12:23:26 +01:00
xorshift-scratchpad compare using a struct instead of a pointer, reorg 2023-06-03 10:50:06 -06:00
makefile makefile perf tweak 2023-06-03 11:06:44 -06:00
README.md compare using a struct instead of a pointer, reorg 2023-06-03 10:50:06 -06:00
samples.c Revert "tweak: try using array instead of array of pointers" 2023-06-03 10:56:09 -06:00

Time to BOTEC in C

This repository contains a few implementations of a simple botec (back-of-the-envelope) calculation in C:

  • In the folder C-01-simple/, you can see a simple implementation, which passes large arrays around
  • In the folder C-02-better-algorithm-one-thread/ you can see a better implementations, that passes around pointers to functions, which makes the implementation more efficient
  • The top level samples.c uses the algorithm improvements in C-02..., and also implements multithreading using OpenMP

To do

  • Add Windows/Powershell time-measuring commands
  • Add CUDA?
  • Added results of perf. rand_r seems like a big chunk of it, but I'm hesitant to use lower-quality random numbers
    • used xorshift instead
    • [-] Use xorshift with a struct instead of a pointer? idk, could be faster for some reason? => Tested, it takes the same time.
  • Update repository with correct timing
  • Use better profiling approach to capture timing with 1M samples.
  • See if program can be reworded so as to use multithreading effectively, e.g., so that you see speed gains proportional to the number of threads used