Commit c67ededc authored by Vít Hanousek's avatar Vít Hanousek
Browse files

Prvni Implementace Eulera na MIC.

	Seriove
	jen 2D
	používá pomalé operace: pass to MIC, free from MIC

Dále asi nepujde zkompilovat celé TNL, kvuli __cuda_callable__ == __device_callable__ a nezakrytí MIC částí kódu pomocí HAVE_MIC.
parent ebdfc4cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 -ww2568 -wd2571")	
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_ICPC -wd2568 -wd2571 -wd2570 -rdynamic")	
endif()

#####
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ ELSE( BUILD_CUDA )
   ADD_EXECUTABLE(tnl-heat-equation-eoc-test${debugExt} tnl-heat-equation-eoc.cpp)   
   target_link_libraries (tnl-heat-equation${debugExt} tnl${debugExt}-${tnlVersion} )
   target_link_libraries (tnl-heat-equation-eoc-test${debugExt} tnl${debugExt}-${tnlVersion} )
   TARGET_COMPILE_DEFINITIONS( tnl-heat-equation${debugExt} PUBLIC -DHAVE_MIC )
   TARGET_COMPILE_DEFINITIONS( tnl-heat-equation-eoc-test${debugExt} PUBLIC -DHAVE_MIC )
ENDIF( BUILD_CUDA )


+3 −2
Original line number Diff line number Diff line
@@ -2,5 +2,6 @@

module load gcc-5.3.0 cmake-3.4.3 intel_parallel_studio_ex-2016.1
#make -j 6 tnlSatanExperimentalTest-dbg
make -j 6 tnlSatanMICVectorExperimentalTest-dbg
#make -j 6 tnlSatanMICVectorExperimentalTest-dbg
#make -j 6 tnl-image-converter-dbg
make -j 6 tnl-heat-equation-dbg
 No newline at end of file
+87 −2
Original line number Diff line number Diff line
@@ -2,6 +2,91 @@

module load gcc-5.3.0 cmake-3.4.3 intel_parallel_studio_ex-2016.1
cd Debug/bin
#OFFLOAD_REPORT=2 ./tnlSatanExperimentalTest-dbg
#export OFFLOAD_REPORT=2 
#./tnlSatanExperimentalTest-dbg
./tnlSatanMICVectorExperimentalTest-dbg
 No newline at end of file
#./tnlSatanExperimentalTest-dbg
#./tnlSatanMICVectorExperimentalTest-dbg

dofSize=64
dimension=2;
proportions=1

analyticFunction="exp-bump"
timeFunction="cosinus"

amplitude=1.0
waveLength=1.0
waveLengthX=1.0
waveLengthY=1.0
waveLengthZ=1.0
wavesNumber=0.0
wavesNumberX=0.0
wavesNumberY=0.0
wavesNumberZ=0.0
phase=0.0
phaseX=0.0
phaseY=0.0
phaseZ=0.0
sigma=1.0

./tnl-grid-setup-dbg --dimensions ${dimension} \
               --proportions-x ${proportions} \
               --proportions-y ${proportions} \
               --proportions-z ${proportions} \
               --origin-x 0 \
               --origin-y 0 \
               --origin-z 0 \
               --size-x ${dofSize} \
               --size-y ${dofSize} \
               --size-z ${dofSize} \

./tnl-init-dbg --mesh mesh.tnl \
         --test-function ${analyticFunction} \
         --output-file initial.tnl \
         --amplitude ${amplitude} \
         --wave-length ${waveLength} \
         --wave-length-x ${waveLengthX} \
         --wave-length-y ${waveLengthY} \
         --wave-length-z ${waveLengthZ} \
             --waves-number ${wavesNumber} \
             --waves-number-x ${wavesNumberX} \
             --waves-number-y ${wavesNumberY} \
             --waves-number-z ${wavesNumberZ} \
             --phase ${phase} \
             --phase-x ${phaseX} \
             --phase-y ${phaseY} \
             --phase-z ${phaseZ} \
             --sigma ${sigma} \

mv ./initial.tnl init.tnl

./tnl-heat-equation-dbg --device mic --time-discretisation explicit \
                  --boundary-conditions-type dirichlet \
                  --boundary-conditions-constant 0.5 \
                  --discrete-solver euler \
                  --snapshot-period 0.0005 \
                  --final-time 0.1 \
                  --time-step 0.000001

 ./tnl-view-dbg --mesh mesh.tnl \
          --input-files *.tnl \ 

seznam=`ls u-*.gplt`

for fname in $seznam ; do
   echo "Drawing $fname"
 gnuplot << EOF
     set terminal unknown
     #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 terminal png
     set title "Numerical solution" 
     splot '$fname' with line 
EOF
done
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -19,13 +19,13 @@
#define TNLARRAY_H_

#include <core/tnlObject.h>
#include <core/arrays/tnlSharedArray.h>
#include <core/arrays/tnlStaticArray.h>

class tnlFile;
class tnlHost;

template< typename Element, typename Device, typename Index >
class tnlSharedArray;
//template< typename Element, typename Device, typename Index >
//class tnlSharedArray;

/****
 * Array handles memory allocation and sharing of the same data between more Arrays.
Loading