Skip to content

Commit

Permalink
Merge pull request #91 from GOMC-WSU/development
Browse files Browse the repository at this point in the history
Hotfix - v2.31
  • Loading branch information
Younes Nejahi authored May 21, 2018
2 parents 7dcb2e3 + 0bfc8f9 commit 50885b8
Show file tree
Hide file tree
Showing 148 changed files with 684 additions and 633 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

#Versioning
set (GOMC_VERSION_MAJOR 2)
set (GOMC_VERSION_MINOR 30)
set (GOMC_VERSION_MINOR 31)

IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING
Expand Down
7 changes: 7 additions & 0 deletions Change log
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log
All notable changes to this project will be documented in this file.

## [2.31] - 5/21/2018
+ Compiling problem fixed on CYGWIN
+ Fix to the error checking of volume exchange if simulation volume became negative
+ Fix the equation to impose fix angle if the angle is less than 90. Generate error if constrained angle is not possible.
+ Fixed a bug where move timings were 0 in windows.
+ Fixed the issue where input files imported from NVT to NPT had zero volume, default value of 500 will be assigned in those cases.

## [2.30] - 5/10/2018
+ Added Regrowth move
+ Cleaned up the code and removed any memory leaks and bugs.
Expand Down
80 changes: 44 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,53 @@
Current Release: 2.30 (5/1/2018)
# GOMC - GPU Optimized Monte Carlo

Current Release: 2.31 (5/21/2018)

[![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)

We recommend the [GOMC Project Website](http://gomc.eng.wayne.edu/ "GOMC Website") and the [user manual](http://gomc.eng.wayne.edu/GOMC_files/GOMC_Manual.pdf "User Manual") for further information and examples.

GOMC - GPU Optimized Monte Carlo
============

BUILDING GOMC ON LINUX:
----------------
1. Clone or download our code from GitHub using "git clone https://github.com/GOMC-WSU/GOMC.git"
2. Go into the GOMC directory using "cd GOMC"
3. Give execution permission using "chmod u+x metamake.sh"
4. In the base directory type "./metamake.sh"
5. Step 2 should generate all the executables in "bin" directory

You can set the number of the threads using the +pN argument, where N is the number of threads.
For example:
./GOMC_<CPU|GPU>_XXXX +p4 in.conf
Which will run 4 threads and reads input file "in.conf".

NOTES:
Building GOMC requires cmake, available at http://www.cmake.org and
in most Linux package repositories (as cmake).
If you wish to utilize NVIDIA graphic cards you will need to install
NVIDIA toolkit before compiling. The metamake file will automatically
detect the location of CUDA installation. (More info in Manual)

BUILDING GOMC ON WINDOWS:
-----------------
1. Open the Windows-compatible CMake GUI.
2. Set the Source Folder to the GOMC root folder.
3. Set the build Folder to your Build Folder.
4. Click configure, select your compiler/environment
5. Wait for CMake to finish the configuration.
6. Click configure again and click generate.
7. Open the CMake-generated project/solution etc. to the desired IDE
(e.g Visual Studio).
8. Using the solution in the IDE of choice build GOMC per the IDE's
standard release compilation/executable generation methods.
## Building GOMC on GNU/Linux, macOS, or Cygwin:

1. Clone or download our code from GitHub:
```bash
git clone https://github.com/GOMC-WSU/GOMC.git
```
2. Go into the GOMC directory:
```bash
cd GOMC
```
3. Give execution permission:
```bash
chmod u+x metamake.sh
```
4. Run metamake file:
```bash
./metamake.sh
```
5. Step 4 should generate all the executables in ```bin``` directory

You can set the number of the threads using the +pN argument, where N is the number of threads.
For example:
```bash
./GOMC_<CPU|GPU>_XXXX +p4 in.conf
```

Which will run 4 threads and reads input file "in.conf".

NOTES:
Building GOMC requires cmake, available at http://www.cmake.org and in most Linux package repositories (as cmake).
If you wish to utilize NVIDIA graphic cards you will need to install NVIDIA toolkit before compiling. The metamake file will automatically detect the location of CUDA installation. (More info in Manual)

## BUILDING GOMC ON WINDOWS:
1. Open the Windows-compatible CMake GUI.
2. Set the Source Folder to the GOMC root folder.
3. Set the build Folder to your Build Folder.
4. Click configure, select your compiler/environment
5. Wait for CMake to finish the configuration.
6. Click configure again and click generate.
7. Open the CMake-generated project/solution etc. to the desired IDE (e.g Visual Studio).
8. Using the solution in the IDE of choice build GOMC per the IDE's standard release compilation/executable generation methods.
NOTES:
You can also use CMake from the Windows command line if its directory is
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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/BlockOutput.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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/BlockOutput.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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
25 changes: 13 additions & 12 deletions src/BoxDimensions.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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 All @@ -18,6 +18,7 @@ void BoxDimensions::Init(config_setup::RestartSettings const& restart,
{
rCut = rc;
rCutSq = rcSq;
minVol = 8.0 * rCutSq * rCut + 0.001;
for (uint b = 0; b < BOX_TOTAL; b++) {
if(restart.enable && cryst.hasVolume) {
axis = cryst.axis;
Expand Down Expand Up @@ -50,17 +51,17 @@ void BoxDimensions::Init(config_setup::RestartSettings const& restart,

//Print Box dimensio info
printf("%s %-d: %-26s %6.3f %7.3f %7.3f \n",
"Info: Box ", b, " Periodic Cell Basis 1",
cellBasis[b].Get(0).x, cellBasis[b].Get(0).y,
cellBasis[b].Get(0).z);
"Info: Box ", b, " Periodic Cell Basis 1",
cellBasis[b].Get(0).x, cellBasis[b].Get(0).y,
cellBasis[b].Get(0).z);
printf("%s %-d: %-26s %6.3f %7.3f %7.3f \n",
"Info: Box ", b, " Periodic Cell Basis 2",
cellBasis[b].Get(1).x, cellBasis[b].Get(1).y,
cellBasis[b].Get(1).z);
"Info: Box ", b, " Periodic Cell Basis 2",
cellBasis[b].Get(1).x, cellBasis[b].Get(1).y,
cellBasis[b].Get(1).z);
printf("%s %-d: %-26s %6.3f %7.3f %7.3f \n\n",
"Info: Box ", b, " Periodic Cell Basis 3",
cellBasis[b].Get(2).x, cellBasis[b].Get(2).y,
cellBasis[b].Get(2).z);
"Info: Box ", b, " Periodic Cell Basis 3",
cellBasis[b].Get(2).x, cellBasis[b].Get(2).y,
cellBasis[b].Get(2).z);


axis.Set(b, cellBasis[b].Length(0), cellBasis[b].Length(1),
Expand Down Expand Up @@ -106,7 +107,7 @@ uint BoxDimensions::ShiftVolume
//If move would shrink any box axis to be less than 2 * rcut, then
//automatically reject to prevent errors.
if ((newDim.halfAx.x[b] < rCut || newDim.halfAx.y[b] < rCut ||
newDim.halfAx.z[b] < rCut)) {
newDim.halfAx.z[b] < rCut || newVolume < minVol)) {
std::cout << "WARNING!!! box shrunk below 2*Rcut! Auto-rejecting!"
<< std::endl;
std::cout << "AxisDimensions: " << newDim.GetAxis(b) << std::endl;
Expand All @@ -131,7 +132,7 @@ uint BoxDimensions::ExchangeVolume
for (uint b = 0; b < BOX_TOTAL; b++) {
scale[b] = newDim.axis.Get(b) / axis.Get(b);
if ((newDim.halfAx.x[b] < rCut || newDim.halfAx.y[b] < rCut ||
newDim.halfAx.z[b] < rCut)) {
newDim.halfAx.z[b] < rCut || newDim.volume[b] < minVol)) {
std::cout << "WARNING!!! box shrunk below 2*Rcut! Auto-rejecting!"
<< std::endl;
std::cout << "AxisDimensions: " << newDim.GetAxis(b) << std::endl;
Expand Down
3 changes: 2 additions & 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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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 @@ -135,6 +135,7 @@ class BoxDimensions

double rCut;
double rCutSq;
double minVol;

bool cubic[BOX_TOTAL], orthogonal[BOX_TOTAL], constArea;

Expand Down
29 changes: 15 additions & 14 deletions src/BoxDimensionsNonOrth.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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 All @@ -18,6 +18,7 @@ void BoxDimensionsNonOrth::Init(config_setup::RestartSettings const& restart,
{
rCut = rc;
rCutSq = rcSq;
minVol = 8.0 * rCutSq * rCut + 0.001;
for (uint b = 0; b < BOX_TOTAL; b++) {
if(restart.enable && cryst.hasVolume) {
axis = cryst.axis;
Expand Down Expand Up @@ -50,17 +51,17 @@ void BoxDimensionsNonOrth::Init(config_setup::RestartSettings const& restart,

//Print Box dimensio info
printf("%s %-d: %-26s %6.3f %7.3f %7.3f \n",
"Info: Box ", b, " Periodic Cell Basis 1",
cellBasis[b].Get(0).x, cellBasis[b].Get(0).y,
cellBasis[b].Get(0).z);
"Info: Box ", b, " Periodic Cell Basis 1",
cellBasis[b].Get(0).x, cellBasis[b].Get(0).y,
cellBasis[b].Get(0).z);
printf("%s %-d: %-26s %6.3f %7.3f %7.3f \n",
"Info: Box ", b, " Periodic Cell Basis 2",
cellBasis[b].Get(1).x, cellBasis[b].Get(1).y,
cellBasis[b].Get(1).z);
"Info: Box ", b, " Periodic Cell Basis 2",
cellBasis[b].Get(1).x, cellBasis[b].Get(1).y,
cellBasis[b].Get(1).z);
printf("%s %-d: %-26s %6.3f %7.3f %7.3f \n\n",
"Info: Box ", b, " Periodic Cell Basis 3",
cellBasis[b].Get(2).x, cellBasis[b].Get(2).y,
cellBasis[b].Get(2).z);
"Info: Box ", b, " Periodic Cell Basis 3",
cellBasis[b].Get(2).x, cellBasis[b].Get(2).y,
cellBasis[b].Get(2).z);


//Find the length of a, b, c
Expand Down Expand Up @@ -156,7 +157,7 @@ uint BoxDimensionsNonOrth::ShiftVolume(BoxDimensionsNonOrth & newDim,
//If move would shrink any box axis to be less than 2 * rcut, then
//automatically reject to prevent errors.
if ((newDim.halfAx.x[b] < rCut || newDim.halfAx.y[b] < rCut ||
newDim.halfAx.z[b] < rCut)) {
newDim.halfAx.z[b] < rCut || newVolume < minVol)) {
std::cout << "WARNING!!! box shrunk below 2*Rcut! Auto-rejecting!"
<< std::endl;
std::cout << "AxisDimensions: " << newDim.GetAxis(b) << std::endl;
Expand All @@ -180,14 +181,14 @@ uint BoxDimensionsNonOrth::ExchangeVolume(BoxDimensionsNonOrth & newDim,

//If move would shrink any box axis to be less than 2 * rcut, then
//automatically reject to prevent errors.
for (uint b = 0; b < BOX_TOTAL && state == mv::fail_state::NO_FAIL; b++) {
for (uint b = 0; b < BOX_TOTAL; b++) {
scale[b] = newDim.axis.Get(b) / axis.Get(b);
if ((newDim.halfAx.x[b] < rCut || newDim.halfAx.y[b] < rCut ||
newDim.halfAx.z[b] < rCut)) {
newDim.halfAx.z[b] < rCut || newDim.volume[b] < minVol)) {
std::cout << "WARNING!!! box shrunk below 2*Rcut! Auto-rejecting!"
<< std::endl;
std::cout << "AxisDimensions: " << newDim.GetAxis(b) << std::endl;
state = mv::fail_state::VOL_TRANS_WOULD_SHRINK_BOX_BELOW_CUTOFF;
return mv::fail_state::VOL_TRANS_WOULD_SHRINK_BOX_BELOW_CUTOFF;
}
}
return state;
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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.30
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
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 50885b8

Please sign in to comment.