diff --git a/package/hpckit/2024.6.30/install.sh b/package/hpckit/2024.6.30/install.sh new file mode 100644 index 0000000000000000000000000000000000000000..08a9bf6bf5aca9283bfc4fa6901deb27c36db4e3 --- /dev/null +++ b/package/hpckit/2024.6.30/install.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e +export hpckit_ver="24.0.RC2" +../meta.sh $1 diff --git a/package/hpckit/meta.sh b/package/hpckit/meta.sh new file mode 100644 index 0000000000000000000000000000000000000000..cf613e92b7b29b0da9409a9f23bcaca0fcd3f7df --- /dev/null +++ b/package/hpckit/meta.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -x +set -e +#hpckit_ver="24.0.RC1" +. ${DOWNLOAD_TOOL} -u https://mirrors.huaweicloud.com/kunpeng/archive/HPC/HPCKit/HPCKit_${hpckit_ver}_Linux-aarch64.tar.gz + +cd $JARVIS_TMP +if [ ! -d HPCKit_${hpckit_ver}_Linux-aarch64 ];then + tar xvf $JARVIS_DOWNLOAD/HPCKit_${hpckit_ver}_Linux-aarch64.tar.gz +fi +cd HPCKit_${hpckit_ver}_Linux-aarch64 +sh install.sh -y --prefix=$1 +echo -e "HPCKit has installed in your environment." +#useage: +#1.source software/utils/hpckit/2024.3.30/HPCKit/latest/setvars.sh --use-bisheng +#2.module purge +#module use software/utils/hpckit/2024.3.30/HPCKit/24.3.30/modulefiles +#module load bisheng/compiler/bishengmodule bisheng/kml/omp diff --git a/package/opari2/2.0.7/install.sh b/package/opari2/2.0.7/install.sh new file mode 100644 index 0000000000000000000000000000000000000000..a818e3c5fd76f7710e6997297c0a903c3bb8d963 --- /dev/null +++ b/package/opari2/2.0.7/install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -x +set -e +szip_ver='2.0.7' +. ${DOWNLOAD_TOOL} -u https://perftools.pages.jsc.fz-juelich.de/cicd/opari2/tags/opari2-2.0.7/opari2-${szip_ver}.tar.gz +cd ${JARVIS_TMP} +tar xvf ${JARVIS_DOWNLOAD}/opari2-${szip_ver}.tar.gz +cd opari2-${szip_ver} +./configure --prefix=$1 +make -j +make install diff --git a/package/otf2/3.0.3/install.sh b/package/otf2/3.0.3/install.sh new file mode 100644 index 0000000000000000000000000000000000000000..c407a4649e8c0aee98ecf71df0ed641da4327092 --- /dev/null +++ b/package/otf2/3.0.3/install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -x +set -e +szip_ver='3.0.3' +. ${DOWNLOAD_TOOL} -u https://perftools.pages.jsc.fz-juelich.de/cicd/otf2/tags/otf2-3.0.3/otf2-${szip_ver}.tar.gz +cd ${JARVIS_TMP} +tar xvf ${JARVIS_DOWNLOAD}/otf2-${szip_ver}.tar.gz +cd otf2-${szip_ver} +./configure --prefix=$1 +make -j +make install diff --git a/templates/relion/3.1.2/data.relion.mini.all.arm.cpu.config b/templates/relion/3.1.2/data.relion.mini.all.arm.cpu.config new file mode 100644 index 0000000000000000000000000000000000000000..56a410b951420df654183315d3bc881bd10d13af --- /dev/null +++ b/templates/relion/3.1.2/data.relion.mini.all.arm.cpu.config @@ -0,0 +1,60 @@ +[SERVER] +11.11.11.11 + +[DOWNLOAD] +relion/3.1.2 https://github.com/3dem/relion/archive/refs/tags/3.1.2.tar.gz relion-3.1.2.tar.gz + +[DEPENDENCY] +module use ./software/modulefiles +module purge +./jarvis -install bisheng/3.2.0-mini com +module add bisheng/3.2.0-mini +export CC=clang CXX=clang++ FC=flang +./jarvis -install wxWidgets/3.0.5 clang +module use ./software/moduledeps/bisheng3.2.0 +module add wxWidgets/3.0.5 +./jarvis -install ctffind/4.1.14/clang clang +./jarvis -install hmpi/2.3.0 clang + +[ENV] +module purge +module use software/modulefiles +module use software/moduledeps/bisheng3.2.0 +module add bisheng/3.2.0-mini +module add wxWidgets/3.0.5 +module add ctffind-clang/4.1.14 +module add hmpi/2.3.0 +export CC=clang CXX=clang++ FC=flang + +[APP] +app_name = relion +build_dir = ${JARVIS_ROOT} +binary_dir = +case_dir = + +[BUILD] +cd ${JARVIS_TMP} +rm -rf relion-3.1.2 +tar -xvf ${JARVIS_DOWNLOAD}/relion-3.1.2.tar.gz +cd relion-3.1.2 +#sed -i "12i set(CMAKE_CXX_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true\")" CMakeLists.txt +#sed -i "12i set(CMAKE_C_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true\")" CMakeLists.txt +#sed -i "14i set(CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +#sed -i "14i set(CMAKE_C_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt + +sed -i "12i set(CMAKE_CXX_FLAGS \"-O3 -march=armv8.2-a -mcpu=tsv110 -ffast-math -g -mllvm -check-trivial-remat-reg-pressure=false -mllvm -enable-prefetch-barrier=false -mllvm -replace-sqrt-compare-by-square=true \")" CMakeLists.txt +sed -i "12i set(CMAKE_C_FLAGS \"-O3 -march=armv8.2-a -mcpu=tsv110 -ffast-math -g -mllvm -check-trivial-remat-reg-pressure=false -mllvm -enable-prefetch-barrier=false -mllvm -replace-sqrt-compare-by-square=true \")" CMakeLists.txt +sed -i "14i set(CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +sed -i "14i set(CMAKE_C_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +mkdir build && cd build +yum install -y libtiff-* fltk* fltk-devel* tbb-devel +yum -y install xorg-x11-xauth +cmake -DCUDA=OFF -DGUI=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=release -DALTCPU=ON -DCMAKE_INSTALL_PREFIX=${JARVIS_ROOT}/software/apps/relion/3.1.2 .. +make -j +make install + + +[RUN] +run = +binary = +nodes = 1 diff --git a/templates/relion/3.1.2/data.relion.mini.all.sve.arm.cpu.config b/templates/relion/3.1.2/data.relion.mini.all.sve.arm.cpu.config new file mode 100644 index 0000000000000000000000000000000000000000..3f15f01201e27a9e3e4e9c4d5436de0b55c12294 --- /dev/null +++ b/templates/relion/3.1.2/data.relion.mini.all.sve.arm.cpu.config @@ -0,0 +1,56 @@ +[SERVER] +11.11.11.11 + +[DOWNLOAD] +relion/3.1.2 https://github.com/3dem/relion/archive/refs/tags/3.1.2.tar.gz relion-3.1.2.tar.gz + +[DEPENDENCY] +module use ./software/modulefiles +module purge +./jarvis -install bisheng/3.2.0-mini com +module add bisheng/3.2.0-mini +export CC=clang CXX=clang++ FC=flang +./jarvis -install wxWidgets/3.0.5 clang +module use ./software/moduledeps/bisheng3.2.0 +module add wxWidgets/3.0.5 +./jarvis -install ctffind/4.1.14/clang clang +./jarvis -install hmpi/2.3.0 clang + +[ENV] +module purge +module use software/modulefiles +module use software/moduledeps/bisheng3.2.0 +module add bisheng/3.2.0-mini +module add wxWidgets/3.0.5 +module add ctffind-clang/4.1.14 +module add hmpi/2.3.0 +export CC=clang CXX=clang++ FC=flang + +[APP] +app_name = relion +build_dir = ${JARVIS_ROOT} +binary_dir = +case_dir = + +[BUILD] +cd ${JARVIS_TMP} +rm -rf relion-3.1.2 +tar -xvf ${JARVIS_DOWNLOAD}/relion-3.1.2.tar.gz +cd relion-3.1.2 + +sed -i "12i set(CMAKE_CXX_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true -march=armv8.2-a -mcpu=tsv110 -ffast-math -g -mllvm -check-trivial-remat-reg-pressure=false -mllvm -enable-prefetch-barrier=false -mllvm -replace-sqrt-compare-by-square=true \")" CMakeLists.txt +sed -i "12i set(CMAKE_C_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true -march=armv8.2-a -mcpu=tsv110 -ffast-math -g -mllvm -check-trivial-remat-reg-pressure=false -mllvm -enable-prefetch-barrier=false -mllvm -replace-sqrt-compare-by-square=true \")" CMakeLists.txt +sed -i "14i set(CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +sed -i "14i set(CMAKE_C_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +mkdir build && cd build +yum install -y libtiff-* fltk* fltk-devel* tbb-devel +yum -y install xorg-x11-xauth +cmake -DCUDA=OFF -DGUI=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=release -DALTCPU=ON -DCMAKE_INSTALL_PREFIX=${JARVIS_ROOT}/software/apps/relion/3.1.2 .. +make -j +make install + + +[RUN] +run = +binary = +nodes = 1 diff --git a/templates/relion/3.1.2/data.relion.mini.altcpu.arm.cpu.config b/templates/relion/3.1.2/data.relion.mini.altcpu.arm.cpu.config new file mode 100644 index 0000000000000000000000000000000000000000..1edd31dfb001afde3c20c23a84f32997eb1ced43 --- /dev/null +++ b/templates/relion/3.1.2/data.relion.mini.altcpu.arm.cpu.config @@ -0,0 +1,60 @@ +[SERVER] +11.11.11.11 + +[DOWNLOAD] +relion/3.1.2 https://github.com/3dem/relion/archive/refs/tags/3.1.2.tar.gz relion-3.1.2.tar.gz + +[DEPENDENCY] +module use ./software/modulefiles +module purge +./jarvis -install bisheng/3.2.0-mini com +module add bisheng/3.2.0-mini +export CC=clang CXX=clang++ FC=flang +./jarvis -install wxWidgets/3.0.5 clang +module use ./software/moduledeps/bisheng3.2.0 +module add wxWidgets/3.0.5 +./jarvis -install ctffind/4.1.14/clang clang +./jarvis -install hmpi/2.3.0 clang + +[ENV] +module purge +module use software/modulefiles +module use software/moduledeps/bisheng3.2.0 +module add bisheng/3.2.0-mini +module add wxWidgets/3.0.5 +module add ctffind-clang/4.1.14 +module add hmpi/2.3.0 +export CC=clang CXX=clang++ FC=flang + +[APP] +app_name = relion +build_dir = ${JARVIS_ROOT} +binary_dir = +case_dir = + +[BUILD] +cd ${JARVIS_TMP} +rm -rf relion-3.1.2 +tar -xvf ${JARVIS_DOWNLOAD}/relion-3.1.2.tar.gz +cd relion-3.1.2 +#sed -i "12i set(CMAKE_CXX_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true\")" CMakeLists.txt +#sed -i "12i set(CMAKE_C_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true\")" CMakeLists.txt +#sed -i "14i set(CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +#sed -i "14i set(CMAKE_C_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt + +#sed -i "12i set(CMAKE_CXX_FLAGS \"-O3 -march=armv8.2-a -mcpu=tsv110 -ffast-math -g -mllvm -check-trivial-remat-reg-pressure=false -mllvm -enable-prefetch-barrier=false -mllvm -replace-sqrt-compare-by-square=true \")" CMakeLists.txt +#sed -i "12i set(CMAKE_C_FLAGS \"-O3 -march=armv8.2-a -mcpu=tsv110 -ffast-math -g -mllvm -check-trivial-remat-reg-pressure=false -mllvm -enable-prefetch-barrier=false -mllvm -replace-sqrt-compare-by-square=true \")" CMakeLists.txt +#sed -i "14i set(CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +#sed -i "14i set(CMAKE_C_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +mkdir build && cd build +yum install -y libtiff-* fltk* fltk-devel* tbb-devel +yum -y install xorg-x11-xauth +cmake -DCUDA=OFF -DGUI=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=release -DALTCPU=ON -DCMAKE_INSTALL_PREFIX=${JARVIS_ROOT}/software/apps/relion/3.1.2 .. +make -j +make install + + +[RUN] +run = +binary = +nodes = 1 diff --git a/templates/relion/3.1.2/data.relion.mini.arm.cpu.config b/templates/relion/3.1.2/data.relion.mini.arm.cpu.config new file mode 100644 index 0000000000000000000000000000000000000000..3db752e95f94faadef70f61f41814ed8eac4269c --- /dev/null +++ b/templates/relion/3.1.2/data.relion.mini.arm.cpu.config @@ -0,0 +1,55 @@ +[SERVER] +11.11.11.11 + +[DOWNLOAD] +relion/3.1.2 https://github.com/3dem/relion/archive/refs/tags/3.1.2.tar.gz relion-3.1.2.tar.gz + +[DEPENDENCY] +module use ./software/modulefiles +module purge +./jarvis -install bisheng/3.2.0-mini com +module add bisheng/3.2.0-mini +export CC=clang CXX=clang++ FC=flang +./jarvis -install wxWidgets/3.0.5 clang +module use ./software/moduledeps/bisheng3.2.0 +module add wxWidgets/3.0.5 +./jarvis -install ctffind/4.1.14/clang clang +./jarvis -install hmpi/2.3.0 clang + +[ENV] +module purge +module use software/modulefiles +module use software/moduledeps/bisheng3.2.0 +module add bisheng/3.2.0-mini +module add wxWidgets/3.0.5 +module add ctffind-clang/4.1.14 +module add hmpi/2.3.0 +export CC=clang CXX=clang++ FC=flang + +[APP] +app_name = relion +build_dir = ${JARVIS_ROOT} +binary_dir = +case_dir = + +[BUILD] +cd ${JARVIS_TMP} +rm -rf relion-3.1.2 +tar -xvf ${JARVIS_DOWNLOAD}/relion-3.1.2.tar.gz +cd relion-3.1.2 +#sed -i "12i set(CMAKE_CXX_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true\")" CMakeLists.txt +#sed -i "12i set(CMAKE_C_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true\")" CMakeLists.txt +#sed -i "14i set(CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +#sed -i "14i set(CMAKE_C_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +mkdir build && cd build +yum install -y libtiff-* fltk* fltk-devel* +yum -y install xorg-x11-xauth +cmake -DCUDA=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=${JARVIS_ROOT}/software/apps/relion/3.1.2 .. +make -j +make install + + +[RUN] +run = +binary = +nodes = 1 diff --git a/templates/relion/3.1.2/data.relion.mini.loop.arm.cpu.config b/templates/relion/3.1.2/data.relion.mini.loop.arm.cpu.config new file mode 100644 index 0000000000000000000000000000000000000000..c1f3983507d0d2734a26c13249402b41cdd1f2a7 --- /dev/null +++ b/templates/relion/3.1.2/data.relion.mini.loop.arm.cpu.config @@ -0,0 +1,61 @@ +[SERVER] +11.11.11.11 + +[DOWNLOAD] +relion/3.1.2 https://github.com/3dem/relion/archive/refs/tags/3.1.2.tar.gz relion-3.1.2.tar.gz + +[DEPENDENCY] +module use ./software/modulefiles +module purge +./jarvis -install bisheng/3.2.0-mini com +module add bisheng/3.2.0-mini +export CC=clang CXX=clang++ FC=flang +./jarvis -install wxWidgets/3.0.5 clang +module use ./software/moduledeps/bisheng3.2.0 +module add wxWidgets/3.0.5 +./jarvis -install ctffind/4.1.14/clang clang +./jarvis -install hmpi/2.3.0 clang + +[ENV] +module purge +module use software/modulefiles +module use software/moduledeps/bisheng3.2.0 +module add bisheng/3.2.0-mini +module add wxWidgets/3.0.5 +module add ctffind-clang/4.1.14 +module add hmpi/2.3.0 +export CC=clang CXX=clang++ FC=flang + +[APP] +app_name = relion +build_dir = ${JARVIS_ROOT} +binary_dir = +case_dir = + +[BUILD] +cd ${JARVIS_TMP} +rm -rf relion-3.1.2 +tar -xvf ${JARVIS_DOWNLOAD}/relion-3.1.2.tar.gz +patch -p0 < ${JARVIS_ROOT}/templates/relion/3.1.2/patch_relion +cd relion-3.1.2 +#sed -i "12i set(CMAKE_CXX_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true\")" CMakeLists.txt +#sed -i "12i set(CMAKE_C_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true\")" CMakeLists.txt +#sed -i "14i set(CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +#sed -i "14i set(CMAKE_C_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt + +#sed -i "12i set(CMAKE_CXX_FLAGS \"-O3 -march=armv8.2-a -mcpu=tsv110 -ffast-math -g -mllvm -check-trivial-remat-reg-pressure=false -mllvm -enable-prefetch-barrier=false -mllvm -replace-sqrt-compare-by-square=true \")" CMakeLists.txt +#sed -i "12i set(CMAKE_C_FLAGS \"-O3 -march=armv8.2-a -mcpu=tsv110 -ffast-math -g -mllvm -check-trivial-remat-reg-pressure=false -mllvm -enable-prefetch-barrier=false -mllvm -replace-sqrt-compare-by-square=true \")" CMakeLists.txt +#sed -i "14i set(CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +#sed -i "14i set(CMAKE_C_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +mkdir build && cd build +yum install -y libtiff-* fltk* fltk-devel* tbb-devel +yum -y install xorg-x11-xauth +cmake -DCUDA=OFF -DGUI=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=release -DALTCPU=ON -DCMAKE_INSTALL_PREFIX=${JARVIS_ROOT}/software/apps/relion/3.1.2 .. +make -j +make install + + +[RUN] +run = +binary = +nodes = 1 diff --git a/templates/relion/3.1.2/data.relion.mini.sve.arm.cpu.config b/templates/relion/3.1.2/data.relion.mini.sve.arm.cpu.config new file mode 100644 index 0000000000000000000000000000000000000000..4072547d97dda7a4a2471374e242be8b95704fc4 --- /dev/null +++ b/templates/relion/3.1.2/data.relion.mini.sve.arm.cpu.config @@ -0,0 +1,55 @@ +[SERVER] +11.11.11.11 + +[DOWNLOAD] +relion/3.1.2 https://github.com/3dem/relion/archive/refs/tags/3.1.2.tar.gz relion-3.1.2.tar.gz + +[DEPENDENCY] +module use ./software/modulefiles +module purge +./jarvis -install bisheng/3.2.0-mini com +module add bisheng/3.2.0-mini +export CC=clang CXX=clang++ FC=flang +./jarvis -install wxWidgets/3.0.5 clang +module use ./software/moduledeps/bisheng3.2.0 +module add wxWidgets/3.0.5 +./jarvis -install ctffind/4.1.14/clang clang +./jarvis -install hmpi/2.3.0 clang + +[ENV] +module purge +module use software/modulefiles +module use software/moduledeps/bisheng3.2.0 +module add bisheng/3.2.0-mini +module add wxWidgets/3.0.5 +module add ctffind-clang/4.1.14 +module add hmpi/2.3.0 +export CC=clang CXX=clang++ FC=flang + +[APP] +app_name = relion +build_dir = ${JARVIS_ROOT} +binary_dir = +case_dir = + +[BUILD] +cd ${JARVIS_TMP} +rm -rf relion-3.1.2 +tar -xvf ${JARVIS_DOWNLOAD}/relion-3.1.2.tar.gz +cd relion-3.1.2 +sed -i "12i set(CMAKE_CXX_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true\")" CMakeLists.txt +sed -i "12i set(CMAKE_C_FLAGS \"-O3 -ffast-math -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true\")" CMakeLists.txt +sed -i "14i set(CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +sed -i "14i set(CMAKE_C_FLAGS_RELEASE \"-O3 -DNDEBUG\")" CMakeLists.txt +mkdir build && cd build +yum install -y libtiff-* fltk* fltk-devel* +yum -y install xorg-x11-xauth +cmake -DCUDA=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=${JARVIS_ROOT}/software/apps/relion/3.1.2 .. +make -j +make install + + +[RUN] +run = +binary = +nodes = 1 diff --git a/templates/relion/3.1.2/patch_relion b/templates/relion/3.1.2/patch_relion new file mode 100644 index 0000000000000000000000000000000000000000..aebf898cb8d7faabce1d57bd81b112c60bc77673 --- /dev/null +++ b/templates/relion/3.1.2/patch_relion @@ -0,0 +1,37 @@ +--- relion-3.1.2/src/multidim_array.h 2021-02-24 18:22:57.000000000 +0800 ++++ relion_new-3.1.2/src/multidim_array.h 2024-04-18 11:36:44.573735000 +0800 +@@ -1151,23 +1151,21 @@ + } + + // Copy needed elements, fill with 0 if necessary ++ long int j_lower_limit = XSIZE(*this) > Xdim ? Xdim : XSIZE(*this); ++ long int j_upper_limit = XSIZE(*this) < Xdim ? Xdim : XSIZE(*this); + for (long int l = 0; l < Ndim; l++) + for (long int k = 0; k < Zdim; k++) + for (long int i = 0; i < Ydim; i++) +- for (long int j = 0; j < Xdim; j++) ++ { ++ for (long int j = 0; j < j_lower_limit; j++) + { +- T val; +- if (k >= ZSIZE(*this)) +- val = 0; +- else if (i >= YSIZE(*this)) +- val = 0; +- else if (j >= XSIZE(*this)) +- val = 0; +- else +- val = DIRECT_A3D_ELEM(*this, k, i, j); +- new_data[l*ZYXdim + k*YXdim+i*Xdim+j] = val; ++ bool flag = (k >= ZSIZE(*this)) || (i >= YSIZE(*this)); ++ new_data[l*ZYXdim + k*YXdim+i*Xdim+j] = flag ? (T)0 : DIRECT_A3D_ELEM(*this,k,i,j); + } +- ++ for(long int j = XSIZE(*this);j < j_upper_limit; j++) + { ++ new_data[l*ZYXdim + k*YXdim+i*Xdim+j] ++ } ++ } + // deallocate old vector + coreDeallocate(); +