diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..606e334 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,81 @@ +cmake_minimum_required(VERSION 3.12) +project(minimd) + +add_executable(minimd) + # Require C++14 +if (CMAKE_CXX_COMPILER MATCHES ".*nvcc_wrapper" ) + message("nvcc wrapper requires that CXX standard by set in kokkos build") +else() + target_compile_features(minimd PUBLIC cxx_std_14) +endif() + +# Options +option(MINIMD_SINGLE_PRECISION, "Use single precision" OFF) +if (MINIMD_SINGLE_PRECISION) + target_compile_definitions(minimd PRIVATE PRECISION=1) +else() + target_compile_definitions(minimd PRIVATE PRECISION=2) +endif() + +option(MINIMD_AUTOMATIC_CHECKPOINT "Use resilience automatic checkpointing" OFF) +option(MINIMD_MANUAL_CHECKPOINT "Use resilience manual checkpointing" OFF) + +target_compile_definitions(minimd PRIVATE PREC_TIMER) + +# Dependencies +if (MINIMD_USE_MPISTUB) + find_library( mpi_stub_ NAMES libmpi_stubs.a libmpi_stubs mpi_stubs HINTS ${PROJECT_SOURCE_DIR}/kokkos/MPI-Stubs ) + #add_library(mpi_stubs) + #target_link_libraries(minimd PRIVATE mpi_stubs) + target_link_libraries(minimd PRIVATE ${mpi_stub_}) + target_include_directories(minimd PUBLIC + ${PROJECT_SOURCE_DIR}/kokkos/MPI-Stubs + ) +else() + find_package(MPI REQUIRED) + target_link_libraries(minimd PRIVATE MPI::MPI_CXX) +endif() + +find_package(Kokkos REQUIRED NO_CMAKE_PACKAGE_REGISTRY) + +# Optional resilience +if(MINIMD_AUTOMATIC_CHECKPOINT OR MINIMD_MANUAL_CHECKPOINT OR MINIMD_RESILIENT_EXECUTION) + find_package(resilience REQUIRED) + target_link_libraries(minimd PRIVATE Kokkos::resilience) + target_compile_definitions(minimd PRIVATE MINIMD_RESILIENCE) + if(MINIMD_AUTOMATIC_CHECKPOINT) + target_compile_definitions(minimd PRIVATE KOKKOS_ENABLE_AUTOMATIC_CHECKPOINT) + endif() + if(MINIMD_MANUAL_CHECKPOINT) + target_compile_definitions(minimd PRIVATE KOKKOS_ENABLE_MANUAL_CHECKPOINT) + endif() + if(MINIMD_RESILIENT_EXECUTION) + target_compile_definitions(minimd PRIVATE KOKKOS_ENABLE_RESILIENT_EXECUTION) + endif() +endif() + +TARGET_LINK_KOKKOS(minimd PRIVATE) + +target_link_libraries(minimd PRIVATE "-L${resilience_LINK_DIRECTORIES}") + +# VeloC config +add_custom_command(TARGET minimd PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/minimd.cfg ${CMAKE_CURRENT_BINARY_DIR}/minimd.cfg) + +# Other inputs + +add_custom_command(TARGET minimd PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/kokkos/in.lj.miniMD ${CMAKE_CURRENT_BINARY_DIR}/in.lj.miniMD) + +add_custom_command(TARGET minimd PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/kokkos/Cu_u6.eam ${CMAKE_CURRENT_BINARY_DIR}/Cu_u6.eam) + +add_subdirectory(kokkos) + + +##get_cmake_property(_variableNames VARIABLES) +##list (SORT _variableNames) +##foreach (_variableName ${_variableNames}) +## message(STATUS "${_variableName}=${${_variableName}}") +##endforeach() + diff --git a/kokkos/CMakeLists.txt b/kokkos/CMakeLists.txt new file mode 100644 index 0000000..8a753d5 --- /dev/null +++ b/kokkos/CMakeLists.txt @@ -0,0 +1,14 @@ +target_sources(minimd PRIVATE + ${PROJECT_SOURCE_DIR}/kokkos/atom.cpp + ${PROJECT_SOURCE_DIR}/kokkos/comm.cpp + ${PROJECT_SOURCE_DIR}/kokkos/force_eam.cpp + ${PROJECT_SOURCE_DIR}/kokkos/force_lj.cpp + ${PROJECT_SOURCE_DIR}/kokkos/input.cpp + ${PROJECT_SOURCE_DIR}/kokkos/integrate.cpp + ${PROJECT_SOURCE_DIR}/kokkos/ljs.cpp + ${PROJECT_SOURCE_DIR}/kokkos/neighbor.cpp + ${PROJECT_SOURCE_DIR}/kokkos/output.cpp + ${PROJECT_SOURCE_DIR}/kokkos/setup.cpp + ${PROJECT_SOURCE_DIR}/kokkos/thermo.cpp + ${PROJECT_SOURCE_DIR}/kokkos/timer.cpp + ) diff --git a/kokkos/Makefile b/kokkos/Makefile index bfa8684..8e57fa9 100644 --- a/kokkos/Makefile +++ b/kokkos/Makefile @@ -4,20 +4,36 @@ MPI_PATH = HAVE_MPI = yes #Set the path to Kokkos -KOKKOS_PATH = /home/crtrott/kokkos +#KOKKOS_PATH = /home/crtrott/kokkos #Set the Devices to compile for KOKKOS_DEVICES=OpenMP #Set the Architecture to compiler for -KOKKOS_ARCH=SNB +KOKKOS_ARCH= #Set third party library usage KOKKOS_USE_TPL= +KOKKOS_OPTIONS=enable_hdf5_parallel -CXXFLAGS = -O3 -g -LINKFLAGS = +CXXFLAGS = -O3 -g +##LINKFLAGS = -lm -L./ --std=c++11 +LINKFLAGS = -L./ --std=c++11 LIB = +FILE_EXTENSION=base + +ifeq ($(KOKKOS_OPTIONS), enable_stdfile) + FILE_EXTENSION=stdfile +endif +ifeq ($(KOKKOS_OPTIONS), enable_hdf5) + FILE_EXTENSION=hdf5ser +endif +ifeq ($(KOKKOS_OPTIONS), enable_hdf5_parallel) + FILE_EXTENSION=hdf5par +endif + ifeq ($(HAVE_MPI), yes) +##CXX = $(KOKKOS_PATH)/bin/nvcc_wrapper CXX = mpicxx +LIB += -lmpi else CXX = g++ override CXXFLAGS += -I./MPI-Stubs @@ -25,7 +41,7 @@ LIB += MPI-Stubs/libmpi_stubs.a endif LINK = ${CXX} -EXE = miniMD +EXE = miniMD.${FILE_EXTENSION} #CXXFLAGS += -DTEST_LAMBDA_BYCOPY #CXXFLAGS += -DTEST_LAMBDA_BYPTR @@ -75,6 +91,7 @@ default: all MAKEFILE_PATH := $(subst Makefile,,$(abspath $(lastword $(MAKEFILE_LIST)))) include $(KOKKOS_PATH)/Makefile.kokkos +include $(KOKKOS_RESILIENCE_PATH)/Makefile.resilience SRC = $(wildcard $(MAKEFILE_PATH)*.cpp) HEADERS = $(wildcard $(MAKEFILE_PATH)*.hpp) diff --git a/kokkos/atom.cpp b/kokkos/atom.cpp index f5da0c0..d3181a6 100644 --- a/kokkos/atom.cpp +++ b/kokkos/atom.cpp @@ -36,9 +36,14 @@ #include "atom.h" #include "neighbor.h" -#define DELTA 20000 +int Atom::atom_block = 10000; -Atom::Atom(int ntypes_) +void Atom::set_atom_block_size(int size_) +{ + atom_block = size_; +} + +Atom::Atom(int ntypes_) : x("atom",0), v("velocity",0), f("force",0) { natoms = 0; nlocal = 0; @@ -61,7 +66,9 @@ Atom::~Atom() void Atom::growarray() { - nmax += DELTA; +// printf("grow array: %ld\n", nmax); +// fflush(stdout); + nmax += atom_block; Kokkos::resize(x,nmax); Kokkos::resize(v,nmax); Kokkos::resize(f,nmax); diff --git a/kokkos/atom.h b/kokkos/atom.h index ce2d370..b874dda 100644 --- a/kokkos/atom.h +++ b/kokkos/atom.h @@ -57,6 +57,9 @@ class Atom struct TagAtomUnpackReverse {}; struct TagAtomSort {}; + static int atom_block; + static void set_atom_block_size(int size_); + typedef int value_type; int natoms; int nlocal, nghost; @@ -82,7 +85,7 @@ class Atom Box box; - Atom() {}; + Atom() : x("atom",0), v("velocity",0), f("force",0) {}; Atom(int ntypes_); ~Atom(); diff --git a/kokkos/data/hdf5_config.json b/kokkos/data/hdf5_config.json new file mode 100644 index 0000000..b33bd49 --- /dev/null +++ b/kokkos/data/hdf5_config.json @@ -0,0 +1,59 @@ +[ + { + "name":"atom", + "Layout_Config":{ + "data_set":"atom_dataset", + "rank":2, + "layout":"REGULAR", + "data_extents":["{DATA_SIZE}","{MPI_SIZE}"], + "local_extents":["{DATA_SIZE}","1"], + "offset":["0","{MPI_RANK}"], + "stride":["1","{MPI_SIZE}"], + "count":["1","1","1","1"], + "block":["{DATA_SIZE}","1"], + "local_offset":["0","0","0","0"], + "local_stride":["1","1","1","1"], + "local_count":["1","1","1","1"], + "local_block":["{DATA_SIZE}","1","1","1"], + "view_offset":["0","0"] + } + }, + { + "name":"velocity", + "Layout_Config":{ + "data_set":"velocity_dataset", + "rank":2, + "layout":"REGULAR", + "data_extents":["{DATA_SIZE}","{MPI_SIZE}"], + "local_extents":["{DATA_SIZE}","1"], + "offset":["0","{MPI_RANK}"], + "stride":["1","{MPI_SIZE}"], + "count":["1","1","1","1"], + "block":["{DATA_SIZE}","1"], + "local_offset":["0","0","0","0"], + "local_stride":["1","1","1","1"], + "local_count":["1","1","1","1"], + "local_block":["{DATA_SIZE}","1","1","1"], + "view_offset":["0","0"] + } + }, + { + "name":"force", + "Layout_Config":{ + "data_set":"force_dataset", + "rank":2, + "layout":"REGULAR", + "data_extents":["{DATA_SIZE}","{MPI_SIZE}"], + "local_extents":["{DATA_SIZE}","1"], + "offset":["0","{MPI_RANK}"], + "stride":["1","{MPI_SIZE}"], + "count":["1","1","1","1"], + "block":["{DATA_SIZE}","1"], + "local_offset":["0","0","0","0"], + "local_stride":["1","1","1","1"], + "local_count":["1","1","1","1"], + "local_block":["{DATA_SIZE}","1","1","1"], + "view_offset":["0","0"] + } + } +] diff --git a/kokkos/integrate.cpp b/kokkos/integrate.cpp index 8a3aea8..76d48f5 100644 --- a/kokkos/integrate.cpp +++ b/kokkos/integrate.cpp @@ -33,6 +33,27 @@ #include "stdio.h" #include "integrate.h" #include "math.h" +#include + +#ifdef KOKKOS_ENABLE_HDF5 + #define CHECKPOINT_FILESPACE Kokkos::Experimental::HDF5Space +#else + #define CHECKPOINT_FILESPACE Kokkos::Experimental::StdFileSpace +#endif + +#ifdef MINIMD_RESILIENCE + #include +#endif + +#ifdef KOKKOS_ENABLE_RESILIENT_EXECUTION + #define DEVICE_EXECUTION_SPACE Kokkos::ResCuda +#else + #ifdef KOKKOS_ENABLE_CUDA + #define DEVICE_EXECUTION_SPACE Kokkos::Cuda + #else + #define DEVICE_EXECUTION_SPACE Kokkos::OpenMP + #endif +#endif Integrate::Integrate() {sort_every=20;} Integrate::~Integrate() {} @@ -44,7 +65,7 @@ void Integrate::setup() void Integrate::initialIntegrate() { - Kokkos::parallel_for(Kokkos::RangePolicy(0,nlocal), *this); + Kokkos::parallel_for(Kokkos::RangePolicy(0,nlocal), *this); } KOKKOS_INLINE_FUNCTION @@ -59,7 +80,7 @@ void Integrate::operator() (TagInitialIntegrate, const int& i) const { void Integrate::finalIntegrate() { - Kokkos::parallel_for(Kokkos::RangePolicy(0,nlocal), *this); + Kokkos::parallel_for(Kokkos::RangePolicy(0,nlocal), *this); } KOKKOS_INLINE_FUNCTION @@ -70,7 +91,7 @@ void Integrate::operator() (TagFinalIntegrate, const int& i) const { } void Integrate::run(Atom &atom, Force* force, Neighbor &neighbor, - Comm &comm, Thermo &thermo, Timer &timer) + Comm &comm, Thermo &thermo, Timer &timer, const int restart_) { int i, n; @@ -83,8 +104,32 @@ void Integrate::run(Atom &atom, Force* force, Neighbor &neighbor, dtforce = dtforce / mass; int next_sort = sort_every>0?sort_every:ntimes+1; + int nStart = 0; + +#ifdef KOKKOS_ENABLE_MANUAL_CHECKPOINT + Kokkos::Experimental::StdFileSpace sfs; + auto x_cp = Kokkos::create_chkpt_mirror( sfs, atom.x ); + auto v_cp = Kokkos::create_chkpt_mirror( sfs, atom.v ); + auto f_cp = Kokkos::create_chkpt_mirror( sfs, atom.f ); + nStart = restart_; + +// Load from restart ... + if (nStart > 0) { + if (comm.nprocs > 1) + Kokkos::Experimental::DirectoryManager::set_checkpoint_directory(comm.me == 0 ? true : false, "./data", (int)((nStart / 10) * 10)); + else + Kokkos::Experimental::DirectoryManager::set_checkpoint_directory(comm.me == 0 ? true : false, "./data", (int)((nStart / 10) * 10), comm.me); + // need to resize the views to match the checkpoint files ... + Kokkos::Experimental::StdFileSpace::restore_all_views(); + } +#endif - for(n = 0; n < ntimes; n++) { + for(n = nStart; n < ntimes; n++) { +#ifdef KOKKOS_ENABLE_AUTOMATIC_CHECKPOINT + #ifdef KR_ENABLE_TRACING + auto iter_time = KokkosResilience::Util::begin_trace< KokkosResilience::Util::IterTimingTrace< std::string > >( *resilience_context, "step", n ); + #endif +#endif Kokkos::fence(); @@ -94,7 +139,13 @@ void Integrate::run(Atom &atom, Force* force, Neighbor &neighbor, xold = atom.xold; nlocal = atom.nlocal; +#ifdef KOKKOS_ENABLE_AUTOMATIC_CHECKPOINT + KokkosResilience::checkpoint( *resilience_context, "initial", n, [self = *this]() mutable { + self.initialIntegrate(); + }, KokkosResilience::filter::nth_iteration_filter< 10 >{} ); +#else initialIntegrate(); +#endif timer.stamp(); @@ -179,8 +230,24 @@ void Integrate::run(Atom &atom, Force* force, Neighbor &neighbor, Kokkos::fence(); +#ifdef KOKKOS_ENABLE_AUTOMATIC_CHECKPOINT + KokkosResilience::checkpoint( *resilience_context, "final", n, [self = *this]() mutable { + self.finalIntegrate(); + }, KokkosResilience::filter::nth_iteration_filter< 10 >{} ); +#else finalIntegrate(); +#endif if(thermo.nstat) thermo.compute(n + 1, atom, neighbor, force, timer, comm); +#ifdef KOKKOS_ENABLE_MANUAL_CHECKPOINT + if ( n % 10 == 0 ) { + Kokkos::fence(); + if (comm.nprocs > 1) + Kokkos::Experimental::DirectoryManager::set_checkpoint_directory(comm.me == 0 ? true : false, "./data", n); + else + Kokkos::Experimental::DirectoryManager::set_checkpoint_directory(comm.me == 0 ? true : false, "./data", n, comm.me); + CHECKPOINT_FILESPACE::checkpoint_views(); + } +#endif } } diff --git a/kokkos/integrate.h b/kokkos/integrate.h index 934a5f3..751f063 100644 --- a/kokkos/integrate.h +++ b/kokkos/integrate.h @@ -61,5 +61,5 @@ class Integrate void finalIntegrate(); KOKKOS_INLINE_FUNCTION void operator() (TagFinalIntegrate, const int& i) const; - void run(Atom &, Force*, Neighbor &, Comm &, Thermo &, Timer &); + void run(Atom &, Force*, Neighbor &, Comm &, Thermo &, Timer &, const int); }; diff --git a/kokkos/ljs.cpp b/kokkos/ljs.cpp index 3870ae3..b395a83 100644 --- a/kokkos/ljs.cpp +++ b/kokkos/ljs.cpp @@ -56,6 +56,14 @@ void output(In &, Atom &, Force*, Neighbor &, Comm &, Thermo &, Integrate &, Timer &, int); int read_lammps_data(Atom &atom, Comm &comm, Neighbor &neighbor, Integrate &integrate, Thermo &thermo, char* file, int units); +#ifdef KOKKOS_ENABLE_AUTOMATIC_CHECKPOINT + #ifdef KOKKOS_ENABLE_VELOC + std::unique_ptr< KokkosResilience::Context< KokkosResilience::VeloCCheckpointBackend > > resilience_context; + #else + std::unique_ptr< KokkosResilience::Context< > > resilience_context; + #endif +#endif + int main(int argc, char** argv) { In in; @@ -84,6 +92,7 @@ int main(int argc, char** argv) int sort = -1; int ntypes = 8; int team_neigh = 0; + int restart = 0; for(int i = 0; i < argc; i++) { if((strcmp(argv[i], "-i") == 0) || (strcmp(argv[i], "--input_file") == 0)) { @@ -95,7 +104,15 @@ int main(int argc, char** argv) MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &me); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - + +#ifdef KOKKOS_ENABLE_AUTOMATIC_CHECKPOINT + #ifdef KOKKOS_ENABLE_VELOC + resilience_context = std::make_unique< KokkosResilience::Context< KokkosResilience::VeloCCheckpointBackend > >(MPI_COMM_WORLD, "minimd.cfg"); + #else + resilience_context = std::make_unique< KokkosResilience::Context< > >(); + #endif +#endif + int error = 0; if(input_file == NULL) @@ -136,6 +153,11 @@ int main(int argc, char** argv) continue; } + if((strcmp(argv[i], "-r") == 0)) { + restart = atoi(argv[++i]); + continue; + } + if((strcmp(argv[i], "-dm") == 0) || (strcmp(argv[i], "--device_map") == 0)) { char* str; int local_rank; @@ -314,6 +336,18 @@ int main(int argc, char** argv) // Scope Guard { + if (system_size < 20) { + Atom::set_atom_block_size(10000); + } else if (system_size < 41) { + Atom::set_atom_block_size(100000); + } else if (system_size < 61) { + Atom::set_atom_block_size(200000); + } else if (system_size < 81) { + Atom::set_atom_block_size(500000); + } else { + Atom::set_atom_block_size(1000000); + } + Atom atom(ntypes); Neighbor neighbor(ntypes); Integrate integrate; @@ -454,21 +488,30 @@ int main(int argc, char** argv) if(in.forcetype == FORCEEAM) atom.mass = force->mass; } else { + //printf("creating box\n"); create_box(atom, in.nx, in.ny, in.nz, in.rho); + //printf("comm setup\n"); comm.setup(neighbor.cutneigh, atom); + // printf("neighbor setup\n"); neighbor.setup(atom); + // printf("integration setup\n"); integrate.setup(); + // printf("force setup\n"); force->setup(); if(in.forcetype == FORCEEAM) atom.mass = force->mass; + // printf("atom setup\n"); create_atoms(atom, in.nx, in.ny, in.nz, in.rho); + + // printf("thermo setup\n"); thermo.setup(in.rho, integrate, atom, in.units); + // printf("velocity setup\n"); create_velocity(in.t_request, atom, thermo); } @@ -505,6 +548,7 @@ int main(int argc, char** argv) fprintf(stdout, "\t# Use intrinsics: %i\n", force->use_sse); fprintf(stdout, "\t# Do safe exchange: %i\n", comm.do_safeexchange); fprintf(stdout, "\t# Size of float: %i\n\n", (int) sizeof(MMD_float)); + fprintf(stdout, "\t# Restart: %i\n\n", restart); } comm.exchange(atom); @@ -529,7 +573,7 @@ int main(int argc, char** argv) } timer.barrier_start(TIME_TOTAL); - integrate.run(atom, force, neighbor, comm, thermo, timer); + integrate.run(atom, force, neighbor, comm, thermo, timer, restart); timer.barrier_stop(TIME_TOTAL); int natoms; @@ -565,6 +609,11 @@ int main(int argc, char** argv) } // End Scope Guard + +#ifdef KOKKOS_ENABLE_AUTOMATIC_CHECKPOINT + resilience_context.reset(); +#endif + Kokkos::finalize(); MPI_Finalize(); return 0; diff --git a/kokkos/ljs.h b/kokkos/ljs.h index 47da176..bb82f4c 100644 --- a/kokkos/ljs.h +++ b/kokkos/ljs.h @@ -50,4 +50,15 @@ struct In { int thermo_nstat; }; +#ifdef KOKKOS_ENABLE_AUTOMATIC_CHECKPOINT + #include + #include + #ifdef KOKKOS_ENABLE_VELOC + extern std::unique_ptr< KokkosResilience::Context< KokkosResilience::VeloCCheckpointBackend > > resilience_context; + #else + // TODO -- need a non-veloc backend before this will compile... + extern std::unique_ptr< KokkosResilience::Context< > > resilience_context; + #endif +#endif + #endif diff --git a/kokkos/neighbor.cpp b/kokkos/neighbor.cpp index c9c26fe..2939394 100644 --- a/kokkos/neighbor.cpp +++ b/kokkos/neighbor.cpp @@ -650,6 +650,7 @@ int Neighbor::setup(Atom &atom) /* compute closest distance between central bin (0,0,0) and bin (i,j,k) */ +KOKKOS_INLINE_FUNCTION MMD_float Neighbor::bindist(int i, int j, int k) { MMD_float delx, dely, delz; diff --git a/kokkos/neighbor.h b/kokkos/neighbor.h index 80a58ab..17eb4da 100644 --- a/kokkos/neighbor.h +++ b/kokkos/neighbor.h @@ -119,6 +119,7 @@ class Neighbor KOKKOS_INLINE_FUNCTION MMD_float bindist(int, int, int); // distance between binx + KOKKOS_INLINE_FUNCTION int coord2bin(MMD_float, MMD_float, MMD_float) const; // mapping atom coord to a bin diff --git a/kokkos/setup.cpp b/kokkos/setup.cpp index 89c9f63..d02aa77 100644 --- a/kokkos/setup.cpp +++ b/kokkos/setup.cpp @@ -359,6 +359,7 @@ int create_atoms(Atom &atom, int nx, int ny, int nz, double rho) int iflag = 0; + //printf("main atom setup loop \n"); while(oz * subboxdim <= khi) { k = oz * subboxdim + sz; j = oy * subboxdim + sy; diff --git a/minimd.cfg b/minimd.cfg new file mode 100644 index 0000000..5ae09d5 --- /dev/null +++ b/minimd.cfg @@ -0,0 +1,3 @@ +scratch = scratch +persistent = persistent +mode = sync diff --git a/scripts/launch.16.slurm b/scripts/launch.16.slurm new file mode 100644 index 0000000..a5aa6f6 --- /dev/null +++ b/scripts/launch.16.slurm @@ -0,0 +1,44 @@ +#!/bin/bash +#SBATCH -n 16 +#SBATCH -c 12 +#SBATCH --time=02:00:00 +#SBATCH -o ./benchmark_minimd.out +export OMP_PROC_BIND=spread +export OMP_PLACES=threads +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 16 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 12 -i ../kokkos/in.eam.miniMD + diff --git a/scripts/launch.32.slurm b/scripts/launch.32.slurm new file mode 100644 index 0000000..91add40 --- /dev/null +++ b/scripts/launch.32.slurm @@ -0,0 +1,44 @@ +#!/bin/bash +#SBATCH -n 32 +#SBATCH -c 6 +#SBATCH --time=02:00:00 +#SBATCH -o ./benchmark_minimd.out +export OMP_PROC_BIND=spread +export OMP_PLACES=threads +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 32 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 6 -i ../kokkos/in.eam.miniMD + diff --git a/scripts/launch.4.slurm b/scripts/launch.4.slurm new file mode 100644 index 0000000..7cc2fd0 --- /dev/null +++ b/scripts/launch.4.slurm @@ -0,0 +1,44 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH -c 48 +#SBATCH --time=02:00:00 +#SBATCH -o ./benchmark_minimd.out +export OMP_PROC_BIND=spread +export OMP_PLACES=threads +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD + diff --git a/scripts/launch.8.slurm b/scripts/launch.8.slurm new file mode 100644 index 0000000..f7edd3d --- /dev/null +++ b/scripts/launch.8.slurm @@ -0,0 +1,43 @@ +#!/bin/bash +#SBATCH -n 8 +#SBATCH --time=02:00:00 +#SBATCH -o ./benchmark_minimd.out +export OMP_PROC_BIND=spread +export OMP_PLACES=threads +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD +rm -r ./data +mpirun -n 8 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 24 -i ../kokkos/in.eam.miniMD + diff --git a/scripts/launch.slurm b/scripts/launch.slurm new file mode 100644 index 0000000..a39b16f --- /dev/null +++ b/scripts/launch.slurm @@ -0,0 +1,26 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH -c 48 +#SBATCH --time=02:00:00 +#SBATCH -o ./benchmark_minimd.out +export OMP_PROC_BIND=spread +export OMP_PLACES=threads +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD +mpirun -n 4 ./miniMD --half_neigh 0 -s 100 --ntypes 1 -t 48 -i ../kokkos/in.eam.miniMD + diff --git a/scripts/process_results.bash b/scripts/process_results.bash new file mode 100755 index 0000000..070f12d --- /dev/null +++ b/scripts/process_results.bash @@ -0,0 +1,17 @@ +#!/bin/bash + +TOT_TIME=0 + +cat ./benchmark_minimd.out | grep PERF_SUMMARY > benchmark_results.out +let loop_cnt=0 +while read -r result; do + +MD_TIME=`echo $result | awk '{print $5}'` +TOT_TIME=`echo "${TOT_TIME} + ${MD_TIME}" | bc -l` +echo $TOT_TIME, $MD_TIME, $result + +let loop_cnt+=1 +done < ./benchmark_results.out +AVG_MD_TIME=`echo "${TOT_TIME} / ${loop_cnt}" | bc -l` + +echo "MiniMD: ${AVG_MD_TIME}"