diff --git a/LICENSE b/LICENSE index 5f2648f6..f694ad2d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ Copyright (c) 2012-2021 Argonne National Laboratory +Copyright (c) 2021 Inria Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/cuda/XSbench_header.cuh b/cuda/XSbench_header.cuh index 7b96074a..4c646e26 100644 --- a/cuda/XSbench_header.cuh +++ b/cuda/XSbench_header.cuh @@ -59,6 +59,7 @@ typedef struct{ int simulation_method; int binary_mode; int kernel_id; + int user_g; } Inputs; typedef struct{ diff --git a/cuda/io.cu b/cuda/io.cu index ee3f354c..73789f19 100644 --- a/cuda/io.cu +++ b/cuda/io.cu @@ -51,7 +51,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, MPI_SUM, 0, MPI_COMM_WORLD); #endif - int is_invalid_result = 1; + int is_invalid_result = 0; // Print output if( mype == 0 ) @@ -77,6 +77,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, #endif } + int checksum_is_defined = 0; unsigned long long large = 0; unsigned long long small = 0; if( in.simulation_method == EVENT_BASED ) @@ -91,25 +92,35 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, } if( strcmp(in.HM, "large") == 0 ) { - if( vhash == large ) - is_invalid_result = 0; + checksum_is_defined = 1; + if( vhash != large ) + is_invalid_result = 1; } else if( strcmp(in.HM, "small") == 0 ) { - if( vhash == small ) - is_invalid_result = 0; + checksum_is_defined = 1; + if( vhash != small ) + is_invalid_result = 1; + } + if( in.user_g ) + { + checksum_is_defined = 0; } if(mype == 0 ) { - if( is_invalid_result ) - printf("Verification checksum: %llu (WARNING - INAVALID CHECKSUM!)\n", vhash); + if( checksum_is_defined && is_invalid_result ) + printf("Verification checksum: %llu (WARNING - INVALID CHECKSUM!)\n", vhash); + else if( in.user_g ) + printf("WARNING - Unable to verify due to custom size (checksum: %llu)\n", vhash); + else if( !checksum_is_defined ) + printf("WARNING - Unable to verify due to unsupported size (checksum: %llu)\n", vhash); else printf("Verification checksum: %llu (Valid)\n", vhash); border_print(); } - return is_invalid_result; + return checksum_is_defined && is_invalid_result; } void print_inputs(Inputs in, int nprocs, int version ) @@ -266,7 +277,7 @@ Inputs read_CLI( int argc, char * argv[] ) input.HM[5] = '\0'; // Check if user sets these - int user_g = 0; + input.user_g = 0; int default_lookups = 1; int default_particles = 1; @@ -281,7 +292,7 @@ Inputs read_CLI( int argc, char * argv[] ) { if( ++i < argc ) { - user_g = 1; + input.user_g = 1; input.n_gridpoints = atol(argv[i]); } else @@ -290,7 +301,7 @@ Inputs read_CLI( int argc, char * argv[] ) // Simulation Method (-m) else if( strcmp(arg, "-m") == 0 ) { - char * sim_type; + char * sim_type = NULL; if( ++i < argc ) sim_type = argv[i]; else @@ -352,7 +363,7 @@ Inputs read_CLI( int argc, char * argv[] ) // grid type (-G) else if( strcmp(arg, "-G") == 0 ) { - char * grid_type; + char * grid_type = NULL; if( ++i < argc ) grid_type = argv[i]; else @@ -370,7 +381,7 @@ Inputs read_CLI( int argc, char * argv[] ) // binary mode (-b) else if( strcmp(arg, "-b") == 0 ) { - char * binary_mode; + char * binary_mode = NULL; if( ++i < argc ) binary_mode = argv[i]; else @@ -430,9 +441,9 @@ Inputs read_CLI( int argc, char * argv[] ) // (defaults to large) if( strcasecmp(input.HM, "small") == 0 ) input.n_isotopes = 68; - else if( strcasecmp(input.HM, "XL") == 0 && user_g == 0 ) + else if( strcasecmp(input.HM, "XL") == 0 && input.user_g == 0 ) input.n_gridpoints = 238847; // sized to make 120 GB XS data - else if( strcasecmp(input.HM, "XXL") == 0 && user_g == 0 ) + else if( strcasecmp(input.HM, "XXL") == 0 && input.user_g == 0 ) input.n_gridpoints = 238847 * 2.1; // 252 GB XS data // Return input struct diff --git a/opencl/XSbench_header.h b/opencl/XSbench_header.h index b7d5321f..878b7965 100644 --- a/opencl/XSbench_header.h +++ b/opencl/XSbench_header.h @@ -68,6 +68,7 @@ typedef struct{ int simulation_method; int binary_mode; int kernel_id; + int user_g; int platform_id; int device_id; } Inputs; diff --git a/opencl/io.c b/opencl/io.c index 12fcf461..4e87f048 100644 --- a/opencl/io.c +++ b/opencl/io.c @@ -56,7 +56,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, MPI_SUM, 0, MPI_COMM_WORLD); #endif - int is_invalid_result = 1; + int is_invalid_result = 0; // Print output if( mype == 0 ) @@ -88,6 +88,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, #endif } + int checksum_is_defined = 0; unsigned long long large = 0; unsigned long long small = 0; if( in.simulation_method == EVENT_BASED ) @@ -102,25 +103,35 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, } if( in.HM == LARGE ) { - if( vhash == large ) - is_invalid_result = 0; + checksum_is_defined = 1; + if( vhash != large ) + is_invalid_result = 1; } else if( in.HM == SMALL ) { - if( vhash == small ) - is_invalid_result = 0; + checksum_is_defined = 1; + if( vhash != small ) + is_invalid_result = 1; + } + if( in.user_g ) + { + checksum_is_defined = 0; } if(mype == 0 ) { - if( is_invalid_result ) - printf("Verification checksum: %llu (WARNING - INAVALID CHECKSUM!)\n", vhash); + if( checksum_is_defined && is_invalid_result ) + printf("Verification checksum: %llu (WARNING - INVALID CHECKSUM!)\n", vhash); + else if( in.user_g ) + printf("WARNING - Unable to verify due to custom size (checksum: %llu)\n", vhash); + else if( !checksum_is_defined ) + printf("WARNING - Unable to verify due to unsupported size (checksum: %llu)\n", vhash); else printf("Verification checksum: %llu (Valid)\n", vhash); border_print(); } - return is_invalid_result; + return checksum_is_defined && is_invalid_result; } void print_inputs(Inputs in, int nprocs, int version ) @@ -287,7 +298,7 @@ Inputs read_CLI( int argc, char * argv[] ) input.device_id = -1; // Check if user sets these - int user_g = 0; + input.user_g = 0; int default_lookups = 1; int default_particles = 1; @@ -302,7 +313,7 @@ Inputs read_CLI( int argc, char * argv[] ) { if( ++i < argc ) { - user_g = 1; + input.user_g = 1; input.n_gridpoints = atol(argv[i]); } else @@ -311,7 +322,7 @@ Inputs read_CLI( int argc, char * argv[] ) // Simulation Method (-m) else if( strcmp(arg, "-m") == 0 ) { - char * sim_type; + char * sim_type = NULL; if( ++i < argc ) sim_type = argv[i]; else @@ -383,7 +394,7 @@ Inputs read_CLI( int argc, char * argv[] ) // grid type (-G) else if( strcmp(arg, "-G") == 0 ) { - char * grid_type; + char * grid_type = NULL; if( ++i < argc ) grid_type = argv[i]; else @@ -401,7 +412,7 @@ Inputs read_CLI( int argc, char * argv[] ) // binary mode (-b) else if( strcmp(arg, "-b") == 0 ) { - char * binary_mode; + char * binary_mode = NULL; if( ++i < argc ) binary_mode = argv[i]; else @@ -470,9 +481,9 @@ Inputs read_CLI( int argc, char * argv[] ) // (defaults to large) if( input.HM == SMALL ) input.n_isotopes = 68; - else if( input.HM == XL && user_g == 0 ) + else if( input.HM == XL && input.user_g == 0 ) input.n_gridpoints = 238847; // sized to make 120 GB XS data - else if( input.HM == XXL && user_g == 0 ) + else if( input.HM == XXL && input.user_g == 0 ) input.n_gridpoints = 238847 * 2.1; // 252 GB XS data // Return input struct diff --git a/openmp-offload/XSbench_header.h b/openmp-offload/XSbench_header.h index 77f7224d..36f0e4cb 100644 --- a/openmp-offload/XSbench_header.h +++ b/openmp-offload/XSbench_header.h @@ -57,6 +57,7 @@ typedef struct{ int simulation_method; int binary_mode; int kernel_id; + int user_g; } Inputs; typedef struct{ diff --git a/openmp-offload/io.c b/openmp-offload/io.c index 5c981ee8..89df744a 100644 --- a/openmp-offload/io.c +++ b/openmp-offload/io.c @@ -55,7 +55,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, MPI_SUM, 0, MPI_COMM_WORLD); #endif - int is_invalid_result = 1; + int is_invalid_result = 0; // Print output if( mype == 0 ) @@ -81,6 +81,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, #endif } + int checksum_is_defined = 0; unsigned long long large = 0; unsigned long long small = 0; if( in.simulation_method == EVENT_BASED ) @@ -95,25 +96,35 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, } if( strcmp(in.HM, "large") == 0 ) { - if( vhash == large ) - is_invalid_result = 0; + checksum_is_defined = 1; + if( vhash != large ) + is_invalid_result = 1; } else if( strcmp(in.HM, "small") == 0 ) { - if( vhash == small ) - is_invalid_result = 0; + checksum_is_defined = 1; + if( vhash != small ) + is_invalid_result = 1; + } + if( in.user_g ) + { + checksum_is_defined = 0; } if(mype == 0 ) { - if( is_invalid_result ) - printf("Verification checksum: %llu (WARNING - INAVALID CHECKSUM!)\n", vhash); + if( checksum_is_defined && is_invalid_result ) + printf("Verification checksum: %llu (WARNING - INVALID CHECKSUM!)\n", vhash); + else if( in.user_g ) + printf("WARNING - Unable to verify due to custom size (checksum: %llu)\n", vhash); + else if( !checksum_is_defined ) + printf("WARNING - Unable to verify due to unsupported size (checksum: %llu)\n", vhash); else printf("Verification checksum: %llu (Valid)\n", vhash); border_print(); } - return is_invalid_result; + return checksum_is_defined && is_invalid_result; } void print_inputs(Inputs in, int nprocs, int version ) @@ -265,7 +276,7 @@ Inputs read_CLI( int argc, char * argv[] ) input.HM[5] = '\0'; // Check if user sets these - int user_g = 0; + input.user_g = 0; int default_lookups = 1; int default_particles = 1; @@ -280,7 +291,7 @@ Inputs read_CLI( int argc, char * argv[] ) { if( ++i < argc ) { - user_g = 1; + input.user_g = 1; input.n_gridpoints = atol(argv[i]); } else @@ -289,7 +300,7 @@ Inputs read_CLI( int argc, char * argv[] ) // Simulation Method (-m) else if( strcmp(arg, "-m") == 0 ) { - char * sim_type; + char * sim_type = NULL; if( ++i < argc ) sim_type = argv[i]; else @@ -351,7 +362,7 @@ Inputs read_CLI( int argc, char * argv[] ) // grid type (-G) else if( strcmp(arg, "-G") == 0 ) { - char * grid_type; + char * grid_type = NULL; if( ++i < argc ) grid_type = argv[i]; else @@ -369,7 +380,7 @@ Inputs read_CLI( int argc, char * argv[] ) // binary mode (-b) else if( strcmp(arg, "-b") == 0 ) { - char * binary_mode; + char * binary_mode = NULL; if( ++i < argc ) binary_mode = argv[i]; else @@ -429,9 +440,9 @@ Inputs read_CLI( int argc, char * argv[] ) // (defaults to large) if( strcasecmp(input.HM, "small") == 0 ) input.n_isotopes = 68; - else if( strcasecmp(input.HM, "XL") == 0 && user_g == 0 ) + else if( strcasecmp(input.HM, "XL") == 0 && input.user_g == 0 ) input.n_gridpoints = 238847; // sized to make 120 GB XS data - else if( strcasecmp(input.HM, "XXL") == 0 && user_g == 0 ) + else if( strcasecmp(input.HM, "XXL") == 0 && input.user_g == 0 ) input.n_gridpoints = 238847 * 2.1; // 252 GB XS data // Return input struct diff --git a/openmp-threading/XSbench_header.h b/openmp-threading/XSbench_header.h index 230b2a19..962f3752 100644 --- a/openmp-threading/XSbench_header.h +++ b/openmp-threading/XSbench_header.h @@ -67,6 +67,7 @@ typedef struct{ int simulation_method; int binary_mode; int kernel_id; + int user_g; } Inputs; typedef struct{ diff --git a/openmp-threading/io.c b/openmp-threading/io.c index 037f144b..4a677c14 100644 --- a/openmp-threading/io.c +++ b/openmp-threading/io.c @@ -55,7 +55,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, MPI_SUM, 0, MPI_COMM_WORLD); #endif - int is_invalid_result = 1; + int is_invalid_result = 0; // Print output if( mype == 0 ) @@ -82,6 +82,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, #endif } + int checksum_is_defined = 0; unsigned long long large = 0; unsigned long long small = 0; if( in.simulation_method == EVENT_BASED ) @@ -96,25 +97,35 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, } if( strcmp(in.HM, "large") == 0 ) { - if( vhash == large ) - is_invalid_result = 0; + checksum_is_defined = 1; + if( vhash != large ) + is_invalid_result = 1; } else if( strcmp(in.HM, "small") == 0 ) { - if( vhash == small ) - is_invalid_result = 0; + checksum_is_defined = 1; + if( vhash != small ) + is_invalid_result = 1; + } + if( in.user_g ) + { + checksum_is_defined = 0; } if(mype == 0 ) { - if( is_invalid_result ) - printf("Verification checksum: %llu (WARNING - INAVALID CHECKSUM!)\n", vhash); + if( checksum_is_defined && is_invalid_result ) + printf("Verification checksum: %llu (WARNING - INVALID CHECKSUM!)\n", vhash); + else if( in.user_g ) + printf("WARNING - Unable to verify due to custom size (checksum: %llu)\n", vhash); + else if( !checksum_is_defined ) + printf("WARNING - Unable to verify due to unsupported size (checksum: %llu)\n", vhash); else printf("Verification checksum: %llu (Valid)\n", vhash); border_print(); } - return is_invalid_result; + return checksum_is_defined && is_invalid_result; } void print_inputs(Inputs in, int nprocs, int version ) @@ -272,7 +283,7 @@ Inputs read_CLI( int argc, char * argv[] ) input.HM[5] = '\0'; // Check if user sets these - int user_g = 0; + input.user_g = 0; int default_lookups = 1; int default_particles = 1; @@ -295,7 +306,7 @@ Inputs read_CLI( int argc, char * argv[] ) { if( ++i < argc ) { - user_g = 1; + input.user_g = 1; input.n_gridpoints = atol(argv[i]); } else @@ -304,7 +315,7 @@ Inputs read_CLI( int argc, char * argv[] ) // Simulation Method (-m) else if( strcmp(arg, "-m") == 0 ) { - char * sim_type; + char * sim_type = NULL; if( ++i < argc ) sim_type = argv[i]; else @@ -366,7 +377,7 @@ Inputs read_CLI( int argc, char * argv[] ) // grid type (-G) else if( strcmp(arg, "-G") == 0 ) { - char * grid_type; + char * grid_type = NULL; if( ++i < argc ) grid_type = argv[i]; else @@ -384,7 +395,7 @@ Inputs read_CLI( int argc, char * argv[] ) // binary mode (-b) else if( strcmp(arg, "-b") == 0 ) { - char * binary_mode; + char * binary_mode = NULL; if( ++i < argc ) binary_mode = argv[i]; else @@ -444,9 +455,9 @@ Inputs read_CLI( int argc, char * argv[] ) // (defaults to large) if( strcasecmp(input.HM, "small") == 0 ) input.n_isotopes = 68; - else if( strcasecmp(input.HM, "XL") == 0 && user_g == 0 ) + else if( strcasecmp(input.HM, "XL") == 0 && input.user_g == 0 ) input.n_gridpoints = 238847; // sized to make 120 GB XS data - else if( strcasecmp(input.HM, "XXL") == 0 && user_g == 0 ) + else if( strcasecmp(input.HM, "XXL") == 0 && input.user_g == 0 ) input.n_gridpoints = 238847 * 2.1; // 252 GB XS data // Return input struct diff --git a/sycl/XSbench_header.h b/sycl/XSbench_header.h index 8411dd62..e205a2ef 100644 --- a/sycl/XSbench_header.h +++ b/sycl/XSbench_header.h @@ -56,6 +56,7 @@ typedef struct{ int simulation_method; int binary_mode; int kernel_id; + int user_g; } Inputs; typedef struct{ diff --git a/sycl/io.cpp b/sycl/io.cpp index b1ceea03..8ff043bd 100644 --- a/sycl/io.cpp +++ b/sycl/io.cpp @@ -56,7 +56,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, MPI_SUM, 0, MPI_COMM_WORLD); #endif - int is_invalid_result = 1; + int is_invalid_result = 0; // Print output if( mype == 0 ) @@ -87,6 +87,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, #endif } + int checksum_is_defined = 0; unsigned long long large = 0; unsigned long long small = 0; if( in.simulation_method == EVENT_BASED ) @@ -101,25 +102,35 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, } if( strcmp(in.HM, "large") == 0 ) { - if( vhash == large ) - is_invalid_result = 0; + checksum_is_defined = 1; + if( vhash != large ) + is_invalid_result = 1; } else if( strcmp(in.HM, "small") == 0 ) { - if( vhash == small ) - is_invalid_result = 0; + checksum_is_defined = 1; + if( vhash != small ) + is_invalid_result = 1; + } + if( in.user_g ) + { + checksum_is_defined = 0; } if(mype == 0 ) { - if( is_invalid_result ) - printf("Verification checksum: %llu (WARNING - INAVALID CHECKSUM!)\n", vhash); + if( checksum_is_defined && is_invalid_result ) + printf("Verification checksum: %llu (WARNING - INVALID CHECKSUM!)\n", vhash); + else if( in.user_g ) + printf("WARNING - Unable to verify due to custom size (checksum: %llu)\n", vhash); + else if( !checksum_is_defined ) + printf("WARNING - Unable to verify due to unsupported size (checksum: %llu)\n", vhash); else printf("Verification checksum: %llu (Valid)\n", vhash); border_print(); } - return is_invalid_result; + return checksum_is_defined && is_invalid_result; } void print_inputs(Inputs in, int nprocs, int version ) @@ -271,7 +282,7 @@ Inputs read_CLI( int argc, char * argv[] ) input.HM[5] = '\0'; // Check if user sets these - int user_g = 0; + input.user_g = 0; int default_lookups = 1; int default_particles = 1; @@ -286,7 +297,7 @@ Inputs read_CLI( int argc, char * argv[] ) { if( ++i < argc ) { - user_g = 1; + input.user_g = 1; input.n_gridpoints = atol(argv[i]); } else @@ -295,7 +306,7 @@ Inputs read_CLI( int argc, char * argv[] ) // Simulation Method (-m) else if( strcmp(arg, "-m") == 0 ) { - char * sim_type; + char * sim_type = NULL; if( ++i < argc ) sim_type = argv[i]; else @@ -357,7 +368,7 @@ Inputs read_CLI( int argc, char * argv[] ) // grid type (-G) else if( strcmp(arg, "-G") == 0 ) { - char * grid_type; + char * grid_type = NULL; if( ++i < argc ) grid_type = argv[i]; else @@ -375,7 +386,7 @@ Inputs read_CLI( int argc, char * argv[] ) // binary mode (-b) else if( strcmp(arg, "-b") == 0 ) { - char * binary_mode; + char * binary_mode = NULL; if( ++i < argc ) binary_mode = argv[i]; else @@ -435,9 +446,9 @@ Inputs read_CLI( int argc, char * argv[] ) // (defaults to large) if( strcasecmp(input.HM, "small") == 0 ) input.n_isotopes = 68; - else if( strcasecmp(input.HM, "XL") == 0 && user_g == 0 ) + else if( strcasecmp(input.HM, "XL") == 0 && input.user_g == 0 ) input.n_gridpoints = 238847; // sized to make 120 GB XS data - else if( strcasecmp(input.HM, "XXL") == 0 && user_g == 0 ) + else if( strcasecmp(input.HM, "XXL") == 0 && input.user_g == 0 ) input.n_gridpoints = 238847 * 2.1; // 252 GB XS data // Return input struct