Skip to content

Commit

Permalink
Fix Args regex; rm Primes.h .cpp; update Makefile to use git describe
Browse files Browse the repository at this point in the history
  • Loading branch information
preda committed Apr 13, 2019
1 parent aa9f55f commit 168a15c
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 217 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
openowl
gpuowl
version.inc
gpuowl.log
*.owl
*.bak
Expand Down
5 changes: 3 additions & 2 deletions Args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ string mergeArgs(int argc, char **argv) {

vector<pair<string, string>> splitArgLine(const string& line) {
vector<pair<string, string>> ret;
std::regex rx("\\s*(-+\\w+)\\s*([^-]\\S*)\\s*([^-]*)");
std::regex rx("\\s*(-+\\w+)\\s+([^-]\\S*)?\\s*([^-]*)");
for (std::sregex_iterator it(line.begin(), line.end(), rx); it != std::sregex_iterator(); ++it) {
smatch m = *it;
// printf("'%s' '%s' '%s'\n", m.str(1).c_str(), m.str(2).c_str(), m.str(3).c_str());
string prefix = m.prefix().str();
string suffix = m.str(3);
if (!prefix.empty()) { log("Args: unexpected '%s' before '%s'\n", prefix.c_str(), m.str(0).c_str()); }
if (!suffix.empty()) { log("Args: unexpected '%s' in '%s'\n", suffix.c_str(), m.str(0).c_str()); }
if (!prefix.empty() || !suffix.empty()) { throw "Wrong argument syntax"; }
if (!prefix.empty() || !suffix.empty()) { throw "Argument syntax"; }
ret.push_back(pair(m.str(1), m.str(2)));
}
return ret;
Expand Down
2 changes: 1 addition & 1 deletion Background.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Background {

void wait() {
if (thread.joinable()) {
log("wating for background tasks..");
log("waiting for background tasks..");
thread.join();
}
}
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ LIBPATH = -L/opt/rocm/opencl/lib/x86_64 -L/opt/amdgpu-pro/lib/x86_64-linux-gnu -
#-fsanitize=leak

openowl: ${HEADERS} ${SRCS}
g++ -Wall -O2 -std=c++17 -DREV=\"`git rev-parse --short HEAD``git diff-files --quiet || echo -mod`\" -Wall ${SRCS} -o openowl -lOpenCL -lgmp -pthread ${LIBPATH}
echo \"`git describe --long`\" > version.inc
echo Version: `cat version.inc`
g++ -Wall -O2 -std=c++17 -Wall ${SRCS} -o gpuowl -lOpenCL -lgmp -pthread ${LIBPATH}
127 changes: 0 additions & 127 deletions Primes.cpp

This file was deleted.

36 changes: 0 additions & 36 deletions Primes.h

This file was deleted.

11 changes: 9 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
srcs = 'Pm1Plan.cpp GmpUtil.cpp FFTConfig.cpp Worktodo.cpp common.cpp gpuowl.cpp Gpu.cpp clwrap.cpp Task.cpp checkpoint.cpp timeutil.cpp Args.cpp Primes.cpp state.cpp Signal.cpp'.split()
# GCC 8.3.0 on Ubuntu 19.04 crashes on filesystem::path
DefaultEnvironment(CXX='g++-9')

Program('openowl', srcs, LIBPATH='.', LIBS=['amdocl64', 'gmp'], parse_flags='-std=c++17 -O2 -Wall -pthread')
srcs = 'Pm1Plan.cpp GmpUtil.cpp FFTConfig.cpp Worktodo.cpp common.cpp gpuowl.cpp Gpu.cpp clwrap.cpp Task.cpp checkpoint.cpp timeutil.cpp Args.cpp state.cpp Signal.cpp'.split()

AlwaysBuild(Command('version.inc', [], 'echo \\"`git describe --long`\\" > $TARGETS'))

LIBPATH=['/opt/rocm/opencl/lib/x86_64']

Program('gpuowl', srcs, LIBPATH=LIBPATH, LIBS=['amdocl64', 'gmp'], parse_flags='-std=c++17 -O2 -Wall -pthread')
40 changes: 4 additions & 36 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,7 @@ void initLog(const char *);

using namespace std; // std::string, std::pair, std::vector, std::unique_ptr;

#define BASE_VERSION "6.5"
// Reason for version change:
// 6.5 : fixed P-1 mem leak; regex args
// 6.4 : embedded gpuowl.cl
// 6.3 : new P-1 implem with multi-rounds and tests.
// 6.2 : added FFT-10 and FFT-6 middle step. Drop 3 & 5 middle steps.
// 6.1 : added P-1
// 6.0 : dropped PRP-1; investigate multi-GPU support.
// 5.0 : dropped TF; dropped old checkpoint load.
// 4.7 : parsing B1 & B2 bounds for PRP-1 in worktodo.txt
// 4.6 : merging LowGpu and OpenGpu back into Gpu.
// 4.5 : yet another kset schedule.
// 4.4 : new PRP,P-1 schedule.
// 4.3 : drop P-1 as standalone task and savefile. Background GCD.
// 4.2 : change PRP residue type to "type-4" (from "type-1").
// 4.1 : introduce PRP-1
// 4.0 : add P-1 first stage; require GMP.
// 3.9 : use save/load path vs. commit/rollback
// 3.8 : TF multi-bit in one pass. OWL TF savefile v2.
// 3.7 : integrated TF
// 3.6 : initial TF
// 3.5 : require OpenCL 2.x
// 3.4 : add factor-9 FFT step, and more FFT sizes.
// 3.3 : add new factor-5 FFT.
// 3.2 : always use fused tail. Drop un-fused fftH, square, multiply kernels.
// 3.1 : use computed trig (instead of tables) in transpose and tailFused / square. Reworked tailFused.
// 3.0 : add CUDA backend.

// The git revision should be passed through -D on the compiler command line (see Makefile).
#ifdef REV
#define VERSION BASE_VERSION "-" REV
#else
#define VERSION BASE_VERSION
#endif

#define PROGRAM "gpuowl"
const constexpr char PROGRAM[] = "gpuowl";
const constexpr char VERSION[] =
#include "version.inc"
;
11 changes: 0 additions & 11 deletions k.cpp

This file was deleted.

0 comments on commit 168a15c

Please sign in to comment.