aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2024-04-25 20:14:07 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2024-04-25 20:14:07 -0400
commit2260c97d1a6f6d66f8e093988cb80db02b1c8b26 (patch)
tree256f7daa1ed79c7af878dd7f9d16de7f69cc2ba9
parent8279af3c8b3916f27067d004e9c6130d03f8359e (diff)
update performance print to show more information
-rw-r--r--README.md6
-rw-r--r--TODO.md6
-rw-r--r--src/fractals.c9
3 files changed, 12 insertions, 9 deletions
diff --git a/README.md b/README.md
index 115197d..fe1db82 100644
--- a/README.md
+++ b/README.md
@@ -24,8 +24,10 @@ If you wish to compile with additional floating point precision, add `-DEXTENDED
### Running
Any version of the program can be used to generate a visualizer compatible `.grid` file.
-All versions of the program support the same command line arguments
-The performance flag outputs information in the format of `<PROGRAM>,<FRACTAL>,<RUNTIME>`.
+All versions of the program support the same command line arguments.
+
+The performance flag outputs information in the format of
+`<PROGRAM>,<FRACTAL>,<HORIZONTAL_SAMPLES>,<VERTICAL_SAMPLES>,<LOWER_REAL>,<LOWER_IMAG>,<UPPER_REAL>,<UPPER_IMAG>,<RUNTIME>`.
Note that the runtime is an average runtime from multiple runs.
The number of runs can be adjusted directly in `src/fractals.c` in `NUM_RUNS` or passed set in `CPPFLAGS` by adding `-DNUM_RUNS=N`
diff --git a/TODO.md b/TODO.md
index a57e378..fa255bd 100644
--- a/TODO.md
+++ b/TODO.md
@@ -6,9 +6,9 @@
* [x] read/write grids to/from file
* [ ] create image with libgd
* [ ] create animation with libgd
-* [ ] code refactor
- * [ ] change functions so that complex_t is passed instead of complex from <complex.h>
- * [ ] store the size of lower_left and upper_right before the values of lower_left and upper_right in the .grid format
+* [x] code refactor
+ * [x] change functions so that complex_t is passed instead of complex from <complex.h>
+ * [x] store the size of lower_left and upper_right before the values of lower_left and upper_right in the .grid format
* [x] write serial
* [x] mandelbrot
* [x] multibrot
diff --git a/src/fractals.c b/src/fractals.c
index 6b4c67a..7f1f605 100644
--- a/src/fractals.c
+++ b/src/fractals.c
@@ -67,7 +67,7 @@ int main(const int argc, char *argv[]) {
bool verbose = false;
bool performance = false;
grid_gen_params* params;
- char* fractal_name;
+ char* fractal_name = "mandelbrot";
fractal_generator generator = mandelbrot_grid;
char* output_filename = "fractal.grid";
@@ -176,13 +176,14 @@ int main(const int argc, char *argv[]) {
zoom_grid(grid, magnification);
}
- // TODO: make additional param to fractals that take these in
-
generator(grid, params);
if(performance){
double time = time_fractal(generator, grid, params);
- printf("%s,%f\n", fractal_name, time);
+ printf("%s,%s,%zu,%zu,"
+ CFORMAT","CFORMAT","CFORMAT","CFORMAT",%f\n",
+ argv[0], fractal_name, x_res, y_res,
+ lower_left.re, lower_left.im, upper_right.re, upper_right.im, time);
}
if(verbose){