Skip to content

Commit 53b47a6

Browse files
committed
Merge branch 'master' of github.com:igfuw/libcloudphxx into droplet_puddle
2 parents 079937c + e7ab05a commit 53b47a6

22 files changed

+61
-40
lines changed

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ aliases:
6868
jobs:
6969
include:
7070
- <<: *precache_tests_mpi
71-
env: TEST_SUITE=MPI_tests MPI=mvapich2
71+
env: TEST_SUITE=tests MPI=mvapich2
7272
compiler: gcc
7373
# clang MPI_tests disabled due to issues with manually built boost python libstdc++ / libc++ issues
7474
# - <<: *precache_default
@@ -88,7 +88,7 @@ jobs:
8888
env: TEST_SUITE=cuda MPI=none
8989

9090
- compiler: clang
91-
env: TEST_SUITE=MPI_tests MPI=none
91+
env: TEST_SUITE=tests MPI=mvapich2
9292

9393
- compiler: clang
9494
env: TEST_SUITE=UWLCM_MT MPI=mvapich2
@@ -180,7 +180,7 @@ install:
180180
- if [[ $MPI == 'none' && ($TEST_SUITE != 'tests' || $TEST_SUITE != 'KidA') ]]; then sudo ln -s /usr/lib/x86_64-linux-gnu/libboost_python-py35.so /usr/lib/x86_64-linux-gnu/libboost_python3.so; fi # different naming conventions for boost python with python 3
181181

182182
# thrust
183-
- git clone --depth=1 git://github.com/thrust/thrust.git;
183+
- git clone --depth=1 git://github.com/thrust/thrust.git --branch 1.9.10-1;
184184
- sudo ln -s `pwd`/thrust/thrust /usr/local/include/thrust;
185185
- if [[ $TEST_SUITE == 'cuda' ]]; then sudo ln -s `pwd`/thrust/thrust /usr/local/cuda/include/thrust; fi
186186

@@ -202,6 +202,4 @@ script:
202202
- if [[ $TEST_SUITE == 'UWLCM_unit_smg' ]]; then . ./.travis_scripts/UWLCM.sh unit_smg; fi
203203
# KiD-A 1D
204204
- if [[ $TEST_SUITE == 'KidA' ]]; then . ./.travis_scripts/KidA.sh; fi
205-
# unit tests and drops.py with MPI (drop drops here?)
206-
- if [[ $TEST_SUITE == 'MPI_tests' ]]; then . ./.travis_scripts/tests.sh; fi
207205

.travis_scripts/deps_install/boost.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
1919
cat $HOME/user-config.jam
2020
if [[ $COMPILER == 'g++' ]]; then
2121
./bootstrap.sh --prefix=${DEPS_DIR}/boost/ --with-libraries=chrono,regex,serialization,mpi,atomic,thread,date_time,system,iostreams,timer,filesystem,program_options,python
22-
./b2 -d0 install
22+
travis_wait 30 ./b2 -d0 install
2323
fi
2424
if [[ $COMPILER == 'clang++' ]]; then
2525
#clang installation taken from https://gist.github.com/jimporter/10442880

models/kinematic_2D/tests/paper_GMD_2015/fig_a/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ add_test(travis_2D_kin_cloud_dims_lgrngn bash -c "
106106
add_test(travis_2D_kin_cloud_diff_lgrngn bash -c "
107107
for dir in travis_out_lgrngn; do
108108
echo 'comparing const.h5'
109-
h5diff --delta=1e-6 -v2 $dir/const.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_const.h5 &&
109+
h5diff --delta=1e-6 -v2 $dir/const.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_const.h5 &&
110110
echo 'comparing timestep0000000000.h5' &&
111-
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /th &&
112-
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /rv &&
113-
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /sd_conc &&
111+
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /th &&
112+
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /rv &&
113+
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /sd_conc &&
114114
echo 'comparing timestep0000000020.h5' &&
115-
h5diff --relative=0.001 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /th &&
116-
h5diff --relative=0.002 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /rv &&
117-
h5diff --delta=1 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /sd_conc || exit 1;
115+
h5diff --relative=0.001 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /th &&
116+
h5diff --relative=0.0021 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /rv &&
117+
h5diff --delta=1 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /sd_conc || exit 1;
118118
done
119119
")

src/detail/gpu_assert.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace libcloudphxx
1616
{
1717
namespace detail
1818
{
19-
void gpuAssert(cudaError_t code, const char *file, int line, bool abort=true)
19+
inline void gpuAssert(cudaError_t code, const char *file, int line, bool abort=true)
2020
{
2121
if (code != cudaSuccess)
2222
{
@@ -26,10 +26,10 @@ namespace libcloudphxx
2626
}
2727

2828
// max(1, n)
29-
int m1(int n) { return n == 0 ? 1 : n; }
29+
inline int m1(int n) { return n == 0 ? 1 : n; }
3030

3131
// run a function on a specific gpu
32-
void set_device_and_run(int id, std::function<void()> fun)
32+
inline void set_device_and_run(int id, std::function<void()> fun)
3333
{
3434
gpuErrchk(cudaSetDevice(id));
3535
fun();

src/detail/urand.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ namespace libcloudphxx
120120
)
121121
{
122122
int status = curandGenerateUniform(gen, thrust::raw_pointer_cast(v.data()), n);
123-
assert(status == CURAND_STATUS_SUCCESS /* && "curandGenerateUniform failed"*/);
123+
assert(status == CURAND_STATUS_SUCCESS /* && "curandGenerateUniform failed"*/);
124124
_unused(status);
125+
125126
}
126127

127128
void generate_n(

src/impl/particles_impl.ipp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ namespace libcloudphxx
336336

337337
// if using nvcc, put increase_sstp_coal flag in host memory, but with direct access from device code
338338
#if defined(__NVCC__)
339-
cudaMallocHost(&increase_sstp_coal, sizeof(bool));
339+
gpuErrchk(cudaMallocHost(&increase_sstp_coal, sizeof(bool)));
340340
#else
341341
increase_sstp_coal = new bool();
342342
#endif

src/impl/particles_impl_bcnd.ipp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace libcloudphxx
6868
BOOST_GPU_ENABLED
6969
real_t operator()(real_t x)
7070
{
71-
return a + fmod((x-a) + (b-a), b-a); // this should call CUDA's fmod!
71+
return a + fmod((x-a) + 10 * (b-a), b-a); // assuming that particles dont move more than 10 * domain size; this should call CUDA's fmod!
7272
}
7373
};
7474
};

src/impl/particles_impl_chem_henry.ipp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ namespace libcloudphxx
352352
thrust::pair<
353353
typename thrust_device::vector<thrust_size_t>::iterator,
354354
typename thrust_device::vector<real_t>::iterator
355-
> np =
355+
> it_pair =
356356
thrust::reduce_by_key(
357357
sorted_ijk.begin(), sorted_ijk.end(),
358358
thrust::transform_iterator< // input - values
@@ -369,7 +369,7 @@ namespace libcloudphxx
369369
count_ijk.begin(),
370370
mass_new.begin()
371371
);
372-
count_n = np.first - count_ijk.begin();
372+
count_n = it_pair.first - count_ijk.begin();
373373
assert(count_n > 0 && count_n <= n_cell);
374374

375375
// apply the change to the mixing ratios of trace gases

src/impl/particles_impl_hskpng_count.ipp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ namespace libcloudphxx
2121
thrust::pair<
2222
thrust_device::vector<thrust_size_t>::iterator,
2323
thrust_device::vector<n_t>::iterator
24-
> n = thrust::reduce_by_key(
24+
> it_pair = thrust::reduce_by_key(
2525
sorted_ijk.begin(), sorted_ijk.end(), // input - keys
2626
thrust::make_constant_iterator(n_t(1)), // input - values
2727
count_ijk.begin(), // output - keys
2828
count_num.begin() // output - values
2929
);
30-
count_n = n.first - count_ijk.begin();
30+
count_n = it_pair.first - count_ijk.begin();
3131
assert(count_n <= n_cell);
3232
}
3333
};

src/impl/particles_impl_mass_dens.ipp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace libcloudphxx
6262
thrust::pair<
6363
thrust_device::vector<thrust_size_t>::iterator,
6464
typename thrust_device::vector<real_t>::iterator
65-
> n = thrust::reduce_by_key(
65+
> it_pair = thrust::reduce_by_key(
6666
// input - keys
6767
sorted_ijk.begin(), sorted_ijk.end(),
6868
// input - values
@@ -79,6 +79,10 @@ namespace libcloudphxx
7979
// output - values
8080
count_mom.begin()
8181
);
82+
83+
count_n = it_pair.first - count_ijk.begin();
84+
assert(count_n > 0 && count_n <= n_cell);
85+
8286
#if !defined(__NVCC__)
8387
using std::sqrt;
8488
#endif
@@ -89,12 +93,8 @@ namespace libcloudphxx
8993
#else
9094
sqrt(CUDART_PI / 2.);
9195
#endif
92-
9396
namespace arg = thrust::placeholders;
9497

95-
count_n = n.first - count_ijk.begin();
96-
assert(count_n > 0 && count_n <= n_cell);
97-
9898
//multiply by prefactor and divide by dv
9999
thrust::transform(
100100
count_mom.begin(), count_mom.begin() + count_n, // input - first arg

0 commit comments

Comments
 (0)