Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
easyWave
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Metrics
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
id2
geoperil
easyWave
Commits
589c5644
Commit
589c5644
authored
Nov 13, 2017
by
Hannes Fuchs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved svn branches to git branches, moved trunk to master
parent
36782b77
Changes
130
Show whitespace changes
Inline
Side-by-side
Showing
130 changed files
with
0 additions
and
23585 deletions
+0
-23585
code/LICENSE
code/LICENSE
+0
-0
code/Makefile.am
code/Makefile.am
+0
-0
code/bootstrap.sh
code/bootstrap.sh
+0
-0
code/branches/cpu/EasyWave.cu
code/branches/cpu/EasyWave.cu
+0
-212
code/branches/cpu/Makefile
code/branches/cpu/Makefile
+0
-33
code/branches/cpu/Makefile_debug
code/branches/cpu/Makefile_debug
+0
-31
code/branches/cpu/ewCudaKernels.cu
code/branches/cpu/ewCudaKernels.cu
+0
-220
code/branches/cpu/ewGpuNode.cu
code/branches/cpu/ewGpuNode.cu
+0
-636
code/branches/cpu/ewGpuNode.cuh
code/branches/cpu/ewGpuNode.cuh
+0
-176
code/branches/cpu/ewGrid.cpp
code/branches/cpu/ewGrid.cpp
+0
-258
code/branches/cpu/ewStep.cpp
code/branches/cpu/ewStep.cpp
+0
-376
code/branches/multi-gpu/EasyWave.cu
code/branches/multi-gpu/EasyWave.cu
+0
-212
code/branches/multi-gpu/LICENSE
code/branches/multi-gpu/LICENSE
+0
-197
code/branches/multi-gpu/Makefile
code/branches/multi-gpu/Makefile
+0
-33
code/branches/multi-gpu/Makefile_debug
code/branches/multi-gpu/Makefile_debug
+0
-31
code/branches/multi-gpu/cOgrd.cpp
code/branches/multi-gpu/cOgrd.cpp
+0
-1191
code/branches/multi-gpu/cOgrd.h
code/branches/multi-gpu/cOgrd.h
+0
-107
code/branches/multi-gpu/cOkadaEarthquake.cpp
code/branches/multi-gpu/cOkadaEarthquake.cpp
+0
-324
code/branches/multi-gpu/cOkadaEarthquake.h
code/branches/multi-gpu/cOkadaEarthquake.h
+0
-70
code/branches/multi-gpu/cOkadaFault.cpp
code/branches/multi-gpu/cOkadaFault.cpp
+0
-472
code/branches/multi-gpu/cOkadaFault.h
code/branches/multi-gpu/cOkadaFault.h
+0
-96
code/branches/multi-gpu/cSphere.cpp
code/branches/multi-gpu/cSphere.cpp
+0
-360
code/branches/multi-gpu/cSphere.h
code/branches/multi-gpu/cSphere.h
+0
-68
code/branches/multi-gpu/easywave.h
code/branches/multi-gpu/easywave.h
+0
-131
code/branches/multi-gpu/ewCudaKernels.cu
code/branches/multi-gpu/ewCudaKernels.cu
+0
-220
code/branches/multi-gpu/ewCudaKernels.cuh
code/branches/multi-gpu/ewCudaKernels.cuh
+0
-42
code/branches/multi-gpu/ewGpuNode.cu
code/branches/multi-gpu/ewGpuNode.cu
+0
-636
code/branches/multi-gpu/ewGpuNode.cuh
code/branches/multi-gpu/ewGpuNode.cuh
+0
-176
code/branches/multi-gpu/ewGrid.cpp
code/branches/multi-gpu/ewGrid.cpp
+0
-258
code/branches/multi-gpu/ewNode.h
code/branches/multi-gpu/ewNode.h
+0
-219
code/branches/multi-gpu/ewOut2D.cpp
code/branches/multi-gpu/ewOut2D.cpp
+0
-174
code/branches/multi-gpu/ewPOIs.cpp
code/branches/multi-gpu/ewPOIs.cpp
+0
-277
code/branches/multi-gpu/ewParam.cpp
code/branches/multi-gpu/ewParam.cpp
+0
-219
code/branches/multi-gpu/ewReset.cpp
code/branches/multi-gpu/ewReset.cpp
+0
-56
code/branches/multi-gpu/ewSource.cpp
code/branches/multi-gpu/ewSource.cpp
+0
-219
code/branches/multi-gpu/ewStep.cpp
code/branches/multi-gpu/ewStep.cpp
+0
-376
code/branches/multi-gpu/okada.cpp
code/branches/multi-gpu/okada.cpp
+0
-380
code/branches/multi-gpu/utilits.cpp
code/branches/multi-gpu/utilits.cpp
+0
-1071
code/branches/multi-gpu/utilits.h
code/branches/multi-gpu/utilits.h
+0
-164
code/branches/web/EasyWave.cu
code/branches/web/EasyWave.cu
+0
-194
code/branches/web/LICENSE
code/branches/web/LICENSE
+0
-197
code/branches/web/Makefile
code/branches/web/Makefile
+0
-30
code/branches/web/Makefile_debug
code/branches/web/Makefile_debug
+0
-31
code/branches/web/cOgrd.cpp
code/branches/web/cOgrd.cpp
+0
-1191
code/branches/web/cOgrd.h
code/branches/web/cOgrd.h
+0
-107
code/branches/web/cOkadaEarthquake.cpp
code/branches/web/cOkadaEarthquake.cpp
+0
-324
code/branches/web/cOkadaEarthquake.h
code/branches/web/cOkadaEarthquake.h
+0
-70
code/branches/web/cOkadaFault.cpp
code/branches/web/cOkadaFault.cpp
+0
-472
code/branches/web/cOkadaFault.h
code/branches/web/cOkadaFault.h
+0
-96
code/branches/web/cSphere.cpp
code/branches/web/cSphere.cpp
+0
-360
code/branches/web/cSphere.h
code/branches/web/cSphere.h
+0
-68
code/branches/web/easywave.h
code/branches/web/easywave.h
+0
-139
code/branches/web/ewCudaKernels.cu
code/branches/web/ewCudaKernels.cu
+0
-228
code/branches/web/ewCudaKernels.cuh
code/branches/web/ewCudaKernels.cuh
+0
-43
code/branches/web/ewGpuNode.cu
code/branches/web/ewGpuNode.cu
+0
-696
code/branches/web/ewGpuNode.cuh
code/branches/web/ewGpuNode.cuh
+0
-187
code/branches/web/ewGrid.cpp
code/branches/web/ewGrid.cpp
+0
-367
code/branches/web/ewNode.h
code/branches/web/ewNode.h
+0
-219
code/branches/web/ewOut2D.cpp
code/branches/web/ewOut2D.cpp
+0
-200
code/branches/web/ewPOIs.cpp
code/branches/web/ewPOIs.cpp
+0
-277
code/branches/web/ewParam.cpp
code/branches/web/ewParam.cpp
+0
-228
code/branches/web/ewReset.cpp
code/branches/web/ewReset.cpp
+0
-56
code/branches/web/ewSource.cpp
code/branches/web/ewSource.cpp
+0
-256
code/branches/web/ewStep.cpp
code/branches/web/ewStep.cpp
+0
-376
code/branches/web/okada.cpp
code/branches/web/okada.cpp
+0
-380
code/branches/web/utilits.cpp
code/branches/web/utilits.cpp
+0
-1071
code/branches/web/utilits.h
code/branches/web/utilits.h
+0
-164
code/configure.ac
code/configure.ac
+0
-0
code/cuda.mk
code/cuda.mk
+0
-0
code/src/EasyWave.cpp
code/src/EasyWave.cpp
+0
-0
code/src/Makefile.am
code/src/Makefile.am
+0
-0
code/src/cOgrd.cpp
code/src/cOgrd.cpp
+0
-0
code/src/cOgrd.h
code/src/cOgrd.h
+0
-0
code/src/cOkadaEarthquake.cpp
code/src/cOkadaEarthquake.cpp
+0
-0
code/src/cOkadaEarthquake.h
code/src/cOkadaEarthquake.h
+0
-0
code/src/cOkadaFault.cpp
code/src/cOkadaFault.cpp
+0
-0
code/src/cOkadaFault.h
code/src/cOkadaFault.h
+0
-0
code/src/cSphere.cpp
code/src/cSphere.cpp
+0
-0
code/src/cSphere.h
code/src/cSphere.h
+0
-0
code/src/easywave.h
code/src/easywave.h
+0
-0
code/src/ewCudaKernels.cu
code/src/ewCudaKernels.cu
+0
-0
code/src/ewCudaKernels.cuh
code/src/ewCudaKernels.cuh
+0
-0
code/src/ewGpuNode.cu
code/src/ewGpuNode.cu
+0
-0
code/src/ewGpuNode.cuh
code/src/ewGpuNode.cuh
+0
-0
code/src/ewGrid.cpp
code/src/ewGrid.cpp
+0
-0
code/src/ewNode.h
code/src/ewNode.h
+0
-0
code/src/ewOut2D.cpp
code/src/ewOut2D.cpp
+0
-0
code/src/ewPOIs.cpp
code/src/ewPOIs.cpp
+0
-0
code/src/ewParam.cpp
code/src/ewParam.cpp
+0
-0
code/src/ewReset.cpp
code/src/ewReset.cpp
+0
-0
code/src/ewSource.cpp
code/src/ewSource.cpp
+0
-0
code/src/ewStep.cpp
code/src/ewStep.cpp
+0
-0
code/src/okada.cpp
code/src/okada.cpp
+0
-0
code/src/utilits.cpp
code/src/utilits.cpp
+0
-0
code/src/utilits.h
code/src/utilits.h
+0
-0
code/tests/compare.py
code/tests/compare.py
+0
-0
code/tests/config.cfg
code/tests/config.cfg
+0
-0
code/tests/download.py
code/tests/download.py
+0
-0
code/tests/scenarios.cfg
code/tests/scenarios.cfg
+0
-0
code/tests/test.py
code/tests/test.py
+0
-0
code/tools/FreeMonoBold.ttf
code/tools/FreeMonoBold.ttf
+0
-0
code/tools/poi2png.sh
code/tools/poi2png.sh
+0
-0
code/tools/ssh.abs.cpt
code/tools/ssh.abs.cpt
+0
-0
code/tools/ssh.rel.cpt
code/tools/ssh.rel.cpt
+0
-0
code/tools/ssh2png.sh
code/tools/ssh2png.sh
+0
-0
code/tools/sshmax.rel.cpt
code/tools/sshmax.rel.cpt
+0
-0
code/tools/sshmax2png.sh
code/tools/sshmax2png.sh
+0
-0
code/tools/topo.cpt
code/tools/topo.cpt
+0
-0
code/tools/topo4sshmax.cpt
code/tools/topo4sshmax.cpt
+0
-0
code/tools/topo4sshmaxBW.cpt
code/tools/topo4sshmaxBW.cpt
+0
-0
code/trunk/LICENSE
code/trunk/LICENSE
+0
-197
code/trunk/src/cOgrd.cpp
code/trunk/src/cOgrd.cpp
+0
-1191
code/trunk/src/cOgrd.h
code/trunk/src/cOgrd.h
+0
-107
code/trunk/src/cOkadaEarthquake.cpp
code/trunk/src/cOkadaEarthquake.cpp
+0
-324
code/trunk/src/cOkadaEarthquake.h
code/trunk/src/cOkadaEarthquake.h
+0
-70
code/trunk/src/cOkadaFault.cpp
code/trunk/src/cOkadaFault.cpp
+0
-472
code/trunk/src/cOkadaFault.h
code/trunk/src/cOkadaFault.h
+0
-96
code/trunk/src/cSphere.cpp
code/trunk/src/cSphere.cpp
+0
-360
code/trunk/src/cSphere.h
code/trunk/src/cSphere.h
+0
-68
code/trunk/src/easywave.h
code/trunk/src/easywave.h
+0
-131
code/trunk/src/ewCudaKernels.cuh
code/trunk/src/ewCudaKernels.cuh
+0
-42
code/trunk/src/ewNode.h
code/trunk/src/ewNode.h
+0
-219
code/trunk/src/ewOut2D.cpp
code/trunk/src/ewOut2D.cpp
+0
-174
code/trunk/src/ewPOIs.cpp
code/trunk/src/ewPOIs.cpp
+0
-277
code/trunk/src/ewParam.cpp
code/trunk/src/ewParam.cpp
+0
-219
code/trunk/src/ewReset.cpp
code/trunk/src/ewReset.cpp
+0
-56
code/trunk/src/ewSource.cpp
code/trunk/src/ewSource.cpp
+0
-219
code/trunk/src/okada.cpp
code/trunk/src/okada.cpp
+0
-380
code/trunk/src/utilits.cpp
code/trunk/src/utilits.cpp
+0
-1071
code/trunk/src/utilits.h
code/trunk/src/utilits.h
+0
-164
No files found.
code/
branches/cpu/
LICENSE
→
code/LICENSE
View file @
589c5644
File moved
code/
trunk/
Makefile.am
→
code/Makefile.am
View file @
589c5644
File moved
code/
trunk/
bootstrap.sh
→
code/bootstrap.sh
View file @
589c5644
File moved
code/branches/cpu/EasyWave.cu
deleted
100644 → 0
View file @
36782b77
/*
* EasyWave - A realtime tsunami simulation program with GPU support.
* Copyright (C) 2014 Andrey Babeyko, Johannes Spazier
* GFZ German Research Centre for Geosciences (http://www.gfz-potsdam.de)
*
* Parts of this program (especially the GPU extension) were developed
* within the context of the following publicly funded project:
* - TRIDEC, EU 7th Framework Programme, Grant Agreement 258723
* (http://www.tridec-online.eu)
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the "Licence"),
* complemented with the following provision: For the scientific transparency
* and verification of results obtained and communicated to the public after
* using a modified version of the work, You (as the recipient of the source
* code and author of this modified version, used to produce the published
* results in scientific communications) commit to make this modified source
* code available in a repository that is easily and freely accessible for a
* duration of five years after the communication of the obtained results.
*
* You may not use this work except in compliance with the Licence.
*
* You may obtain a copy of the Licence at:
* https://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
#define HEADER "\neasyWave ver.2013-04-11\n"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <utilits.h>
#include "easywave.h"
#include "ewGpuNode.cuh"
CNode
*
gNode
;
double
diff
(
timespec
start
,
timespec
end
)
{
timespec
temp
;
if
((
end
.
tv_nsec
-
start
.
tv_nsec
)
<
0
)
{
temp
.
tv_sec
=
end
.
tv_sec
-
start
.
tv_sec
-
1
;
temp
.
tv_nsec
=
1000000000
+
end
.
tv_nsec
-
start
.
tv_nsec
;
}
else
{
temp
.
tv_sec
=
end
.
tv_sec
-
start
.
tv_sec
;
temp
.
tv_nsec
=
end
.
tv_nsec
-
start
.
tv_nsec
;
}
return
(
double
)((
double
)
temp
.
tv_nsec
/
1000000000.0
+
(
double
)
temp
.
tv_sec
);
}
int
commandLineHelp
(
void
);
int
main
(
int
argc
,
char
**
argv
)
{
char
buf
[
1024
];
int
ierr
,
argn
,
elapsed
;
int
lastProgress
,
lastPropagation
,
lastDump
;
int
loop
;
printf
(
HEADER
);
Err
.
setchannel
(
MSG_OUTFILE
);
// Read parameters from command line and use default
ierr
=
ewParam
(
argc
,
argv
);
if
(
ierr
)
return
commandLineHelp
();
// Log command line
/* FIXME: buffer overflow */
sprintf
(
buf
,
"Command line: "
);
for
(
argn
=
1
;
argn
<
argc
;
argn
++
)
{
strcat
(
buf
,
" "
);
strcat
(
buf
,
argv
[
argn
]
);
}
Log
.
print
(
"%s"
,
buf
);
if
(
Par
.
gpu
)
{
gNode
=
new
CGpuNode
();
}
else
{
gNode
=
new
CStructNode
();
//gNode = new CArrayNode();
}
CNode
&
Node
=
*
gNode
;
// Read bathymetry
ierr
=
ewLoadBathymetry
();
if
(
ierr
)
return
ierr
;
// Read points of interest
ierr
=
ewLoadPOIs
();
if
(
ierr
)
return
ierr
;
// Init tsunami with faults or uplift-grid
ierr
=
ewSource
();
if
(
ierr
)
return
ierr
;
Log
.
print
(
"Read source from %s"
,
Par
.
fileSource
);
// Write model parameters into the log
ewLogParams
();
if
(
Par
.
outPropagation
)
ewStart2DOutput
();
Node
.
copyToGPU
();
// Main loop
Log
.
print
(
"Starting main loop..."
);
printf
(
"Starting main loop %ld msec
\n
"
,
clock
()
/
(
CLOCKS_PER_SEC
/
1000
)
);
timespec
start
,
end
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
start
);
for
(
Par
.
time
=
0
,
loop
=
1
,
lastProgress
=
Par
.
outProgress
,
lastPropagation
=
Par
.
outPropagation
,
lastDump
=
0
;
Par
.
time
<=
Par
.
timeMax
;
loop
++
,
Par
.
time
+=
Par
.
dt
,
lastProgress
+=
Par
.
dt
,
lastPropagation
+=
Par
.
dt
)
{
/* FIXME: check if Par.poiDt can be used for those purposes */
if
(
Par
.
filePOIs
&&
Par
.
poiDt
&&
((
Par
.
time
/
Par
.
poiDt
)
*
Par
.
poiDt
==
Par
.
time
)
)
{
Node
.
copyPOIs
();
ewSavePOIs
();
}
Node
.
run
();
elapsed
=
((
int
)
clock
())
/
CLOCKS_PER_SEC
;
if
(
Par
.
outProgress
)
{
if
(
lastProgress
>=
Par
.
outProgress
)
{
printf
(
"Model time = %s, elapsed: %ld msec
\n
"
,
utlTimeSplitString
(
Par
.
time
),
clock
()
/
(
CLOCKS_PER_SEC
/
1000
)
);
Log
.
print
(
"Model time = %s, elapsed: %ld msec"
,
utlTimeSplitString
(
Par
.
time
),
clock
()
/
(
CLOCKS_PER_SEC
/
1000
)
);
lastProgress
=
0
;
}
}
if
(
Par
.
outPropagation
)
{
if
(
lastPropagation
>=
Par
.
outPropagation
)
{
Node
.
copyIntermediate
();
ewOut2D
();
lastPropagation
=
0
;
}
}
fflush
(
stdout
);
if
(
Par
.
outDump
)
{
if
(
(
elapsed
-
lastDump
)
>=
Par
.
outDump
)
{
Node
.
copyIntermediate
();
/* FIXME: needs tArr as well */
ewDumpPOIs
();
ewDump2D
();
lastDump
=
elapsed
;
}
}
}
// main loop
clock_gettime
(
CLOCK_MONOTONIC
,
&
end
);
Log
.
print
(
"Finishing main loop"
);
/* TODO: check if theses calls can be combined */
Node
.
copyIntermediate
();
Node
.
copyFromGPU
();
// Final output
Log
.
print
(
"Final dump..."
);
ewDumpPOIs
();
ewDump2D
();
Node
.
freeMem
();
printf_v
(
"Runtime: %.3lf
\n
"
,
diff
(
start
,
end
)
*
1000.0
);
delete
gNode
;
return
0
;
}
//========================================================================
int
commandLineHelp
(
void
)
{
printf
(
"Usage: easyWave -grid ... -source ... -time ... [optional parameters]
\n
"
);
printf
(
"-grid ... bathymetry in GoldenSoftware(C) GRD format (text or binary)
\n
"
);
printf
(
"-source ... input wave either als GRD-file or file with Okada faults
\n
"
);
printf
(
"-time ... simulation time in [min]
\n
"
);
printf
(
"Optional parameters:
\n
"
);
printf
(
"-step ... simulation time step, default- estimated from bathymetry
\n
"
);
printf
(
"-coriolis use Coriolis fource, default- no
\n
"
);
printf
(
"-poi ... POIs file
\n
"
);
printf
(
"-label ... model name, default- 'eWave'
\n
"
);
printf
(
"-progress ... show simulation progress each ... minutes, default- 10
\n
"
);
printf
(
"-propagation ... write wave propagation grid each ... minutes, default- 5
\n
"
);
printf
(
"-dump ... make solution dump each ... physical seconds, default- 0
\n
"
);
printf
(
"-nolog deactivate logging
\n
"
);
printf
(
"-poi_dt_out ... output time step for mariograms in [sec], default- 30
\n
"
);
printf
(
"-poi_search_dist ... in [km], default- 10
\n
"
);
printf
(
"-poi_min_depth ... in [m], default- 1
\n
"
);
printf
(
"-poi_max_depth ... in [m], default- 10 000
\n
"
);
printf
(
"-poi_report enable POIs loading report, default- disabled
\n
"
);
printf
(
"-ssh0_rel ... relative threshold for initial wave, default- 0.01
\n
"
);
printf
(
"-ssh0_abs ... absolute threshold for initial wave in [m], default- 0
\n
"
);
printf
(
"-ssh_arrival ... threshold for arrival times in [m], default- 0.001
\n
"
);
printf
(
" negative value considered as relative threshold
\n
"
);
printf
(
"-gpu start GPU version of EasyWave (requires a CUDA capable device)
\n
"
);
printf
(
"-verbose generate verbose output on stdout
\n
"
);
printf
(
"
\n
Example:
\n
"
);
printf
(
"
\t
easyWave -grid gebcoIndonesia.grd -source fault.inp -time 120
\n\n
"
);
return
-
1
;
}
code/branches/cpu/Makefile
deleted
100644 → 0
View file @
36782b77
-include
../../../Makefile.inc
CC
=
g++
NVCC
=
nvcc
CFLAGS
=
-O3
-I
.
ARCH
?=
compute_20
CODE
?=
sm_21
NVFLAGS
=
$(CFLAGS)
-gencode
arch
=
$(ARCH)
,code
=
$(CODE)
CPPS
=
$(
wildcard
*
.cpp
)
CUS
=
$(
wildcard
*
.cu
)
CU_OBJS
=
$(
patsubst
%.cu,%.o,
$(CUS)
)
OBJECTS
=
$(
patsubst
%.cpp, %.o,
$(CPPS)
)
$(
patsubst
%.cu,%.o,
$(CUS)
)
all
:
EasyWave
EasyWave
:
$(OBJECTS) link.o
$(NVCC)
-o
$@
$^
%.o
:
%.cpp *.h
$(CC)
-c
$(CFLAGS)
-o
$@
$<
%.o
:
%.cu *.cuh *.h
$(NVCC)
-dc
$(NVFLAGS)
-x
cu
-o
$@
$<
link.o
:
$(CU_OBJS)
$(NVCC)
-dlink
$(NVFLAGS)
-o
$@
$^
clean
:
rm
-f
EasyWave
*
.o
code/branches/cpu/Makefile_debug
deleted
100644 → 0
View file @
36782b77
CC=g++
NVCC=nvcc
CFLAGS=-O3 -I. -g
CODE=sm_35
ARCH=compute_35
NVFLAGS=$(CFLAGS) -gencode arch=$(ARCH),code=$(CODE)
CPPS=$(wildcard *.cpp)
CUS=$(wildcard *.cu)
CU_OBJS=$(patsubst %.cu,%.o,$(CUS) )
OBJECTS=$(patsubst %.cpp, %.o, $(CPPS) ) $(patsubst %.cu,%.o,$(CUS) )
all: EasyWave
EasyWave: $(OBJECTS) link.o
$(NVCC) -g -G -o $@ $^
%.o: %.cpp *.h
$(CC) -c $(CFLAGS) -o $@ $<
%.o: %.cu *.cuh *.h
$(NVCC) -G -dc $(NVFLAGS) -x cu -o $@ $<
link.o: $(CU_OBJS)
$(NVCC) -G -dlink $(NVFLAGS) -o $@ $^
clean:
rm -f EasyWave *.o
code/branches/cpu/ewCudaKernels.cu
deleted
100644 → 0
View file @
36782b77
/*
* EasyWave - A realtime tsunami simulation program with GPU support.
* Copyright (C) 2014 Andrey Babeyko, Johannes Spazier
* GFZ German Research Centre for Geosciences (http://www.gfz-potsdam.de)
*
* Parts of this program (especially the GPU extension) were developed
* within the context of the following publicly funded project:
* - TRIDEC, EU 7th Framework Programme, Grant Agreement 258723
* (http://www.tridec-online.eu)
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the "Licence"),
* complemented with the following provision: For the scientific transparency
* and verification of results obtained and communicated to the public after
* using a modified version of the work, You (as the recipient of the source
* code and author of this modified version, used to produce the published
* results in scientific communications) commit to make this modified source
* code available in a repository that is easily and freely accessible for a
* duration of five years after the communication of the obtained results.
*
* You may not use this work except in compliance with the Licence.
*
* You may obtain a copy of the Licence at:
* https://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
#include "ewGpuNode.cuh"
#include "ewCudaKernels.cuh"
__global__
void
runWaveUpdateKernel
(
KernelData
data
)
{
Params
&
dp
=
data
.
params
;
int
i
=
blockIdx
.
y
*
blockDim
.
y
+
threadIdx
.
y
+
dp
.
iMin
;
int
j
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
+
dp
.
jMin
;
int
ij
=
data
.
idx
(
i
,
j
);
float
absH
;
/* maybe unnecessary if controlled from outside */
if
(
i
<=
dp
.
iMax
&&
j
<=
dp
.
jMax
&&
data
.
d
[
ij
]
!=
0
)
{
float
hh
=
data
.
h
[
ij
]
-
data
.
cR1
[
ij
]
*
(
data
.
fM
[
ij
]
-
data
.
fM
[
data
.
le
(
ij
)]
+
data
.
fN
[
ij
]
*
data
.
cR6
[
j
]
-
data
.
fN
[
data
.
dn
(
ij
)]
*
data
.
cR6
[
j
-
1
]
);
absH
=
fabs
(
hh
);
if
(
absH
<
dp
.
sshZeroThreshold
)
{
hh
=
0.
f
;
}
else
if
(
hh
>
data
.
hMax
[
ij
]
)
{
data
.
hMax
[
ij
]
=
hh
;
//hMax[ij] = fmaxf(hMax[ij],h[ij]);
}
if
(
dp
.
sshArrivalThreshold
&&
data
.
tArr
[
ij
]
<
0
&&
absH
>
dp
.
sshArrivalThreshold
)
data
.
tArr
[
ij
]
=
dp
.
mTime
;
data
.
h
[
ij
]
=
hh
;
}
}
__global__
void
runFluxUpdateKernel
(
KernelData
data
)
{
Params
&
dp
=
data
.
params
;
int
i
=
blockIdx
.
y
*
blockDim
.
y
+
threadIdx
.
y
+
dp
.
iMin
;
int
j
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
+
dp
.
jMin
;
int
ij
=
data
.
idx
(
i
,
j
);
if
(
i
<=
dp
.
iMax
&&
j
<=
dp
.
jMax
&&
data
.
d
[
ij
]
!=
0
)
{
float
hh
=
data
.
h
[
ij
];
if
(
data
.
d
[
data
.
ri
(
ij
)]
!=
0
)
data
.
fM
[
ij
]
=
data
.
fM
[
ij
]
-
data
.
cR2
[
ij
]
*
(
data
.
h
[
data
.
ri
(
ij
)]
-
hh
);
if
(
data
.
d
[
data
.
up
(
ij
)]
!=
0
)
data
.
fN
[
ij
]
=
data
.
fN
[
ij
]
-
data
.
cR4
[
ij
]
*
(
data
.
h
[
data
.
up
(
ij
)]
-
hh
);
}
}
__global__
void
runWaveBoundaryKernel
(
KernelData
data
)
{
KernelData
&
dt
=
data
;
Params
&
dp
=
data
.
params
;
int
id
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
+
2
;
int
ij
;
if
(
dt
.
devID
==
0
)
{
if
(
id
<=
dp
.
nJ
-
1
)
{
ij
=
dt
.
idx
(
1
,
id
);
dt
.
h
[
ij
]
=
sqrtf
(
powf
(
dt
.
fM
[
ij
],
2.0
f
)
+
0.25
f
*
powf
((
dt
.
fN
[
ij
]
+
dt
.
fN
[
dt
.
dn
(
ij
)]),
2.0
f
)
)
*
dt
.
cB2
[
id
-
1
];
if
(
dt
.
fM
[
ij
]
>
0
)
dt
.
h
[
ij
]
=
-
dt
.
h
[
ij
];
}
if
(
id
==
2
)
{
ij
=
dt
.
idx
(
1
,
1
);
dt
.
h
[
ij
]
=
sqrtf
(
powf
(
dt
.
fM
[
ij
],
2.0
f
)
+
powf
(
dt
.
fN
[
ij
],
2.0
f
)
)
*
dt
.
cB1
[
0
];
if
(
dt
.
fN
[
ij
]
>
0
)
dt
.
h
[
ij
]
=
-
dt
.
h
[
ij
];
ij
=
dt
.
idx
(
1
,
dp
.
nJ
);
dt
.
h
[
ij
]
=
sqrtf
(
powf
(
dt
.
fM
[
ij
],
2.0
f
)
+
powf
(
dt
.
fN
[
dt
.
dn
(
ij
)],
2.0
f
)
)
*
dt
.
cB3
[
0
];
if
(
dt
.
fN
[
dt
.
dn
(
ij
)]
<
0
)
dt
.
h
[
ij
]
=
-
dt
.
h
[
ij
];
}
}
else
if
(
dt
.
devID
==
dt
.
devNum
-
1
)
{
if
(
id
<=
dp
.
nJ
-
1
)
{
ij
=
dt
.
idx
(
dp
.
nI
,
id
);
dt
.
h
[
ij
]
=
sqrtf
(
powf
(
dt
.
fM
[
dt
.
le
(
ij
)],
2.0
f
)
+
0.25
f
*
powf
((
dt
.
fN
[
ij
]
+
dt
.
fN
[
dt
.
dn
(
ij
)]),
2.0
f
)
)
*
dt
.
cB4
[
id
-
1
];
if
(
dt
.
fM
[
dt
.
le
(
ij
)]
<
0
)
dt
.
h
[
ij
]
=
-
dt
.
h
[
ij
];
}
if
(
id
==
2
)
{
ij
=
dt
.
idx
(
dp
.
nI
,
1
);
dt
.
h
[
ij
]
=
sqrtf
(
powf
(
dt
.
fM
[
dt
.
le
(
ij
)],
2.0
f
)
+
powf
(
dt
.
fN
[
ij
],
2.0
f
)
)
*
dt
.
cB1
[
dp
.
nI
-
1
];
if
(
dt
.
fN
[
ij
]
>
0
)
dt
.
h
[
ij
]
=
-
dt
.
h
[
ij
];
ij
=
dt
.
idx
(
dp
.
nI
,
dp
.
nJ
);
dt
.
h
[
ij
]
=
sqrtf
(
powf
(
dt
.
fM
[
dt
.
le
(
ij
)],
2.0
f
)
+
powf
(
dt
.
fN
[
dt
.
dn
(
ij
)],
2.0
f
)
)
*
dt
.
cB3
[
dp
.
nI
-
1
];
if
(
dt
.
fN
[
dt
.
dn
(
ij
)]
<
0
)
dt
.
h
[
ij
]
=
-
dt
.
h
[
ij
];
}
}
if
(
id
<=
dp
.
nI
-
1
)
{
ij
=
dt
.
idx
(
id
,
1
);
dt
.
h
[
ij
]
=
sqrtf
(
powf
(
dt
.
fN
[
ij
],
2.0
f
)
+
0.25
f
*
powf
((
dt
.
fM
[
ij
]
+
dt
.
fM
[
dt
.
le
(
ij
)]),
2.0
f
)
)
*
dt
.
cB1
[
id
-
1
];
if
(
dt
.
fN
[
ij
]
>
0
)
dt
.
h
[
ij
]
=
-
dt
.
h
[
ij
];
}
if
(
id
<=
dp
.
nI
-
1
)
{
ij
=
dt
.
idx
(
id
,
dp
.
nJ
);
dt
.
h
[
ij
]
=
sqrtf
(
powf
(
dt
.
fN
[
dt
.
dn
(
ij
)],
2.0
f
)
+
0.25
f
*
powf
((
dt
.
fM
[
ij
]
+
dt
.
fM
[
dt
.
dn
(
ij
)]),
2.0
f
)
)
*
dt
.
cB3
[
id
-
1
];
if
(
dt
.
fN
[
dt
.
dn
(
ij
)]
<
0
)
dt
.
h
[
ij
]
=
-
dt
.
h
[
ij
];
}
}
__global__
void
runFluxBoundaryKernel
(
KernelData
data
)
{
KernelData
&
dt
=
data
;
Params
&
dp
=
data
.
params
;
int
id
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
+
1
;
int
ij
;
if
(
dt
.
devID
==
0
)
{
if
(
id
<=
dp
.
nJ
)
{
ij
=
dt
.
idx
(
1
,
id
);
dt
.
fM
[
ij
]
=
dt
.
fM
[
ij
]
-
dt
.
cR2
[
ij
]
*
(
dt
.
h
[
dt
.
ri
(
ij
)]
-
dt
.
h
[
ij
]);
}
if
(
id
<=
dp
.
nJ
-
1
)
{
ij
=
dt
.
idx
(
1
,
id
);
dt
.
fN
[
ij
]
=
dt
.
fN
[
ij
]
-
dt
.
cR4
[
ij
]
*
(
dt
.
h
[
dt
.
up
(
ij
)]
-
dt
.
h
[
ij
]);
}
}
else
if
(
dt
.
devID
==
dt
.
devNum
-
1
)
{
if
(
id
<=
dp
.
nJ
-
1
)
{
ij
=
dt
.
idx
(
dp
.
nI
,
id
);
dt
.
fN
[
ij
]
=
dt
.
fN
[
ij
]
-
dt
.
cR4
[
ij
]
*
(
dt
.
h
[
dt
.
up
(
ij
)]
-
dt
.
h
[
ij
]);
}
}
if
(
id
<=
dp
.
nI
-
1
)
{
ij
=
dt
.
idx
(
id
,
1
);
dt
.
fM
[
ij
]
=
dt
.
fM
[
ij
]
-
dt
.
cR2
[
ij
]
*
(
dt
.
h
[
dt
.
ri
(
ij
)]
-
dt
.
h
[
ij
]);
}
if
(
id
<=
dp
.
nI
-
1
)
{
ij
=
dt
.
idx
(
id
,
dp
.
nJ
);
dt
.
fM
[
ij
]
=
dt
.
fM
[
ij
]
-
dt
.
cR2
[
ij
]
*
(
dt
.
h
[
dt
.
ri
(
ij
)]
-
dt
.
h
[
ij
]);
}
if
(
id
<=
dp
.
nI
)
{
ij
=
dt
.
idx
(
id
,
1
);
dt
.
fN
[
ij
]
=
dt
.
fN
[
ij
]
-
dt
.
cR4
[
ij
]
*
(
dt
.
h
[
dt
.
up
(
ij
)]
-
dt
.
h
[
ij
]);
}
}
__global__
void
runGridExtendKernel
(
KernelData
data
)
{
Params
&
dp
=
data
.
params
;
int
id
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
if
(
id
>=
dp
.
jMin
&&
id
<=
dp
.
jMax
)
{
if
(
fabsf
(
data
.
h
[
data
.
idx
(
dp
.
iMin
+
2
,
id
)])
>
dp
.
sshClipThreshold
)
atomicAdd
(
&
(
data
.
extend
->
x
),
1
);
if
(
fabsf
(
data
.
h
[
data
.
idx
(
dp
.
iMax
-
2
,
id
)])
>
dp
.
sshClipThreshold
)
atomicAdd
(
&
(
data
.
extend
->
y
),
1
);
}
if
(
id
>=
dp
.
iMin
&&
id
<=
dp
.
iMax
)
{
if
(
fabsf
(
data
.
h
[
data
.
idx
(
id
,
dp
.
jMin
+
2
)])
>
dp
.
sshClipThreshold
)
atomicAdd
(
&
(
data
.
extend
->
z
),
1
);
if
(
fabsf
(
data
.
h
[
data
.
idx
(
id
,
dp
.
jMax
-
2
)])
>
dp
.
sshClipThreshold
)
atomicAdd
(
&
(
data
.
extend
->
w
),
1
);
}
}
code/branches/cpu/ewGpuNode.cu
deleted
100644 → 0
View file @
36782b77
/*
* EasyWave - A realtime tsunami simulation program with GPU support.
* Copyright (C) 2014 Andrey Babeyko, Johannes Spazier
* GFZ German Research Centre for Geosciences (http://www.gfz-potsdam.de)
*
* Parts of this program (especially the GPU extension) were developed
* within the context of the following publicly funded project:
* - TRIDEC, EU 7th Framework Programme, Grant Agreement 258723
* (http://www.tridec-online.eu)
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the "Licence"),
* complemented with the following provision: For the scientific transparency
* and verification of results obtained and communicated to the public after
* using a modified version of the work, You (as the recipient of the source
* code and author of this modified version, used to produce the published
* results in scientific communications) commit to make this modified source
* code available in a repository that is easily and freely accessible for a
* duration of five years after the communication of the obtained results.
*
* You may not use this work except in compliance with the Licence.
*
* You may obtain a copy of the Licence at:
* https://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
#include "ewGpuNode.cuh"
#include "ewCudaKernels.cuh"
CGpuNode
::
CGpuNode
()
{
pitch
=
0
;
copied
=
true
;
/* TODO: make dynamic */
num_virtual_gpus
=
4
;
num_real_gpus
=
2
;
vgpus
=
new
VGpu
[
num_virtual_gpus
];