Skip to content

Commit

Permalink
Merge pull request ECP-copa#114 from cz4rs/misc-fixes
Browse files Browse the repository at this point in the history
General updates
  • Loading branch information
streeve authored Sep 9, 2024
2 parents ac331d1 + e97bfac commit 4d673de
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 73 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand Down
43 changes: 23 additions & 20 deletions src/inputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include <system.h>
#include <types.h>

#include <array>
#include <fstream>
#include <vector>

Expand Down Expand Up @@ -149,52 +150,54 @@ template <class t_System>
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<int, 6> box = { 0, 40, 0, 40, 0, 40 };

char *data_file;
int data_file_type;

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<std::vector<std::string>> 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;
Expand Down
46 changes: 1 addition & 45 deletions src/inputFile_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <inputFile.h>
#include <property_temperature.h>

#include <iostream>
#include <algorithm>
#include <regex>

std::vector<std::string> split( const std::string &line )
Expand All @@ -71,56 +71,12 @@ InputFile<t_System>::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 <class t_System>
Expand Down
4 changes: 0 additions & 4 deletions src/integrator_nve_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ void Integrator<t_System>::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 <class t_System>
Expand All @@ -80,10 +78,8 @@ void Integrator<t_System>::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 <class t_System>
Expand Down

0 comments on commit 4d673de

Please sign in to comment.