Skip to content
Snippets Groups Projects
Commit 70e2beed authored by Luca Tornatore's avatar Luca Tornatore
Browse files

update

parent 9b33dab8
No related branches found
No related tags found
No related merge requests found
...@@ -605,7 +605,7 @@ int main( int argc, char **argv ) ...@@ -605,7 +605,7 @@ int main( int argc, char **argv )
unsigned int N = (argc > 2 ? atoi(*(argv+2)) : 1000000 ); unsigned int N = (argc > 2 ? atoi(*(argv+2)) : 1000000 );
long int seed = (argc > 3 ? atoi(*(argv+3)) : -1 ); // set the seed for repeatible runs long int seed = (argc > 3 ? atoi(*(argv+3)) : -1 ); // set the seed for repeatible runs
int Nrepetitions= (argc > 4 ? atoi(*(argv+4)) : NREPETITIONS ); 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 ); int from_file = ( case_to_run > 0 );
case_to_run = (case_to_run < 0 ? -case_to_run : case_to_run); // make it positive 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 ) ...@@ -658,8 +658,6 @@ int main( int argc, char **argv )
" > Vectors are %lu bytes long, %d double long\n", " > Vectors are %lu bytes long, %d double long\n",
case_to_run, implementation_labels[case_to_run], N, Nrepetitions, case_to_run, implementation_labels[case_to_run], N, Nrepetitions,
VSIZE, DVSIZE); VSIZE, DVSIZE);
if ( dry_run )
printf(" >>> DRY RUN :: use to estimate ops outside the actual calculations\n" );
if ( case_to_run > 0 ) if ( case_to_run > 0 )
...@@ -739,9 +737,6 @@ int main( int argc, char **argv ) ...@@ -739,9 +737,6 @@ int main( int argc, char **argv )
} }
} }
if ( dry_run ) {
printf("dry run: going to clean up\n");
goto clean; }
/* ------------------------------------------------------ /* ------------------------------------------------------
* *
...@@ -947,6 +942,8 @@ int main( int argc, char **argv ) ...@@ -947,6 +942,8 @@ int main( int argc, char **argv )
// pointless calculations // pointless calculations
// //
if ( output_force )
{
char filename[100]; char filename[100];
sprintf( filename, "force2.%d.out", case_to_run ); sprintf( filename, "force2.%d.out", case_to_run );
FILE *output = fopen( filename, "w" ); FILE *output = fopen( filename, "w" );
...@@ -956,14 +953,13 @@ int main( int argc, char **argv ) ...@@ -956,14 +953,13 @@ int main( int argc, char **argv )
fclose(output); } fclose(output); }
else else
printf(">>> wow, I was unable to create a stupid file\n"); printf(">>> wow, I was unable to create a stupid file\n");
}
free ( force ); free ( force );
if ( !dry_run)
free ( ngb_list ); free ( ngb_list );
} }
clean:
if ( mem != NULL ) if ( mem != NULL )
free ( mem ); free ( mem );
if ( mems[0] != NULL ) if ( mems[0] != NULL )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment