Skip to content

Commit

Permalink
Replace SimpleWaveCaKernel with WaveCaKernel
Browse files Browse the repository at this point in the history
This script now generates WaveCaKernel and WaveHost which do the same
thing, one using CaKernel and one using the host.  This allows easy
cross-comparison between the two methods.
  • Loading branch information
ianhinder committed Mar 15, 2012
1 parent 7840f15 commit fa52744
Show file tree
Hide file tree
Showing 34 changed files with 1,517 additions and 193 deletions.
118 changes: 0 additions & 118 deletions Examples/SimpleWaveCaKernel/schedule.ccl

This file was deleted.

File renamed without changes.
Expand Up @@ -25,21 +25,6 @@ CCTK_CUDA_KERNEL calc_rhs TYPE=gpu_cuda/3dblock TILE="8,8,8" SHARECODE=yes STENC
"pirhs"
}

CCTK_CUDA_KERNEL copy_to_device TYPE=gpu_cuda/3dblock TILE="8,8,8" SHARECODE=yes STENCIL="0,0,0,0,0,0"
{
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=inout
{
phi
}
"phi"

CCTK_CUDA_KERNEL_VARIABLE cached=no intent=inout
{
pi
}
"pi"
}

CCTK_CUDA_KERNEL calc_bound_rhs TYPE=gpu_cuda/boundary TILE="8,8,8" SHARECODE=yes
{
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out
Expand All @@ -61,3 +46,18 @@ CCTK_CUDA_KERNEL calc_bound_rhs TYPE=gpu_cuda/boundary TILE="8,8,8" SHARECODE=ye
"xCopy"
}

CCTK_CUDA_KERNEL copy_to_device TYPE=gpu_cuda/3dblock TILE="8,8,8" SHARECODE=yes STENCIL="0,0,0,0,0,0"
{
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=inout
{
phi
}
"phi"

CCTK_CUDA_KERNEL_VARIABLE cached=no intent=inout
{
pi
}
"pi"
}

File renamed without changes.
@@ -1,6 +1,6 @@
# File produced by Kranc

implements: SimpleWaveCaKernel
implements: WaveCaKernel

inherits: Grid GenericFD Boundary

Expand Down
Expand Up @@ -17,13 +17,13 @@ CCTK_INT verbose "verbose" STEERABLE=ALWAYS
} 0

restricted:
CCTK_INT SimpleWaveCaKernel_MaxNumEvolvedVars "Number of evolved variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Evolved_Vars STEERABLE=RECOVER
CCTK_INT WaveCaKernel_MaxNumEvolvedVars "Number of evolved variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Evolved_Vars STEERABLE=RECOVER
{
2:2 :: "Number of evolved variables used by this thorn"
} 2

restricted:
CCTK_INT SimpleWaveCaKernel_MaxNumArrayEvolvedVars "Number of Array evolved variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_ArrayEvolved_Vars STEERABLE=RECOVER
CCTK_INT WaveCaKernel_MaxNumArrayEvolvedVars "Number of Array evolved variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_ArrayEvolved_Vars STEERABLE=RECOVER
{
0:0 :: "Number of Array evolved variables used by this thorn"
} 0
Expand Down Expand Up @@ -59,13 +59,13 @@ CCTK_INT calc_rhs_calc_every "calc_rhs_calc_every" STEERABLE=ALWAYS
} 1

restricted:
CCTK_INT copy_to_device_calc_every "copy_to_device_calc_every" STEERABLE=ALWAYS
CCTK_INT calc_bound_rhs_calc_every "calc_bound_rhs_calc_every" STEERABLE=ALWAYS
{
*:* :: ""
} 1

restricted:
CCTK_INT calc_bound_rhs_calc_every "calc_bound_rhs_calc_every" STEERABLE=ALWAYS
CCTK_INT copy_to_device_calc_every "copy_to_device_calc_every" STEERABLE=ALWAYS
{
*:* :: ""
} 1
Expand All @@ -83,13 +83,13 @@ CCTK_INT calc_rhs_calc_offset "calc_rhs_calc_offset" STEERABLE=ALWAYS
} 0

restricted:
CCTK_INT copy_to_device_calc_offset "copy_to_device_calc_offset" STEERABLE=ALWAYS
CCTK_INT calc_bound_rhs_calc_offset "calc_bound_rhs_calc_offset" STEERABLE=ALWAYS
{
*:* :: ""
} 0

restricted:
CCTK_INT calc_bound_rhs_calc_offset "calc_bound_rhs_calc_offset" STEERABLE=ALWAYS
CCTK_INT copy_to_device_calc_offset "copy_to_device_calc_offset" STEERABLE=ALWAYS
{
*:* :: ""
} 0
Expand Down
141 changes: 141 additions & 0 deletions Examples/WaveCaKernel/schedule.ccl
@@ -0,0 +1,141 @@
# File produced by Kranc


if (other_timelevels == 1)
{
STORAGE: xCopy_g[1]
}

if (timelevels == 1)
{
STORAGE: phi_g[1]
}
if (timelevels == 2)
{
STORAGE: phi_g[2]
}

if (timelevels == 1)
{
STORAGE: pi_g[1]
}
if (timelevels == 2)
{
STORAGE: pi_g[2]
}

if (rhs_timelevels == 1)
{
STORAGE: phi_grhs[1]
}
if (rhs_timelevels == 2)
{
STORAGE: phi_grhs[2]
}

if (rhs_timelevels == 1)
{
STORAGE: pi_grhs[1]
}
if (rhs_timelevels == 2)
{
STORAGE: pi_grhs[2]
}

schedule WaveCaKernel_Startup at STARTUP
{
LANG: C
OPTIONS: meta
} "create banner"

schedule WaveCaKernel_RegisterSymmetries in SymmetryRegister
{
LANG: C
OPTIONS: meta
} "register symmetries"

schedule initial_gaussian AT INITIAL
{
LANG: C
READS: grid::coordinates
WRITES: WaveCaKernel::phi_g
WRITES: WaveCaKernel::pi_g
WRITES: WaveCaKernel::xCopy_g
} "initial_gaussian"

schedule CAKERNEL_Launch_calc_rhs in MoL_CalcRHS
{
LANG: C
TAGS: Device=1
READS: WaveCaKernel::phi_g
READS: WaveCaKernel::pi_g
WRITES: WaveCaKernel::phi_grhs
WRITES: WaveCaKernel::pi_grhs
} "calc_rhs"

schedule CAKERNEL_Launch_calc_rhs at ANALYSIS
{
LANG: C
SYNC: phi_grhs
SYNC: pi_grhs
TAGS: Device=1
READS: WaveCaKernel::phi_g
READS: WaveCaKernel::pi_g
WRITES: WaveCaKernel::phi_grhs
WRITES: WaveCaKernel::pi_grhs
} "calc_rhs"

schedule CAKERNEL_Launch_calc_bound_rhs in MoL_RHSBoundaries
{
LANG: C
TAGS: Device=1
READS: WaveCaKernel::xCopy_g
WRITES: WaveCaKernel::phi_grhs
WRITES: WaveCaKernel::pi_grhs
} "calc_bound_rhs"

schedule CAKERNEL_Launch_calc_bound_rhs at ANALYSIS
{
LANG: C
SYNC: phi_grhs
SYNC: pi_grhs
TAGS: Device=1
READS: WaveCaKernel::xCopy_g
WRITES: WaveCaKernel::phi_grhs
WRITES: WaveCaKernel::pi_grhs
} "calc_bound_rhs"

schedule CAKERNEL_Launch_copy_to_device at INITIAL after initial_gaussian
{
LANG: C
TAGS: Device=1
READS: WaveCaKernel::phi_g
READS: WaveCaKernel::pi_g
WRITES: WaveCaKernel::phi_g
WRITES: WaveCaKernel::pi_g
} "copy_to_device"

schedule WaveCaKernel_SelectBoundConds in MoL_PostStep
{
LANG: C
OPTIONS: level
SYNC: phi_g
SYNC: pi_g
} "select boundary conditions"

schedule WaveCaKernel_CheckBoundaries at BASEGRID
{
LANG: C
OPTIONS: meta
} "check boundaries treatment"

schedule WaveCaKernel_RegisterVars in MoL_Register
{
LANG: C
OPTIONS: meta
} "Register Variables for MoL"

schedule group ApplyBCs as WaveCaKernel_ApplyBCs in MoL_PostStep after WaveCaKernel_SelectBoundConds
{
# no language specified
} "Apply boundary conditions controlled by thorn Boundary"

0 comments on commit fa52744

Please sign in to comment.