Skip to content

Commit

Permalink
Merge branch 'devel' into wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
jcosborn committed Nov 11, 2024
2 parents 251bafe + 0508c8b commit f222c08
Show file tree
Hide file tree
Showing 46 changed files with 4,689 additions and 606 deletions.
17 changes: 12 additions & 5 deletions bootstrap-travis
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
#!/bin/sh

comms="mpi"
cc="mpicc"
if [ "X$1" = "Xsingle" ]; then
comms="single"
cc="gcc"
fi

qmpv="qmp-2.5.4"
qmp="$qmpv.tar.gz"
if [ ! -f $qmp ]; then
wget "http://usqcd-software.github.io/downloads/qmp/$qmp"
curl -LO "http://usqcd-software.github.io/downloads/qmp/$qmp"
fi
tar zxvf $qmp
mkdir qmp
cd $qmpv
./configure \
--prefix="$PWD/../qmp" \
--with-qmp-comms-type=mpi \
CC=mpicc \
--with-qmp-comms-type=$comms \
CC=$cc \
CFLAGS="-Wall -O3 -std=gnu99 -g -fPIC"
make && make install
cd ..

qiov="qio-3.0.0"
qio="$qiov.tar.gz"
if [ ! -f $qio ]; then
wget "http://usqcd-software.github.io/downloads/qio/$qio"
curl -LO "http://usqcd-software.github.io/downloads/qio/$qio"
fi
tar zxvf $qio
mkdir qio
cd $qiov
./configure \
--prefix="$PWD/../qio" \
--with-qmp="$PWD/../qmp" \
CC=mpicc \
CC=$cc \
CFLAGS="-Wall -O3 -std=gnu99 -g -fPIC"
make && make install
cd ..
6 changes: 3 additions & 3 deletions build/installNim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ usage() {
echo " -h (this help message)"
echo " stable (install latest stable version)"
echo " <version> (install named version, e.g. 0.16.0)"
echo " master (install master branch tracking version)"
#echo " master (install master branch tracking version)"
echo " devel (install devel branch tracking version)"
echo " default stable|<version>|master|devel"
echo " (set default version)"
Expand All @@ -35,11 +35,11 @@ if [ "X$1" = "Xdefault" ]; then
fi

ver="stable"
branch="master"
branch="version-2-0"
if [ "X$1" != "X" ]; then
case "$1" in
stable) ver="stable";;
master) ver="master";;
#master) ver="master";;
devel) ver="devel"; branch="devel";;
-h) usage;;
*) ver="$1"; branch="v$1";;
Expand Down
22 changes: 11 additions & 11 deletions src/base/omp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import os
when defined(noOpenmp):
static: echo "OpenMP disabled"
template omp_set_num_threads*(x: cint) = discard
template omp_get_num_threads*(): cint = 1
template omp_get_max_threads*(): cint = 1
template omp_get_thread_num*(): cint = 0
template ompPragma(p:string):untyped = discard
template ompBlock*(p:string; body:untyped):untyped =
template omp_get_num_threads*(): cint = cint 1
template omp_get_max_threads*(): cint = cint 1
template omp_get_thread_num*(): cint = cint 0
template ompPragma(p:string) = discard
template ompBlock*(p:string; body:untyped) =
block:
body
else:
Expand All @@ -24,11 +24,11 @@ else:
proc omp_get_max_threads*(): cint {.omp.}
proc omp_get_thread_num*(): cint {.omp.}
#proc forceOmpOn() {.omp.}
template ompPragma(p:string):untyped =
template ompPragma(p:string) =
#forceOmpOn()
#{. emit:["#pragma omp ", p] .}
{. emit:["_Pragma(\"omp ", p, "\")"] .}
template ompBlock*(p:string; body:untyped):untyped =
template ompBlock*(p:string; body:untyped) =
#{. emit:"#pragma omp " & p .}
#{. emit:"{ /* Inserted by ompBlock " & p & " */".}
#{. emit:["#pragma omp ", p] .}
Expand All @@ -39,14 +39,14 @@ else:

template ompBarrier* = ompPragma("barrier")

template ompParallel*(body:untyped):untyped =
template ompParallel*(body:untyped) =
ompBlock("parallel"):
if(omp_get_thread_num()!=0):
setupForeignThreadGc()
body
template ompMaster*(body:untyped):untyped = ompBlock("master", body)
template ompSingle*(body:untyped):untyped = ompBlock("single", body)
template ompCritical*(body:untyped):untyped = ompBlock("critical", body)
template ompMaster*(body:untyped) = ompBlock("master", body)
template ompSingle*(body:untyped) = ompBlock("single", body)
template ompCritical*(body:untyped) = ompBlock("critical", body)

when isMainModule:
proc test =
Expand Down
Loading

0 comments on commit f222c08

Please sign in to comment.