Skip to content

Commit

Permalink
Examples: Regenerate WaveCaKernelScript
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder committed Feb 21, 2014
1 parent b5fcbe1 commit 9c28340
Show file tree
Hide file tree
Showing 13 changed files with 302 additions and 353 deletions.
70 changes: 13 additions & 57 deletions Examples/WaveCaKernelScript/cakernel.ccl
@@ -1,77 +1,33 @@
CCTK_CUDA_KERNEL initial_gaussian_calc TYPE=gpu_cuda/3dblock TILE="8,8,8" SHARECODE=yes STENCIL="0,0,0,0,0,0"
CCTK_CUDA_KERNEL initial_gaussian_calc TYPE=gpu_cuda/3dblock TILE="8,8,8" SHARECODE=yes STENCIL="0,0,0,0,0,0" EXTERIOR="0,0,0,0,0,0"
{
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out
{
phi
}
"phi"

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

CCTK_CUDA_KERNEL_VARIABLE cached=no intent=in
{
x
}
"x"

CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out {phi} "phi"
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out {pi} "pi"
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=in {x} "x"
CCTK_CUDA_KERNEL_PARAMETER
{
fdOrder
}
"fdOrder"
}

CCTK_CUDA_KERNEL calc_rhs TYPE=gpu_cuda/3dblock TILE="8,8,8" SHARECODE=yes STENCIL="0,0,0,0,0,0"
CCTK_CUDA_KERNEL calc_rhs TYPE=gpu_cuda/3dblock TILE="8,8,8" SHARECODE=yes STENCIL="0,0,0,0,0,0" EXTERIOR="0,0,0,0,0,0"
{
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out
{
phirhs
}
"phirhs"

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

CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out
{
pirhs
}
"pirhs"

CCTK_CUDA_KERNEL_VARIABLE cached=no intent=in {phi} "phi"
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out {phirhs} "phirhs"
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=in {pi} "pi"
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out {pirhs} "pirhs"
CCTK_CUDA_KERNEL_PARAMETER
{
fdOrder
}
"fdOrder"
}

CCTK_CUDA_KERNEL calc_bound_rhs TYPE=gpu_cuda/3dblock TILE="8,8,8" SHARECODE=yes STENCIL="0,0,0,0,0,0"
CCTK_CUDA_KERNEL calc_bound_rhs TYPE=gpu_cuda/3dblock TILE="8,8,8" SHARECODE=yes STENCIL="0,0,0,0,0,0" EXTERIOR="0,0,0,0,0,0"
{
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out
{
phirhs
}
"phirhs"

CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out
{
pirhs
}
"pirhs"

CCTK_CUDA_KERNEL_VARIABLE cached=no intent=in
{
x
}
"x"

CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out {phirhs} "phirhs"
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=out {pirhs} "pirhs"
CCTK_CUDA_KERNEL_VARIABLE cached=no intent=in {x} "x"
CCTK_CUDA_KERNEL_PARAMETER
{
fdOrder
Expand Down
2 changes: 1 addition & 1 deletion Examples/WaveCaKernelScript/configuration.ccl
Expand Up @@ -4,4 +4,4 @@ REQUIRES GenericFD
OPTIONAL LoopControl
{
}
REQUIRES CUDA
REQUIRES CUDA MPI CaKernel
10 changes: 5 additions & 5 deletions Examples/WaveCaKernelScript/interface.ccl
Expand Up @@ -2,15 +2,15 @@

implements: WaveCaKernelScript

inherits: Grid GenericFD Boundary
inherits: Accelerator Boundary GenericFD Grid



USES INCLUDE: CaCUDALib_driver_support.h
USES INCLUDE: GenericFD.h
USES INCLUDE: loopcontrol.h
USES INCLUDE: Symmetry.h
USES INCLUDE: sbp_calc_coeffs.h
USES INCLUDE: Boundary.h
USES INCLUDE: loopcontrol.h

CCTK_INT FUNCTION MoLRegisterEvolved(CCTK_INT IN EvolvedIndex, CCTK_INT IN RHSIndex)
USES FUNCTION MoLRegisterEvolved
Expand Down Expand Up @@ -40,13 +40,13 @@ CCTK_REAL pi_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorwei
} "pi_group"

public:
CCTK_REAL phi_grouprhs type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
CCTK_REAL phi_grouprhs type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 Prolongation="None"'
{
phirhs
} "phi_grouprhs"

public:
CCTK_REAL pi_grouprhs type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
CCTK_REAL pi_grouprhs type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 Prolongation="None"'
{
pirhs
} "pi_grouprhs"
Expand Down
16 changes: 9 additions & 7 deletions Examples/WaveCaKernelScript/param.ccl
Expand Up @@ -3,6 +3,7 @@

shares: GenericFD

USES CCTK_INT assume_stress_energy_state


shares: MethodOfLines
Expand All @@ -16,10 +17,17 @@ CCTK_INT verbose "verbose" STEERABLE=ALWAYS
*:* :: ""
} 0

restricted:
CCTK_INT other_timelevels "Number of active timelevels for non-evolved grid functions" STEERABLE=RECOVER
{
0:3 :: ""
} 1

restricted:
CCTK_INT fdOrder "fdOrder"
{
*:* :: ""
2 :: ""
4 :: ""
} 2

restricted:
Expand All @@ -46,12 +54,6 @@ CCTK_INT rhs_timelevels "Number of active RHS timelevels" STEERABLE=RECOVER
0:3 :: ""
} 1

restricted:
CCTK_INT other_timelevels "Number of active timelevels for non-evolved grid functions" STEERABLE=RECOVER
{
0:3 :: ""
} 1

restricted:
CCTK_INT initial_gaussian_calc_calc_every "initial_gaussian_calc_calc_every" STEERABLE=ALWAYS
{
Expand Down
84 changes: 23 additions & 61 deletions Examples/WaveCaKernelScript/schedule.ccl
@@ -1,57 +1,13 @@
# File produced by Kranc


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

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

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

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

schedule WaveCaKernelScript_Startup at STARTUP
{
Expand All @@ -65,31 +21,32 @@ schedule WaveCaKernelScript_RegisterSymmetries in SymmetryRegister
OPTIONS: meta
} "register symmetries"

schedule CAKERNEL_Launch_initial_gaussian_calc at initial
schedule CAKERNEL_Launch_initial_gaussian_calc as initial_gaussian_calc at initial
{
LANG: C
TAGS: Device=1
READS: grid::coordinates
WRITES: WaveCaKernelScript::phi_group
WRITES: WaveCaKernelScript::pi_group
READS: grid::x(Everywhere)
WRITES: WaveCaKernelScript::phi(ERROR(Automatic))
WRITES: WaveCaKernelScript::pi(ERROR(Automatic))
} "initial_gaussian_calc"

schedule CAKERNEL_Launch_calc_rhs in MoL_CalcRHS
schedule CAKERNEL_Launch_calc_rhs as calc_rhs in MoL_CalcRHS
{
LANG: C
TAGS: Device=1
READS: WaveCaKernelScript::pi_group
WRITES: WaveCaKernelScript::phi_grouprhs
WRITES: WaveCaKernelScript::pi_grouprhs
READS: WaveCaKernelScript::phi(Everywhere)
READS: WaveCaKernelScript::pi(Everywhere)
WRITES: WaveCaKernelScript::phirhs(ERROR(Automatic))
WRITES: WaveCaKernelScript::pirhs(ERROR(Automatic))
} "calc_rhs"

schedule CAKERNEL_Launch_calc_bound_rhs in MoL_RHSBoundaries
schedule CAKERNEL_Launch_calc_bound_rhs as calc_bound_rhs in MoL_RHSBoundaries
{
LANG: C
TAGS: Device=1
READS: grid::coordinates
WRITES: WaveCaKernelScript::phi_grouprhs
WRITES: WaveCaKernelScript::pi_grouprhs
READS: grid::x(Everywhere)
WRITES: WaveCaKernelScript::phirhs(ERROR(Automatic))
WRITES: WaveCaKernelScript::pirhs(ERROR(Automatic))
} "calc_bound_rhs"

schedule WaveCaKernelScript_SelectBoundConds in MoL_PostStep
Expand All @@ -112,7 +69,12 @@ schedule WaveCaKernelScript_RegisterVars in MoL_Register
OPTIONS: meta
} "Register Variables for MoL"

schedule WaveCaKernelScript_Init in CCTK_BASEGRID after Accelerator_SetDevice
{
LANG: C
OPTIONS: local
} "Initialize CUDA Device"

schedule group ApplyBCs as WaveCaKernelScript_ApplyBCs in MoL_PostStep after WaveCaKernelScript_SelectBoundConds
{
# no language specified
} "Apply boundary conditions controlled by thorn Boundary"
18 changes: 9 additions & 9 deletions Examples/WaveCaKernelScript/src/Boundaries.cc
Expand Up @@ -30,7 +30,7 @@ extern "C" void WaveCaKernelScript_SelectBoundConds(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;

CCTK_INT ierr = 0;
CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;

if (CCTK_EQUALS(phi_group_bound, "none" ) ||
CCTK_EQUALS(phi_group_bound, "static") ||
Expand Down Expand Up @@ -79,7 +79,7 @@ extern "C" void WaveCaKernelScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(phi_group_bound, "radiative"))
{
/* select radiation boundary condition */
static CCTK_INT handle_phi_group_bound = -1;
static CCTK_INT handle_phi_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_phi_group_bound < 0) handle_phi_group_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_phi_group_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_phi_group_bound , phi_group_bound_limit, "LIMIT") < 0)
Expand All @@ -98,7 +98,7 @@ extern "C" void WaveCaKernelScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(pi_group_bound, "radiative"))
{
/* select radiation boundary condition */
static CCTK_INT handle_pi_group_bound = -1;
static CCTK_INT handle_pi_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_pi_group_bound < 0) handle_pi_group_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_pi_group_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_pi_group_bound , pi_group_bound_limit, "LIMIT") < 0)
Expand All @@ -117,7 +117,7 @@ extern "C" void WaveCaKernelScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(phi_bound, "radiative"))
{
/* select radiation boundary condition */
static CCTK_INT handle_phi_bound = -1;
static CCTK_INT handle_phi_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_phi_bound < 0) handle_phi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_phi_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_phi_bound , phi_bound_limit, "LIMIT") < 0)
Expand All @@ -136,7 +136,7 @@ extern "C" void WaveCaKernelScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(pi_bound, "radiative"))
{
/* select radiation boundary condition */
static CCTK_INT handle_pi_bound = -1;
static CCTK_INT handle_pi_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_pi_bound < 0) handle_pi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_pi_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_pi_bound , pi_bound_limit, "LIMIT") < 0)
Expand All @@ -155,7 +155,7 @@ extern "C" void WaveCaKernelScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(phi_group_bound, "scalar"))
{
/* select scalar boundary condition */
static CCTK_INT handle_phi_group_bound = -1;
static CCTK_INT handle_phi_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_phi_group_bound < 0) handle_phi_group_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_phi_group_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_phi_group_bound ,phi_group_bound_scalar, "SCALAR") < 0)
Expand All @@ -172,7 +172,7 @@ extern "C" void WaveCaKernelScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(pi_group_bound, "scalar"))
{
/* select scalar boundary condition */
static CCTK_INT handle_pi_group_bound = -1;
static CCTK_INT handle_pi_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_pi_group_bound < 0) handle_pi_group_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_pi_group_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_pi_group_bound ,pi_group_bound_scalar, "SCALAR") < 0)
Expand All @@ -189,7 +189,7 @@ extern "C" void WaveCaKernelScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(phi_bound, "scalar"))
{
/* select scalar boundary condition */
static CCTK_INT handle_phi_bound = -1;
static CCTK_INT handle_phi_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_phi_bound < 0) handle_phi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_phi_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_phi_bound ,phi_bound_scalar, "SCALAR") < 0)
Expand All @@ -206,7 +206,7 @@ extern "C" void WaveCaKernelScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(pi_bound, "scalar"))
{
/* select scalar boundary condition */
static CCTK_INT handle_pi_bound = -1;
static CCTK_INT handle_pi_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_pi_bound < 0) handle_pi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_pi_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_pi_bound ,pi_bound_scalar, "SCALAR") < 0)
Expand Down

0 comments on commit 9c28340

Please sign in to comment.