Loading CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ endif() # set Debug/Release options set( CMAKE_CXX_FLAGS "-std=c++11" ) set( CMAKE_CXX_FLAGS_DEBUG "-g" ) set( CMAKE_CXX_FLAGS_RELEASE "-O0 -march=native -DNDEBUG" ) set( CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG" ) #set( CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG -ftree-vectorizer-verbose=1 -ftree-vectorize -fopt-info-vec-missed -funroll-loops" ) # pass -rdynamic only in Debug mode set( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "" ) Loading @@ -54,7 +54,7 @@ set( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_RELEASE "" ) get_filename_component( CXX_COMPILER_NAME ${CMAKE_CXX_COMPILER} NAME ) if( CXX_COMPILER_NAME MATCHES "icpc" ) message( "Intel compiler detected..." ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_ICPC -wd2568 -wd2571 -wd2570 -rdynamic") set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_ICPC -wd2568 -wd2571 -wd2570") endif() ##### Loading netbeans_build.sh +1 −0 Original line number Diff line number Diff line #!/bin/bash module load gcc-5.3.0 cmake-3.4.3 intel_parallel_studio_ex-2016.1 cd Debug #make -j 6 tnlSatanExperimentalTest-dbg #make -j 6 tnlSatanMICVectorExperimentalTest-dbg #make -j 6 tnl-image-converter-dbg Loading netbeans_run_debug_satanexperimental.sh +32 −24 Original line number Diff line number Diff line #!/bin/bash module load gcc-5.3.0 cmake-3.4.3 intel_parallel_studio_ex-2016.1 cd Debug/bin #export OFFLOAD_REPORT=2 #./tnlSatanExperimentalTest-dbg #./tnlSatanExperimentalTest-dbg #./tnlSatanMICVectorExperimentalTest-dbg dofSize=64 function heat_eq { dofSize=256 dimension=2; proportions=1 proportions=4 origin="-2" analyticFunction="exp-bump" analyticFunction="sin-bumps" timeFunction="cosinus" amplitude=1.0 Loading @@ -29,18 +24,18 @@ phaseY=0.0 phaseZ=0.0 sigma=1.0 ./tnl-grid-setup-dbg --dimensions ${dimension} \ ./tnl-grid-setup --dimensions ${dimension} \ --proportions-x ${proportions} \ --proportions-y ${proportions} \ --proportions-z ${proportions} \ --origin-x 0 \ --origin-y 0 \ --origin-z 0 \ --origin-x ${origin} \ --origin-y ${origin} \ --origin-z ${origin} \ --size-x ${dofSize} \ --size-y ${dofSize} \ --size-z ${dofSize} \ ./tnl-init-dbg --mesh mesh.tnl \ ./tnl-init --mesh mesh.tnl \ --test-function ${analyticFunction} \ --output-file initial.tnl \ --amplitude ${amplitude} \ Loading @@ -60,15 +55,15 @@ sigma=1.0 mv ./initial.tnl init.tnl ./tnl-heat-equation-dbg --device mic --time-discretisation explicit \ time ./tnl-heat-equation --device mic --time-discretisation explicit \ --boundary-conditions-type dirichlet \ --boundary-conditions-constant 0.5 \ --boundary-conditions-constant 0.0 \ --discrete-solver euler \ --snapshot-period 0.0005 \ --final-time 0.1 \ --time-step 0.00005 --final-time 0.04 \ --time-step 0.00005 #|grep Offload |grep Time | cut -d ']' -f5|cut -d '(' -f1| ./a.out ./tnl-view-dbg --mesh mesh.tnl \ ./tnl-view --mesh mesh.tnl \ --input-files *.tnl \ seznam=`ls u-*.gplt` Loading @@ -77,16 +72,29 @@ for fname in $seznam ; do echo "Drawing $fname" gnuplot << EOF set terminal unknown set pm3d set data style lines #set view 33,33 #3D #unset xtics #unset ytics #unset ztics unset border set output '$fname.png' set yrange [-1.2:1.2] set zrange [0.4:1.1] #set yrange [-1.2:1.2] set zrange [-1.1:1.1] set terminal png set title "Numerical solution" splot '$fname' with line EOF done } module load gcc-5.3.0 cmake-3.4.3 intel_parallel_studio_ex-2016.1 cd Release/bin export OFFLOAD_REPORT=0 #./tnlSatanExperimentalTest-dbg #./tnlSatanExperimentalTest-dbg # ./tnlSatanMICVectorExperimentalTest-dbg heat_eq src/core/tnlAssert.h +17 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,12 @@ #include <iostream> #include <stdlib.h> #include <assert.h> #include <execinfo.h> #include <string.h> #include <cxxabi.h> #include <stdlib.h> #ifdef HAVE_CUDA #define tnlAssert( ___tnl__assert_condition, ___tnl__assert_command ) \ Loading Loading @@ -57,7 +62,17 @@ { \ std::cerr<<"=============BACKTRACE===================="<<std::endl; \ for(int i=0;i<nptrs;i++) \ std::cerr << strings[i]<<std::endl; \ { \ char *fce=strchr(strings[i],'+'); \ *fce='\0'; \ fce=strchr(strings[i],'('); \ fce++; \ int status; \ char *realname; \ realname = abi::__cxa_demangle(fce, 0, 0, &status); \ std::cout << realname <<std::endl <<std::endl; \ free(realname); \ } \ free(strings); \ } \ ___tnl__assert_command; \ Loading src/core/tnlMIC.h +23 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <core/tnlDevice.h> #include <core/tnlDevice_Callable.h> #include <string.h> #include <stdint.h> #ifndef TNLMIC_H Loading @@ -32,6 +33,26 @@ struct satanHider{ Type *pointer; }; template <unsigned int VELIKOST> struct satanstruct{ uint8_t data[VELIKOST]; }; #define TNLMICSTRUCT(bb,typ) satanstruct<sizeof(typ)> s ## bb; \ memcpy((void*)& s ## bb,(void*)& bb,sizeof(typ)); #define TNLMICSTRUCTOFF(bb,typ) s ## bb #define TNLMICSTRUCTUSE(bb,typ) typ * kernel ## bb = (typ*) &s ## bb; #define TNLMICSTRUCTALLOC(bb,typ) typ * kernel ## bb = (typ*) malloc (sizeof(typ)); \ memcpy((void*)kernel ## bb,(void*) & s ## bb, sizeof(typ)); #define TNLMICHIDE(bb,typ) uint8_t * u ## bb=(uint8_t *)&bb; \ satanHider<typ> kernel ## bb; #define TNLMICHIDEALLOCOFF(bb,typ) in(u ## bb:length(sizeof(typ))) out(kernel ## bb) #define TNLMICHIDEALLOC(bb,typ) kernel ## bb.pointer=(typ*)malloc(sizeof(typ)); \ memcpy((void*)kernel ## bb.pointer,(void*)u ## bb,sizeof(typ)); #define TNLMICHIDEFREEOFF(bb,typ) in(kernel ## bb) #define TNLMICHIDEFREE(bb,typ) free((void*)kernel ## bb.pointer); class tnlMIC { Loading Loading @@ -102,6 +123,8 @@ class tnlMIC memcpy((void*)ret.pointer,(void*)uk,sizeof(TYP)); } return ret.pointer; cout << "Někdo mně volá :-D" <<endl; } template <typename TYP> Loading Loading
CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ endif() # set Debug/Release options set( CMAKE_CXX_FLAGS "-std=c++11" ) set( CMAKE_CXX_FLAGS_DEBUG "-g" ) set( CMAKE_CXX_FLAGS_RELEASE "-O0 -march=native -DNDEBUG" ) set( CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG" ) #set( CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG -ftree-vectorizer-verbose=1 -ftree-vectorize -fopt-info-vec-missed -funroll-loops" ) # pass -rdynamic only in Debug mode set( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "" ) Loading @@ -54,7 +54,7 @@ set( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_RELEASE "" ) get_filename_component( CXX_COMPILER_NAME ${CMAKE_CXX_COMPILER} NAME ) if( CXX_COMPILER_NAME MATCHES "icpc" ) message( "Intel compiler detected..." ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_ICPC -wd2568 -wd2571 -wd2570 -rdynamic") set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_ICPC -wd2568 -wd2571 -wd2570") endif() ##### Loading
netbeans_build.sh +1 −0 Original line number Diff line number Diff line #!/bin/bash module load gcc-5.3.0 cmake-3.4.3 intel_parallel_studio_ex-2016.1 cd Debug #make -j 6 tnlSatanExperimentalTest-dbg #make -j 6 tnlSatanMICVectorExperimentalTest-dbg #make -j 6 tnl-image-converter-dbg Loading
netbeans_run_debug_satanexperimental.sh +32 −24 Original line number Diff line number Diff line #!/bin/bash module load gcc-5.3.0 cmake-3.4.3 intel_parallel_studio_ex-2016.1 cd Debug/bin #export OFFLOAD_REPORT=2 #./tnlSatanExperimentalTest-dbg #./tnlSatanExperimentalTest-dbg #./tnlSatanMICVectorExperimentalTest-dbg dofSize=64 function heat_eq { dofSize=256 dimension=2; proportions=1 proportions=4 origin="-2" analyticFunction="exp-bump" analyticFunction="sin-bumps" timeFunction="cosinus" amplitude=1.0 Loading @@ -29,18 +24,18 @@ phaseY=0.0 phaseZ=0.0 sigma=1.0 ./tnl-grid-setup-dbg --dimensions ${dimension} \ ./tnl-grid-setup --dimensions ${dimension} \ --proportions-x ${proportions} \ --proportions-y ${proportions} \ --proportions-z ${proportions} \ --origin-x 0 \ --origin-y 0 \ --origin-z 0 \ --origin-x ${origin} \ --origin-y ${origin} \ --origin-z ${origin} \ --size-x ${dofSize} \ --size-y ${dofSize} \ --size-z ${dofSize} \ ./tnl-init-dbg --mesh mesh.tnl \ ./tnl-init --mesh mesh.tnl \ --test-function ${analyticFunction} \ --output-file initial.tnl \ --amplitude ${amplitude} \ Loading @@ -60,15 +55,15 @@ sigma=1.0 mv ./initial.tnl init.tnl ./tnl-heat-equation-dbg --device mic --time-discretisation explicit \ time ./tnl-heat-equation --device mic --time-discretisation explicit \ --boundary-conditions-type dirichlet \ --boundary-conditions-constant 0.5 \ --boundary-conditions-constant 0.0 \ --discrete-solver euler \ --snapshot-period 0.0005 \ --final-time 0.1 \ --time-step 0.00005 --final-time 0.04 \ --time-step 0.00005 #|grep Offload |grep Time | cut -d ']' -f5|cut -d '(' -f1| ./a.out ./tnl-view-dbg --mesh mesh.tnl \ ./tnl-view --mesh mesh.tnl \ --input-files *.tnl \ seznam=`ls u-*.gplt` Loading @@ -77,16 +72,29 @@ for fname in $seznam ; do echo "Drawing $fname" gnuplot << EOF set terminal unknown set pm3d set data style lines #set view 33,33 #3D #unset xtics #unset ytics #unset ztics unset border set output '$fname.png' set yrange [-1.2:1.2] set zrange [0.4:1.1] #set yrange [-1.2:1.2] set zrange [-1.1:1.1] set terminal png set title "Numerical solution" splot '$fname' with line EOF done } module load gcc-5.3.0 cmake-3.4.3 intel_parallel_studio_ex-2016.1 cd Release/bin export OFFLOAD_REPORT=0 #./tnlSatanExperimentalTest-dbg #./tnlSatanExperimentalTest-dbg # ./tnlSatanMICVectorExperimentalTest-dbg heat_eq
src/core/tnlAssert.h +17 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,12 @@ #include <iostream> #include <stdlib.h> #include <assert.h> #include <execinfo.h> #include <string.h> #include <cxxabi.h> #include <stdlib.h> #ifdef HAVE_CUDA #define tnlAssert( ___tnl__assert_condition, ___tnl__assert_command ) \ Loading Loading @@ -57,7 +62,17 @@ { \ std::cerr<<"=============BACKTRACE===================="<<std::endl; \ for(int i=0;i<nptrs;i++) \ std::cerr << strings[i]<<std::endl; \ { \ char *fce=strchr(strings[i],'+'); \ *fce='\0'; \ fce=strchr(strings[i],'('); \ fce++; \ int status; \ char *realname; \ realname = abi::__cxa_demangle(fce, 0, 0, &status); \ std::cout << realname <<std::endl <<std::endl; \ free(realname); \ } \ free(strings); \ } \ ___tnl__assert_command; \ Loading
src/core/tnlMIC.h +23 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <core/tnlDevice.h> #include <core/tnlDevice_Callable.h> #include <string.h> #include <stdint.h> #ifndef TNLMIC_H Loading @@ -32,6 +33,26 @@ struct satanHider{ Type *pointer; }; template <unsigned int VELIKOST> struct satanstruct{ uint8_t data[VELIKOST]; }; #define TNLMICSTRUCT(bb,typ) satanstruct<sizeof(typ)> s ## bb; \ memcpy((void*)& s ## bb,(void*)& bb,sizeof(typ)); #define TNLMICSTRUCTOFF(bb,typ) s ## bb #define TNLMICSTRUCTUSE(bb,typ) typ * kernel ## bb = (typ*) &s ## bb; #define TNLMICSTRUCTALLOC(bb,typ) typ * kernel ## bb = (typ*) malloc (sizeof(typ)); \ memcpy((void*)kernel ## bb,(void*) & s ## bb, sizeof(typ)); #define TNLMICHIDE(bb,typ) uint8_t * u ## bb=(uint8_t *)&bb; \ satanHider<typ> kernel ## bb; #define TNLMICHIDEALLOCOFF(bb,typ) in(u ## bb:length(sizeof(typ))) out(kernel ## bb) #define TNLMICHIDEALLOC(bb,typ) kernel ## bb.pointer=(typ*)malloc(sizeof(typ)); \ memcpy((void*)kernel ## bb.pointer,(void*)u ## bb,sizeof(typ)); #define TNLMICHIDEFREEOFF(bb,typ) in(kernel ## bb) #define TNLMICHIDEFREE(bb,typ) free((void*)kernel ## bb.pointer); class tnlMIC { Loading Loading @@ -102,6 +123,8 @@ class tnlMIC memcpy((void*)ret.pointer,(void*)uk,sizeof(TYP)); } return ret.pointer; cout << "Někdo mně volá :-D" <<endl; } template <typename TYP> Loading