Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into M…
Browse files Browse the repository at this point in the history
…EMC_Liq
  • Loading branch information
LSchwiebert committed Mar 9, 2024
2 parents b0435e4 + ff3f67a commit d51e57b
Show file tree
Hide file tree
Showing 227 changed files with 22,959 additions and 24,995 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Install clang-openmp
run: sudo apt install -y libomp-14-dev
- name: metamake
run: ./metamake.sh
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ include_directories(src/GPU)
#Out-of-source build
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

# clang-tidy
#set(CMAKE_CXX_CLANG_TIDY clang-tidy -checks=-*,mpi-*,openmp-*)

#Versioning
set (GOMC_VERSION_MAJOR 2)
set (GOMC_VERSION_MINOR 70)
set (GOMC_VERSION_MINOR 75)

IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING
Expand Down
Binary file modified GOMC_Manual.pdf
Binary file not shown.
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GOMC - GPU Optimized Monte Carlo

Current Release: 2.70 (10/13/2020)
Current Release: 2.75 (6/21/2022)

[![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 Expand Up @@ -29,21 +29,14 @@ To cite GOMC project, please use cite the following papers:
```bash
./metamake.sh
```
5. Step 4 should generate all the executables in ```bin``` directory
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".
`./metamake.sh` accepts flags which indicates which ensembles to compile. Default behavior with no flag will compile all CPU compilers and if CUDA available, all GPU ensembles. Multiple flags can be used by separating with a space. Current accepted flags are: `CPU` to compile all CPU ensembles, `GPU` to compile all GPU ensembles, or you can compile ensembles individually by using any of the following flags:
`NVT`, `NPT`, `GCMC`, `GEMC`, `GPU_NVT`, `GPU_NPT`, `GPU_GCMC`, `GPU_GEMC`.

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)
> 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:
## 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.
Expand All @@ -55,6 +48,14 @@ To cite GOMC project, please use cite the following papers:
9. Open the CMake-generated project/solution etc. to the desired IDE (e.g Visual Studio).
10. 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
added to the PATH environment variable.
> NOTES: You can also use CMake from the Windows command line if its directory is added to the PATH environment variable.
## Executing GOMC:
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".
62 changes: 30 additions & 32 deletions lib/AlphaNum.cpp
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
#include "AlphaNum.h"

AlphaNum::AlphaNum(){}
AlphaNum::AlphaNum() {}

/* Alpha numberic A, B, ... Z, AA, AB, ... AZ, */
/* Index from 0 to A */
// return true if s1 comes before s2

// compare character case-insensitive

std::string AlphaNum::uint2String(uint stringSuffix) {

std::stringstream ss;
char charSuffix;
int intermediate = stringSuffix;
int remainder = 0;
do {
charSuffix = 'A';
remainder = intermediate % 26;
/* Increment Char A until reach suffix or 27 which will be Z. */
for (int j = 0; j < remainder; j++) {
charSuffix++;
}
ss << charSuffix;
intermediate /= 26;
intermediate--;
} while (intermediate >= 0);

std::string backwards = ss.str();
std::string forwards;

std::string AlphaNum::uint2String(uint stringSuffix){

std::stringstream ss;
char charSuffix;
int intermediate = stringSuffix;
int remainder = 0;
do {
charSuffix = 'A';
remainder = intermediate % 26;
/* Increment Char A until reach suffix or 27 which will be Z. */
for (int j = 0; j < remainder; j++){
charSuffix++;
}
ss << charSuffix;
intermediate /= 26;
intermediate--;
} while (intermediate >= 0);

std::string backwards = ss.str();
std::string forwards;

return forwards.assign(backwards.rbegin(), backwards.rend());
return forwards.assign(backwards.rbegin(), backwards.rend());
}

uint AlphaNum::string2Uint(std::string stringSuffix){
uint AlphaNum::string2Uint(std::string stringSuffix) {

char* char_arr = &stringSuffix[0];
char charSuffix = 'A';
uint index = 0;
for (int i = 0; i < stringSuffix.length(); ++i){
index += 26 * i + (char_arr[i] - charSuffix);
}
return index;
char *char_arr = &stringSuffix[0];
char charSuffix = 'A';
uint index = 0;
for (int i = 0; i < stringSuffix.length(); ++i) {
index += 26 * i + (char_arr[i] - charSuffix);
}
return index;
}

28 changes: 14 additions & 14 deletions lib/AlphaNum.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
GPU OPTIMIZED MONTE CARLO (GOMC) 2.75
Copyright (C) 2022 GOMC Group
A copy of the MIT License can be found in License.txt
along with this program, also can be found at <https://opensource.org/licenses/MIT>.
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#pragma once
#include "BasicTypes.h" // uint
#include <vector>
#include <algorithm>
#include <cassert>
#include <sstream> // std::stringstream
#include <algorithm>
#include <string>
#include <cctype>
#include <sstream> // std::stringstream
#include <string>
#include <vector>

struct icompare_char {
bool operator()(char c1, char c2) {
Expand All @@ -21,7 +21,8 @@ struct icompare_char {
};

struct compare {
bool operator()(const std::pair<std::string, int>& lhs, const std::pair<std::string, int>& rhs) {
bool operator()(const std::pair<std::string, int> &lhs,
const std::pair<std::string, int> &rhs) {
if (lhs.first.length() > rhs.first.length())
return false;
if (lhs.first.length() < rhs.first.length())
Expand All @@ -32,12 +33,11 @@ struct compare {
}
};

class AlphaNum
{
public:
AlphaNum();
std::string uint2String(uint stringSuffix);
uint string2Uint(std::string stringSuffix);
struct icompare_char;
struct compare;
class AlphaNum {
public:
AlphaNum();
std::string uint2String(uint stringSuffix);
uint string2Uint(std::string stringSuffix);
struct icompare_char;
struct compare;
};
Loading

0 comments on commit d51e57b

Please sign in to comment.