Commit 16c9a97e authored by incardon's avatar incardon

Latest GPU branch

parent 5fc7651e
Pipeline #837 failed with stages
in 22 minutes and 2 seconds
......@@ -141,6 +141,7 @@ if(TINYOBJLOADER_FOUND)
endif()
file(WRITE error_code "0")
file(WRITE cuda_lib "${CUDA_cudart_static_LIBRARY} ${CUDA_cudadevrt_LIBRARY}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config/config_cmake.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config/config.h)
......
......@@ -332,6 +332,7 @@ do
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg
conf_options="$conf_options -DCMAKE_INSTALL_PREFIX=$ac_optarg"
echo "$prefix" > install_dir
;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
......@@ -547,13 +548,16 @@ fi
cd ..
echo "SUBDIRS := build
echo "all:
\$(MAKE) -C build \$@
all: \$(SUBDIRS)
\$(SUBDIRS):
\$(MAKE) -C \$@
clean:
\$(MAKE) -C build \$@
.PHONY: all \$(SUBDIRS)" > Makefile
install:
\$(MAKE) -C build \$@
.PHONY: all clean install" > Makefile
echo "$0 $@" > config.log
......
......@@ -68,7 +68,7 @@ typedef float real_number;
#define FLUID 1
// initial spacing between particles dp in the formulas
const real_number dp = 0.0085;
const real_number dp = 0.00425;
// Maximum height of the fluid water
// is going to be calculated and filled later on
real_number h_swl = 0.0;
......@@ -80,7 +80,7 @@ const real_number coeff_sound = 20.0;
const real_number gamma_ = 7.0;
// sqrt(3.0*dp*dp) support of the kernel
const real_number H = 0.0147224318643;
const real_number H = 0.00736121593217;
// Eta in the formulas
const real_number Eta2 = 0.01 * H*H;
......@@ -94,10 +94,12 @@ const real_number visco = 0.1;
real_number cbar = 0.0;
// Mass of the fluid particles
const real_number MassFluid = 0.000614125;
const real_number MassFluid = 0.0000767656;
// Mass of the boundary particles
const real_number MassBound = 0.000614125;
const real_number MassBound = 0.0000767656;
//
// End simulation time
#ifdef TEST_RUN
......@@ -447,7 +449,7 @@ real_number calc_deltaT(particles & vd, real_number ViscDtMax)
max_acceleration_and_velocity(vd,Maxacc,Maxvel);
//-dt1 depends on force per unit mass.
const real_number dt_f = (Maxacc)?sqrt(H/Maxacc):std::numeric_limits<int>::max();
const real_number dt_f = (Maxacc)?sqrt(H/Maxacc):std::numeric_limits<float>::max();
//-dt2 combines the Courant and the viscous time-step controls.
const real_number dt_cv = H/(std::max(cbar,Maxvel*10.f) + H*ViscDtMax);
......@@ -717,7 +719,7 @@ int main(int argc, char* argv[])
// Here we define our domain a 2D box with internals from 0 to 1.0 for x and y
Box<3,real_number> domain({-0.05,-0.05,-0.05},{1.7010,0.7065,0.5025});
size_t sz[3] = {207,90,66};
size_t sz[3] = {413,179,131};
// Fill W_dap
W_dap = 1.0/Wab(H/1.5);
......@@ -728,7 +730,7 @@ int main(int argc, char* argv[])
// extended boundary around the domain, and the processor domain
Ghost<3,real_number> g(2*H);
particles vd(0,domain,bc,g,DEC_GRAN(512));
particles vd(0,domain,bc,g,DEC_GRAN(128));
//! \cond [draw fluid] \endcond
......
......@@ -37,7 +37,7 @@ nomake=0
update_openfpm=0
upgrade_openfpm=0
while getopts di:smhc:nu FLAG; do
while getopts di:smghc:nu FLAG; do
case $FLAG in
d)
echo "Disable depencencies installation"
......@@ -297,6 +297,10 @@ configure_options=" $configure_options --with-parmetis=$i_dir/PARMETIS "
./script/install_Metis.sh $i_dir $CC $CXX $ncore
configure_options=" $configure_options --with-metis=$i_dir/METIS "
if [ x"$gpu_support" == x"1" ]; then
configure_options=" $configure_options --enable-gpu "
fi
MPI_installed=0
MPI_System_prv=1
METIS_installed=1
......@@ -417,8 +421,14 @@ fi
echo "INCLUDE_PATH= $openmp_flags -I. -I$install_base/openfpm_numerics/include -I$install_base/openfpm_pdata/include/config -I$install_base/openfpm_pdata/include -I$install_base/openfpm_data/include -I$install_base/openfpm_vcluster/include -I$install_base/openfpm_io/include -I$install_base/openfpm_devices/include -I$i_dir/METIS/include -I$i_dir/PARMETIS/include -I$i_dir/BOOST/include -I$i_dir/HDF5/include -I$i_dir/LIBHILBERT/include $lin_alg_inc" > example.mk
echo "LIBS_PATH= $openmp_flags -L$install_base/openfpm_devices/lib -L$install_base/openfpm_pdata/lib -L$install_base/openfpm_vcluster/lib -L$i_dir/METIS/lib -L$i_dir/PARMETIS/lib -L$i_dir/BOOST/lib -L$hdf5_lib -L$i_dir/LIBHILBERT/lib $lin_alg_dir" >> example.mk
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $lin_alg_lib" >> example.mk
echo "LIBS_SE2=-lvcluster -lofpmmemory_se2 -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $lin_alg_lib" >> example.mk
if [ x"$gpu_support" == x"1" ]; then
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $(cat cuda_lib) $lin_alg_lib" >> example.mk
echo "LIBS_SE2=-lvcluster -lofpmmemory_se2 -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $(cat cuda_lib) $lin_alg_lib" >> example.mk
else
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $lin_alg_lib" >> example.mk
echo "LIBS_SE2=-lvcluster -lofpmmemory_se2 -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $lin_alg_lib" >> example.mk
fi
echo "INCLUDE_PATH_NVCC=$(cat openmp_flags) -Xcudafe \"--display_error_number --diag_suppress=2885 --diag_suppress=2887 --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111\" --expt-extended-lambda -I. -I$install_base/openfpm_numerics/include -I$install_base/openfpm_pdata/include/config -I$install_base/openfpm_pdata/include -I$install_base/openfpm_data/include -I$install_base/openfpm_vcluster/include -I$install_base/openfpm_io/include -I$install_base/openfpm_devices/include -I$i_dir/METIS/include -I$i_dir/PARMETIS/include -I$i_dir/BOOST/include -I$i_dir/HDF5/include -I$i_dir/LIBHILBERT/include $lin_alg_inc" >> example.mk
cp example.mk src/example.mk
cp example.mk example/example.mk
......
......@@ -7,6 +7,7 @@ function HELP {
echo -e " \033[1mOptions:\033[0m"
echo -e " \033[1;34m-n\033[0m upgrade openfpm, it upgrades openfpm to the new version"
echo -e " \033[1;34m-u\033[0m update openfpm, it updates the current openfpm release with the latest bug fixes"
echo -e " \033[1;34m-g\033[0m enable GPU"
echo -e " \033[1;34m-i\033[0m directory Set the directory where to install the required dependencies"
echo -e " \033[1;34m-d\033[0m disable installation of requirements"
echo -e " \033[1;34m-s\033[0m skip user input"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment