From 70e2beed2252819fd36f132e6cc047c3d8f92351 Mon Sep 17 00:00:00 2001 From: Luca Tornatore <luca.tornatore@inaf.it> Date: Wed, 4 Dec 2024 19:07:21 +0100 Subject: [PATCH] update --- src/vect.2.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/vect.2.c b/src/vect.2.c index a0bfd94..8395a5a 100644 --- a/src/vect.2.c +++ b/src/vect.2.c @@ -605,7 +605,7 @@ int main( int argc, char **argv ) unsigned int N = (argc > 2 ? atoi(*(argv+2)) : 1000000 ); long int seed = (argc > 3 ? atoi(*(argv+3)) : -1 ); // set the seed for repeatible runs int Nrepetitions= (argc > 4 ? atoi(*(argv+4)) : NREPETITIONS ); - int dry_run = (argc > 5 ? atoi(*(argv+5)) : 0 ); // 1 to estimate floats for initialization + int output_force= (argc > 5 ? atoi(*(argv+5)) : 0 ); // 1 to estimate floats for initialization int from_file = ( case_to_run > 0 ); case_to_run = (case_to_run < 0 ? -case_to_run : case_to_run); // make it positive @@ -658,8 +658,6 @@ int main( int argc, char **argv ) " > Vectors are %lu bytes long, %d double long\n", case_to_run, implementation_labels[case_to_run], N, Nrepetitions, VSIZE, DVSIZE); - if ( dry_run ) - printf(" >>> DRY RUN :: use to estimate ops outside the actual calculations\n" ); if ( case_to_run > 0 ) @@ -739,9 +737,6 @@ int main( int argc, char **argv ) } } - if ( dry_run ) { - printf("dry run: going to clean up\n"); - goto clean; } /* ------------------------------------------------------ * @@ -947,23 +942,24 @@ int main( int argc, char **argv ) // pointless calculations // - char filename[100]; - sprintf( filename, "force2.%d.out", case_to_run ); - FILE *output = fopen( filename, "w" ); - if( output != NULL ) { - fwrite( &N, sizeof(int), 1, output); - fwrite( force, sizeof(double), N, output ); - fclose(output); } - else - printf(">>> wow, I was unable to create a stupid file\n"); + if ( output_force ) + { + char filename[100]; + sprintf( filename, "force2.%d.out", case_to_run ); + FILE *output = fopen( filename, "w" ); + if( output != NULL ) { + fwrite( &N, sizeof(int), 1, output); + fwrite( force, sizeof(double), N, output ); + fclose(output); } + else + printf(">>> wow, I was unable to create a stupid file\n"); + } free ( force ); - if ( !dry_run) - free ( ngb_list ); + free ( ngb_list ); } - clean: if ( mem != NULL ) free ( mem ); if ( mems[0] != NULL ) -- GitLab