From 83bde5ee52256df82d358094ccd0bfe2981f18a3 Mon Sep 17 00:00:00 2001 From: Clement Foyer Date: Tue, 13 Jul 2021 15:39:38 +0200 Subject: [PATCH 1/4] Fix invalid checksum string --- cuda/io.cu | 2 +- opencl/io.c | 2 +- openmp-offload/io.c | 2 +- openmp-threading/io.c | 2 +- sycl/io.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cuda/io.cu b/cuda/io.cu index ee3f354c..ab78295e 100644 --- a/cuda/io.cu +++ b/cuda/io.cu @@ -103,7 +103,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, if(mype == 0 ) { if( is_invalid_result ) - printf("Verification checksum: %llu (WARNING - INAVALID CHECKSUM!)\n", vhash); + printf("Verification checksum: %llu (WARNING - INVALID CHECKSUM!)\n", vhash); else printf("Verification checksum: %llu (Valid)\n", vhash); border_print(); diff --git a/opencl/io.c b/opencl/io.c index 12fcf461..25e2389d 100644 --- a/opencl/io.c +++ b/opencl/io.c @@ -114,7 +114,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, if(mype == 0 ) { if( is_invalid_result ) - printf("Verification checksum: %llu (WARNING - INAVALID CHECKSUM!)\n", vhash); + printf("Verification checksum: %llu (WARNING - INVALID CHECKSUM!)\n", vhash); else printf("Verification checksum: %llu (Valid)\n", vhash); border_print(); diff --git a/openmp-offload/io.c b/openmp-offload/io.c index 5c981ee8..4b3331ab 100644 --- a/openmp-offload/io.c +++ b/openmp-offload/io.c @@ -107,7 +107,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, if(mype == 0 ) { if( is_invalid_result ) - printf("Verification checksum: %llu (WARNING - INAVALID CHECKSUM!)\n", vhash); + printf("Verification checksum: %llu (WARNING - INVALID CHECKSUM!)\n", vhash); else printf("Verification checksum: %llu (Valid)\n", vhash); border_print(); diff --git a/openmp-threading/io.c b/openmp-threading/io.c index 037f144b..2f60188d 100644 --- a/openmp-threading/io.c +++ b/openmp-threading/io.c @@ -108,7 +108,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, if(mype == 0 ) { if( is_invalid_result ) - printf("Verification checksum: %llu (WARNING - INAVALID CHECKSUM!)\n", vhash); + printf("Verification checksum: %llu (WARNING - INVALID CHECKSUM!)\n", vhash); else printf("Verification checksum: %llu (Valid)\n", vhash); border_print(); diff --git a/sycl/io.cpp b/sycl/io.cpp index b1ceea03..0c898dc6 100644 --- a/sycl/io.cpp +++ b/sycl/io.cpp @@ -113,7 +113,7 @@ int print_results( Inputs in, int mype, double runtime, int nprocs, if(mype == 0 ) { if( is_invalid_result ) - printf("Verification checksum: %llu (WARNING - INAVALID CHECKSUM!)\n", vhash); + printf("Verification checksum: %llu (WARNING - INVALID CHECKSUM!)\n", vhash); else printf("Verification checksum: %llu (Valid)\n", vhash); border_print(); From 6139152063fbf080ae9bc7687749db59ce625a8d Mon Sep 17 00:00:00 2001 From: Clement Foyer Date: Tue, 13 Jul 2021 16:01:12 +0200 Subject: [PATCH 2/4] Silence erroneous warning from intel (uninitialiized variables read) --- cuda/io.cu | 6 +++--- opencl/io.c | 6 +++--- openmp-offload/io.c | 6 +++--- openmp-threading/io.c | 6 +++--- sycl/io.cpp | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cuda/io.cu b/cuda/io.cu index ab78295e..13d7f2f3 100644 --- a/cuda/io.cu +++ b/cuda/io.cu @@ -290,7 +290,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 +352,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 +370,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 diff --git a/opencl/io.c b/opencl/io.c index 25e2389d..eafa1060 100644 --- a/opencl/io.c +++ b/opencl/io.c @@ -311,7 +311,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 +383,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 +401,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 diff --git a/openmp-offload/io.c b/openmp-offload/io.c index 4b3331ab..08510391 100644 --- a/openmp-offload/io.c +++ b/openmp-offload/io.c @@ -289,7 +289,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 +351,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 +369,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 diff --git a/openmp-threading/io.c b/openmp-threading/io.c index 2f60188d..f53144c1 100644 --- a/openmp-threading/io.c +++ b/openmp-threading/io.c @@ -304,7 +304,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 +366,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 +384,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 diff --git a/sycl/io.cpp b/sycl/io.cpp index 0c898dc6..e6cbcc69 100644 --- a/sycl/io.cpp +++ b/sycl/io.cpp @@ -295,7 +295,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 +357,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 +375,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 From cb3979c066bb8f36b1c9fdf66ce390acdf44c75c Mon Sep 17 00:00:00 2001 From: Clement Foyer Date: Tue, 13 Jul 2021 16:09:59 +0200 Subject: [PATCH 3/4] Improve checksum management When the checksum is not defined (hardcoded) the check would be failing everytime the user modifies the number of grid points, or request a size for which the checksum is not known. Not properly managing these cases would result with the application returning a failure for bad checksum. This commit resolves this case by propagating into Input a flag indicating whether the number of grid points has been modified. If the number of points has been modified (even if it stays the same as the default for "small", "large", "XL" or "XXL"), then the checksum comparison result is ignored, a warning is issued, but the application returns a success return code. --- cuda/XSbench_header.cuh | 1 + cuda/io.cu | 33 ++++++++++++++++++++----------- opencl/XSbench_header.h | 1 + opencl/io.c | 33 ++++++++++++++++++++----------- openmp-offload/XSbench_header.h | 1 + openmp-offload/io.c | 33 ++++++++++++++++++++----------- openmp-threading/XSbench_header.h | 1 + openmp-threading/io.c | 33 ++++++++++++++++++++----------- sycl/XSbench_header.h | 1 + sycl/io.cpp | 33 ++++++++++++++++++++----------- 10 files changed, 115 insertions(+), 55 deletions(-) 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 13d7f2f3..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 ) + 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 @@ -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 eafa1060..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 ) + 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 @@ -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 08510391..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 ) + 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 @@ -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 f53144c1..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 ) + 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 @@ -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 e6cbcc69..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 ) + 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 @@ -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 From f799af9454033664094fca7783523f5ce3dea226 Mon Sep 17 00:00:00 2001 From: Clement Foyer Date: Tue, 13 Jul 2021 16:47:19 +0200 Subject: [PATCH 4/4] Update LICENSE file --- LICENSE | 1 + 1 file changed, 1 insertion(+) 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