rdwr.pl does not correct declare READS (only) variables are const

Create issue
Issue #2358 resolved
Roland Haas created an issue

Variables that are READS only are supposed to be declared const, however this seems to not happen and a schedule block

SCHEDULE TestReadWrite_TestC_C AT initial AFTER TestReadWrite_TestC_B
{
  WrITES: TestReadWrite::varpastlevelc
  WRITES: grouppastlevelc
  ReADs: Var1
  READS: TestReadWriteImp::Var1_p
  READs: var2
  READs: TestReadWrite::groupvar1
  # in XXX this does not accept bare "groupvar2" and CST's hint read:
  # HINT:  Did you mean testreadwrite::testgroup?  Did you mean testreadwriteimp::testgroup?
  READS: testreadwriteimp::groupvar2
  READs: testreadwriteimp::testgroup_p_p
  WrITES: VarCurrentLevelC, GroupCurrentLevelC

  LANG: C
} "Record results in grid scalars"

lets this code compile

extern "C"
void TestReadWrite_TestC_C(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS_TestReadWrite_TestC_C;

  *VarCurrentLevelC = Var1[0] == 42. && Var2[0] == 45.;
  *GroupCurrentLevelC = groupVar1[0] == 43 && groupVar2[0] == 44;

  *VarPastLevelC = Var1_p[0] == 52.;
  *GroupPastLevelC = groupVar1_p_p[0] == 53 && groupVar2_p_p[0] == 54;

  Var1[0] = 12;
}

even though Var1 is READS only.

Comments (1)

  1. Log in to comment