From c1e2b72aa6f30e515751739a485464d5c40d2266 Mon Sep 17 00:00:00 2001 From: Incardona Pietro <incardon@mpi-cbg.de> Date: Thu, 25 Feb 2021 11:05:37 +0100 Subject: [PATCH] Fixing install python --- script/install_OPENBLAS.sh | 14 +- script/remove_old | 2 +- script/solve_python | 2 + src/Grid/grid_dist_id.hpp | 2 + src/Grid/tests/grid_dist_id_unit_test.cpp | 206 ++++++++++++++++++++++ 5 files changed, 218 insertions(+), 8 deletions(-) diff --git a/script/install_OPENBLAS.sh b/script/install_OPENBLAS.sh index cf675e599..d87f112c4 100755 --- a/script/install_OPENBLAS.sh +++ b/script/install_OPENBLAS.sh @@ -6,11 +6,11 @@ if [ -d "$1/OPENBLAS" ]; then echo "OPENBLAS is already installed" exit 0 fi -rm -rf OpenBLAS-0.3.10 -rm -rf OpenBLAS-0.3.10.tar.gz -wget http://ppmcore.mpi-cbg.de/upload/OpenBLAS-0.3.10.tar.gz -tar -xf OpenBLAS-0.3.10.tar.gz -cd OpenBLAS-0.3.10 +rm -rf OpenBLAS-0.3.13 +rm -rf OpenBLAS-0.3.13.tar.gz +wget http://ppmcore.mpi-cbg.de/upload/OpenBLAS-0.3.13.tar.gz +tar -xf OpenBLAS-0.3.13.tar.gz +cd OpenBLAS-0.3.13 #wget http://ppmcore.mpi-cbg.de/upload/openblas.diff #patch -p1 < openblas.diff @@ -26,8 +26,8 @@ make install PREFIX=$1/OPENBLAS if [ ! "$(ls -A $1/OPENBLAS)" ]; then rm -rf $1/OPENBLAS else - rm -rf OpenBLAS-0.3.10 - echo 2 > $1/OPENBLAS/version + rm -rf OpenBLAS-0.3.13 + echo 3 > $1/OPENBLAS/version exit 0 fi diff --git a/script/remove_old b/script/remove_old index 8669c1de0..a3a636763 100755 --- a/script/remove_old +++ b/script/remove_old @@ -207,7 +207,7 @@ function remove_old() if [ -d $1/OPENBLAS ]; then version=$(cat $1/OPENBLAS/version) - if [ x"$version" != x"2" ]; then + if [ x"$version" != x"3" ]; then echo -e "\033[1;34;5m ---------------------------------------------------------------------- \033[0m" echo -e "\033[1;34;5m OPENBLAS has been updated, the component will be updated automatically \033[0m" echo -e "\033[1;34;5m ---------------------------------------------------------------------- \033[0m" diff --git a/script/solve_python b/script/solve_python index 5e9c5fff6..a9a90026a 100755 --- a/script/solve_python +++ b/script/solve_python @@ -24,6 +24,8 @@ if [ x"$pcman" == x"apt-get" ]; then if [ $? -eq 0 ]; then base_python_pkg="python2 $base_python_pkg" fi +elif [ x"$pcman" == x"dnf" ]; then + base_python_pkg="python" elif [ x"$pcman" == x"zypper -n" ]; then base_python_pkg=python2 additional_python_pkg=python3 diff --git a/src/Grid/grid_dist_id.hpp b/src/Grid/grid_dist_id.hpp index 538268f48..1d1a12cdf 100644 --- a/src/Grid/grid_dist_id.hpp +++ b/src/Grid/grid_dist_id.hpp @@ -3295,6 +3295,8 @@ using sgrid_dist_id = grid_dist_id<dim,St,T,Decomposition,Memory,sgrid_cpu<dim,T template<unsigned int dim, typename St, typename T, typename Memory = HeapMemory, typename Decomposition = CartDecomposition<dim,St>> using sgrid_dist_soa = grid_dist_id<dim,St,T,Decomposition,Memory,sgrid_soa<dim,T,Memory>>; +template<unsigned int dim, typename St, typename T, typename devg, typename Memory = HeapMemory, typename Decomposition = CartDecomposition<dim,St>> +using grid_dist_id_devg = grid_dist_id<dim,St,T,Decomposition,Memory,devg>; #ifdef __NVCC__ template<unsigned int dim, typename St, typename T, typename Memory = CudaMemory, typename Decomposition = CartDecomposition<dim,St,CudaMemory,memory_traits_inte> > diff --git a/src/Grid/tests/grid_dist_id_unit_test.cpp b/src/Grid/tests/grid_dist_id_unit_test.cpp index 8d7bef37e..fa3d95a37 100644 --- a/src/Grid/tests/grid_dist_id_unit_test.cpp +++ b/src/Grid/tests/grid_dist_id_unit_test.cpp @@ -2456,6 +2456,212 @@ BOOST_AUTO_TEST_CASE( grid_dist_ghost_zero_size ) BOOST_REQUIRE_EQUAL(count,32*32*32); } + +BOOST_AUTO_TEST_CASE(grid_dist_id_smb_write_out_1_proc) +{ + // Test grid periodic + { + Box<2,float> domain({-1.0,-1.0,-1.0},{1.0,1.0,1.0}); + + Vcluster<> & v_cl = create_vcluster(); + + if ( v_cl.getProcessingUnits() > 1 ) + {return;} + + // grid size + size_t sz[2]; + sz[0] = 16; + sz[1] = 16; + + // Ghost + Ghost<2,long int> g(0); + + // periodicity + periodicity<2> pr = {{NON_PERIODIC,NON_PERIODIC}}; + + typedef grid_cpu<2, aggregate<int>, grid_smb<2,4> > devg; + + // Distributed grid with id decomposition + grid_dist_id_devg<2, float, aggregate<int>,devg> g_smb(sz,domain,g,pr); + + auto it = g_smb.getDomainIterator(); + + size_t count = 0; + + unsigned char * base = (unsigned char *)g_smb.get_loc_grid(0).getPointer<0>(); + + while (it.isNext()) + { + auto k = it.get(); + + g_smb.template getProp<0>(k) = (unsigned char *)&g_smb.template getProp<0>(k) - base; + + ++count; + + ++it; + } + + v_cl.sum(count); + v_cl.execute(); + + BOOST_REQUIRE_EQUAL(count,16*16); + + g_smb.write("g_smb_out"); + } +} + +BOOST_AUTO_TEST_CASE(grid_dist_id_zmb_write_out_1_proc) +{ + { + // Test grid periodic + + Box<2,float> domain({-1.0,-1.0,-1.0},{1.0,1.0,1.0}); + + Vcluster<> & v_cl = create_vcluster(); + + if ( v_cl.getProcessingUnits() > 1 ) + {return;} + + // grid size + size_t sz[2]; + sz[0] = 16; + sz[1] = 16; + + // Ghost + Ghost<2,long int> g(0); + + // periodicity + periodicity<2> pr = {{NON_PERIODIC,NON_PERIODIC}}; + + typedef grid_cpu<2, aggregate<int>, grid_zmb<2,4,long int> > devg; + + // Distributed grid with id decomposition + grid_dist_id_devg<2, float, aggregate<int>,devg> g_smb(sz,domain,g,pr); + + auto it = g_smb.getDomainIterator(); + + size_t count = 0; + + unsigned char * base = (unsigned char *)g_smb.get_loc_grid(0).getPointer<0>(); + + while (it.isNext()) + { + auto k = it.get(); + + g_smb.template getProp<0>(k) = (unsigned char *)&g_smb.template getProp<0>(k) - base; + + ++count; + + ++it; + } + + v_cl.sum(count); + v_cl.execute(); + + BOOST_REQUIRE_EQUAL(count,16*16); + + g_smb.write("g_zmb_out"); + } + + { + Box<2,float> domain({-1.0,-1.0,-1.0},{1.0,1.0,1.0}); + + Vcluster<> & v_cl = create_vcluster(); + + if ( v_cl.getProcessingUnits() > 1 ) + {return;} + + // grid size + size_t sz[2]; + sz[0] = 16; + sz[1] = 16; + + // Ghost + Ghost<2,long int> g(0); + + // periodicity + periodicity<2> pr = {{NON_PERIODIC,NON_PERIODIC}}; + + typedef grid_cpu<2, aggregate<int>, grid_zm<2,void> > devg; + + // Distributed grid with id decomposition + grid_dist_id_devg<2, float, aggregate<int>,devg> g_smb(sz,domain,g,pr); + + auto it = g_smb.getDomainIterator(); + + size_t count = 0; + + unsigned char * base = (unsigned char *)g_smb.get_loc_grid(0).getPointer<0>(); + + while (it.isNext()) + { + auto k = it.get(); + + g_smb.template getProp<0>(k) = (unsigned char *)&g_smb.template getProp<0>(k) - base; + + ++count; + + ++it; + } + + v_cl.sum(count); + v_cl.execute(); + + BOOST_REQUIRE_EQUAL(count,16*16); + + g_smb.write("g_zm_out"); + } + + { + Box<2,float> domain({-1.0,-1.0,-1.0},{1.0,1.0,1.0}); + + Vcluster<> & v_cl = create_vcluster(); + + if ( v_cl.getProcessingUnits() > 1 ) + {return;} + + // grid size + size_t sz[2]; + sz[0] = 16; + sz[1] = 16; + + // Ghost + Ghost<2,long int> g(0); + + // periodicity + periodicity<2> pr = {{NON_PERIODIC,NON_PERIODIC}}; + + typedef grid_base<2, aggregate<int>> devg; + + // Distributed grid with id decomposition + grid_dist_id_devg<2, float, aggregate<int>,devg> g_smb(sz,domain,g,pr); + + auto it = g_smb.getDomainIterator(); + + size_t count = 0; + + unsigned char * base = (unsigned char *)g_smb.get_loc_grid(0).getPointer<0>(); + + while (it.isNext()) + { + auto k = it.get(); + + g_smb.template getProp<0>(k) = (unsigned char *)&g_smb.template getProp<0>(k) - base; + + ++count; + + ++it; + } + + v_cl.sum(count); + v_cl.execute(); + + BOOST_REQUIRE_EQUAL(count,16*16); + + g_smb.write("g_sm_out"); + } +} + BOOST_AUTO_TEST_CASE( grid_dist_copy_construct ) { // Test grid periodic -- GitLab