From 6093894d7329dff546944e84a0998ba96c337026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Mon, 9 Sep 2024 14:15:29 +0200 Subject: [PATCH 1/3] ci: upgrade Kokkos version --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 98a0ba8..2fc1b12 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,7 +15,7 @@ jobs: cxx: ['g++', 'clang++'] backend: ['SERIAL', 'OPENMP'] cmake_build_type: ['Debug', 'Release'] - kokkos_ver: ['3.7.02'] + kokkos_ver: ['4.3.01'] arborx: ['ArborX', 'NoArborX'] nnp: ['ON', 'OFF'] layout: ['1'] @@ -27,7 +27,7 @@ jobs: cxx: 'g++' openmp: 'ON' cmake_build_type: 'Release' - kokkos_ver: '3.7.02' + kokkos_ver: '4.3.01' arborx: 'NoArborX' nnp: 'OFF' layout: '2' @@ -38,7 +38,7 @@ jobs: cxx: 'g++' openmp: 'ON' cmake_build_type: 'Release' - kokkos_ver: '3.7.02' + kokkos_ver: '4.3.01' arborx: 'NoArborX' nnp: 'ON' layout: '6' @@ -49,7 +49,7 @@ jobs: cxx: 'g++' openmp: 'ON' cmake_build_type: 'Release' - kokkos_ver: '3.7.02' + kokkos_ver: '4.3.01' arborx: 'NoArborX' nnp: 'OFF' layout: '6' From bf9fd6034274362095397319abd7910a8d4decae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Mon, 9 Sep 2024 14:23:23 +0200 Subject: [PATCH 2/3] remove unused variables --- src/integrator_nve_impl.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/integrator_nve_impl.h b/src/integrator_nve_impl.h index 564f4fd..0047456 100644 --- a/src/integrator_nve_impl.h +++ b/src/integrator_nve_impl.h @@ -64,10 +64,8 @@ void Integrator::initial_integrate( t_System *system ) f = system->f; type = system->type; - static int step = 1; Kokkos::parallel_for( "IntegratorNVE::initial_integrate", t_policy_initial( 0, system->N_local ), *this ); - step++; } template @@ -80,10 +78,8 @@ void Integrator::final_integrate( t_System *system ) f = system->f; type = system->type; - static int step = 1; Kokkos::parallel_for( "IntegratorNVE::final_integrate", t_policy_final( 0, system->N_local ), *this ); - step++; } template From e97bfac7466c284338fd4fa7c33e678cb7ad17ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 8 Aug 2024 20:44:36 +0200 Subject: [PATCH 3/3] avoid redundant initialization --- src/inputFile.h | 43 ++++++++++++++++++++++------------------- src/inputFile_impl.h | 46 +------------------------------------------- 2 files changed, 24 insertions(+), 65 deletions(-) diff --git a/src/inputFile.h b/src/inputFile.h index 16e9019..10503eb 100644 --- a/src/inputFile.h +++ b/src/inputFile.h @@ -58,6 +58,7 @@ #include #include +#include #include #include @@ -149,18 +150,20 @@ template class InputFile { private: - bool timestepflag; // input timestep? + bool timestepflag = false; // input timestep? public: InputCL commandline; t_System *system; bool _print_rank; - int units_style; - int lattice_style; - double lattice_constant, lattice_offset_x, lattice_offset_y, - lattice_offset_z; + + // defaults match ExaMiniMD LJ example + int units_style = UNITS_LJ; + int lattice_style = LATTICE_FCC; + double lattice_constant = 0.8442, lattice_offset_x = 0.0, + lattice_offset_y = 0.0, lattice_offset_z = 0.0; int lattice_nx, lattice_ny, lattice_nz; - int box[6]; + std::array box = { 0, 40, 0, 40, 0, 40 }; char *data_file; int data_file_type; @@ -168,33 +171,33 @@ class InputFile std::string output_file; std::string error_file; - double temperature_target; - int temperature_seed; + double temperature_target = 1.4; + int temperature_seed = 87287; - int integrator_type; - int nsteps; + int integrator_type = INTEGRATOR_NVE; + int nsteps = 100; - int binning_type; + int binning_type = BINNING_LINKEDCELL; - int comm_type; - int comm_exchange_rate; + int comm_type = COMM_MPI; + int comm_exchange_rate = 20; - int force_type; + int force_type = FORCE_LJ; int force_iteration_type; int force_neigh_parallel_type; - T_F_FLOAT force_cutoff; + T_F_FLOAT force_cutoff = 2.5; std::vector> force_coeff_lines; - T_F_FLOAT neighbor_skin; - int neighbor_type; - T_INT max_neigh_guess; + T_F_FLOAT neighbor_skin = 0.0; + int neighbor_type = NEIGH_VERLET_2D; + T_INT max_neigh_guess = 50; int layout_type; int nnp_layout_type; - int thermo_rate, dumpbinary_rate, correctness_rate; - bool dumpbinaryflag, correctnessflag; + int thermo_rate = 10, dumpbinary_rate = 0, correctness_rate = 0; + bool dumpbinaryflag = false, correctnessflag = false; char *dumpbinary_path, *reference_path, *correctness_file; std::string input_data_file; std::string output_data_file; diff --git a/src/inputFile_impl.h b/src/inputFile_impl.h index f4edc44..93fcf9b 100644 --- a/src/inputFile_impl.h +++ b/src/inputFile_impl.h @@ -49,7 +49,7 @@ #include #include -#include +#include #include std::vector split( const std::string &line ) @@ -71,56 +71,12 @@ InputFile::InputFile( InputCL commandline_, t_System *system_ ) : commandline( commandline_ ) , system( system_ ) { - comm_type = COMM_MPI; - integrator_type = INTEGRATOR_NVE; - neighbor_type = NEIGH_VERLET_2D; - force_type = FORCE_LJ; - binning_type = BINNING_LINKEDCELL; - neighbor_type = commandline.neighbor_type; force_iteration_type = commandline.force_iteration_type; force_neigh_parallel_type = commandline.force_neigh_parallel_type; output_file = commandline.output_file; error_file = commandline.error_file; - - // set defaults (matches ExaMiniMD LJ example) - - nsteps = 0; - - thermo_rate = 0; - dumpbinary_rate = 0; - correctness_rate = 0; - dumpbinaryflag = false; - correctnessflag = false; - timestepflag = false; - - lattice_offset_x = 0.0; - lattice_offset_y = 0.0; - lattice_offset_z = 0.0; - box[0] = 0; - box[2] = 0; - box[4] = 0; - box[1] = 40; - box[3] = 40; - box[5] = 40; - - units_style = UNITS_LJ; - lattice_style = LATTICE_FCC; - lattice_constant = 0.8442; - - temperature_target = 1.4; - temperature_seed = 87287; - - nsteps = 100; - thermo_rate = 10; - - neighbor_skin = 0.3; - neighbor_skin = 0.0; // for metal and real units - max_neigh_guess = 50; - comm_exchange_rate = 20; - - force_cutoff = 2.5; } template