Skip to content

Commit

Permalink
Merge pull request #173 from GOMC-WSU/development
Browse files Browse the repository at this point in the history
Version 2.60
  • Loading branch information
Younes Nejahi authored Jun 17, 2020
2 parents d85edcd + fc3e1c1 commit 72ac8a9
Show file tree
Hide file tree
Showing 193 changed files with 1,812 additions and 1,438 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log
All notable changes to this project will be documented in this file.

## [2.60] - 6/16/2020
+ Changed the way we calculate pair interactions. The new approach allows us to optimize GPU by reducing the amount of cudaMemcpy needed.
+ Added C++11 support to our code base and removed any `using namespace std;` statements.
+ GPU memory management class to watch the allocation and deallocation of GPU memories.
+ Bug fixes related to lambda functionalities on GPU

## [2.51] - 4/30/2020
+ Fixed a bug with EwaldCached
+ Fixed a warning due to ignoring return value of fscanf
Expand Down
6 changes: 4 additions & 2 deletions CMake/FileLists.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,15 @@ set(cudaHeaders
src/GPU/CalculateEnergyCUDAKernel.cuh
src/GPU/CalculateForceCUDAKernel.cuh
src/GPU/CalculateEwaldCUDAKernel.cuh
src/GPU/VariablesCUDA.cuh)
src/GPU/VariablesCUDA.cuh
src/GPU/CUDAMemoryManager.cuh)

set(cudaSources
src/GPU/CalculateEnergyCUDAKernel.cu
src/GPU/CalculateForceCUDAKernel.cu
src/GPU/CalculateEwaldCUDAKernel.cu
src/GPU/ConstantDefinitionsCUDAKernel.cu)
src/GPU/ConstantDefinitionsCUDAKernel.cu
src/GPU/CUDAMemoryManager.cu)

source_group("Header Files" FILES ${headers})
source_group("Lib Headers" FILES ${libHeaders})
Expand Down
11 changes: 1 addition & 10 deletions CMake/GOMCCUDASetup.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
# Find CUDA is enabled, set it up

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-DGOMC_CUDA)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-Wno-deprecated-gpu-targets)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-Xcompiler -std=c++98)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-Xcompiler -D__CORRECT_ISO_CPP11_MATH_H_PROTO)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_30,code=sm_30)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_35,code=sm_35)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_50,code=sm_50)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_70,code=sm_70)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_70,code=compute_70)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_75,code=sm_75)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_75,code=compute_75)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")
include_directories(src/GPU)
#set(CUDA_VERBOSE_BUILD ON)
set(CUDA_SEPARABLE_COMPILATION ON)
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include_directories(lib)
include_directories(src)
include_directories(src/cbmc)
include_directories(src/moves)
include_directories(src/GPU)

#fix new policy of cmake about FindOpenMP.cmake (will have to check later if they fixed this issue)
if(POLICY CMP0012)
Expand Down Expand Up @@ -79,8 +80,10 @@ elseif(MSVC)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT} /MT /Zi /O2 /Ob1 /D NDEBUG")
endif()

#EnsemblePreprocessor defines NVT = 1, GEMC = 2, GCMC = 3, NPT = 4
# add c++11 flag
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

#EnsemblePreprocessor defines NVT = 1, GEMC = 2, GCMC = 3, NPT = 4
#NPT (Isothermal-Isobaric) Ensemble
set(NPT_flags "-DENSEMBLE=4")
set(NPT_name "GOMC_CPU_NPT")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GOMC - GPU Optimized Monte Carlo

Current Release: 2.51 (4/30/2020)
Current Release: 2.60 (6/16/2020)

[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/GOMC_WSU/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
[![Build Status](https://travis-ci.org/GOMC-WSU/GOMC.svg?branch=master)](https://travis-ci.org/GOMC-WSU/GOMC)
Expand Down
2 changes: 1 addition & 1 deletion lib/BasicTypes.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion lib/BitLib.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion lib/GeomLib.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion lib/Lambda.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion lib/NumLib.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion lib/StrLib.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion lib/StrStrmLib.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion lib/VectorLib.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion metamake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ ICPC_PATH="$(which icpc)"
export CC=${ICC_PATH}
export CXX=${ICPC_PATH}
cmake ..
make
make -j8
26 changes: 13 additions & 13 deletions src/BlockOutput.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down Expand Up @@ -56,12 +56,12 @@ void BlockAverage::DoWrite(const ulong step, uint precision)
{
if (tot >= 1) {
if (outBlock0->is_open()) {
if(abs(block[0]) > 1e99) {
(*outBlock0) << right << std::scientific << std::setprecision(precision - 1) <<
if(std::abs(block[0]) > 1e99) {
(*outBlock0) << std::right << std::scientific << std::setprecision(precision - 1) <<
std::setw(OUTPUTWIDTH);
(*outBlock0) << block[0];
} else {
(*outBlock0) << right << std::scientific << std::setprecision(precision) <<
(*outBlock0) << std::right << std::scientific << std::setprecision(precision) <<
std::setw(OUTPUTWIDTH);
(*outBlock0) << block[0];
}
Expand All @@ -70,12 +70,12 @@ void BlockAverage::DoWrite(const ulong step, uint precision)
}
if (tot >= 2) {
if (outBlock1->is_open()) {
if(abs(block[0]) > 1e99) {
(*outBlock1) << right << std::scientific << std::setprecision(precision - 1) <<
if(std::abs(block[0]) > 1e99) {
(*outBlock1) << std::right << std::scientific << std::setprecision(precision - 1) <<
std::setw(OUTPUTWIDTH);
(*outBlock1) << block[1];
} else {
(*outBlock1) << right << std::scientific << std::setprecision(precision) <<
(*outBlock1) << std::right << std::scientific << std::setprecision(precision) <<
std::setw(OUTPUTWIDTH);
(*outBlock1) << block[1];
}
Expand Down Expand Up @@ -132,8 +132,8 @@ void BlockAverages::Sample(const ulong step)
void BlockAverages::DoOutput(const ulong step)
{
ulong nextStep = step + 1;
outBlock0 << left << std::scientific << std::setw(OUTPUTWIDTH) << nextStep;
outBlock1 << left << std::scientific << std::setw(OUTPUTWIDTH) << nextStep;
outBlock0 << std::left << std::scientific << std::setw(OUTPUTWIDTH) << nextStep;
outBlock1 << std::left << std::scientific << std::setw(OUTPUTWIDTH) << nextStep;
for (uint v = 0; v < totalBlocks; ++v) {
if(v < out::TOTAL_SINGLE)
blocks[v].Write(nextStep, firstPrint, 8);
Expand All @@ -147,9 +147,9 @@ void BlockAverages::DoOutput(const ulong step)

void BlockAverages::InitWatchSingle(config_setup::TrackedVars const& tracked)
{
outBlock0 << left << std::scientific << std::setw(OUTPUTWIDTH) << "#STEPS";
outBlock0 << std::left << std::scientific << std::setw(OUTPUTWIDTH) << "#STEPS";
if(outBlock1.is_open())
outBlock1 << left << std::scientific << std::setw(OUTPUTWIDTH) << "#STEPS";
outBlock1 << std::left << std::scientific << std::setw(OUTPUTWIDTH) << "#STEPS";
//Note: The order of Init should be same as order of SetRef
blocks[out::ENERGY_TOTAL_IDX].Init(&outBlock0, &outBlock1, tracked.energy.block, invSteps, out::ENERGY_TOTAL, BOXES_WITH_U_NB);
blocks[out::ENERGY_INTER_IDX].Init(&outBlock0, &outBlock1, tracked.energy.block, invSteps, out::ENERGY_INTER, BOXES_WITH_U_NB);
Expand Down Expand Up @@ -251,14 +251,14 @@ void BlockAverage::printTitle(std::string output, uint boxes)
{
if(tot >= 1) {
if((*outBlock0).is_open()) {
(*outBlock0) << left << std::scientific << std::setw(OUTPUTWIDTH) << output;
(*outBlock0) << std::left << std::scientific << std::setw(OUTPUTWIDTH) << output;
} else {
std::cerr << "Unable to write to Block_0 output file!" << std::endl;
}
}
if(tot >= 2) {
if((*outBlock1).is_open()) {
(*outBlock1) << left << std::scientific << std::setw(OUTPUTWIDTH) << output;
(*outBlock1) << std::left << std::scientific << std::setw(OUTPUTWIDTH) << output;
} else {
std::cerr << "Unable to write to Block_1 output file!" << std::endl;
}
Expand Down
2 changes: 1 addition & 1 deletion src/BlockOutput.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion src/BoxDimensions.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion src/BoxDimensions.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
4 changes: 2 additions & 2 deletions src/BoxDimensionsNonOrth.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down Expand Up @@ -79,7 +79,7 @@ void BoxDimensionsNonOrth::Init(config_setup::RestartSettings const& restart,
XYZ bxc = Cross(cellBasis[b].Get(1), cellBasis[b].Get(2));
XYZ cxa = Cross(cellBasis[b].Get(2), cellBasis[b].Get(0));
//Calculate volume = A.(B x C)
volume[b] = abs(Dot(cellBasis[b].Get(0), bxc));
volume[b] = std::abs(Dot(cellBasis[b].Get(0), bxc));
volInv[b] = 1.0 / volume[b];
//normalizing unitcell
for(uint i = 0; i < 3; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/BoxDimensionsNonOrth.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion src/CBMC.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion src/CBMC.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion src/COM.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion src/CPUSide.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
2 changes: 1 addition & 1 deletion src/CPUSide.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.51
GPU OPTIMIZED MONTE CARLO (GOMC) 2.60
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
Expand Down
Loading

0 comments on commit 72ac8a9

Please sign in to comment.