/[escript]/trunk/ripley/src/Rectangle.cpp
ViewVC logotype

Diff of /trunk/ripley/src/Rectangle.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4584 by sshaw, Wed Dec 11 04:24:15 2013 UTC revision 4585 by sshaw, Wed Dec 11 04:39:54 2013 UTC
# Line 4085  escript::Data Rectangle::randomFill(long Line 4085  escript::Data Rectangle::randomFill(long
4085            
4086            
4087      double zz=m_mpiInfo->rank;      double zz=m_mpiInfo->rank;
4088      for (uint i=0;i<ext[0]*ext[1];++i)      for (unsigned int i=0;i<ext[0]*ext[1];++i)
4089      {      {
4090          src[i]=zz*1000+i;          src[i]=zz*1000+i;
4091      }      }
4092            
4093      for (uint j=0;j<ext[1];++j)      for (unsigned int j=0;j<ext[1];++j)
4094      {      {
4095      ostringstream oss;      ostringstream oss;
4096          oss << ">:" << m_mpiInfo->rank << ": ";          oss << ">:" << m_mpiInfo->rank << ": ";
4097      for (uint i=0;i<ext[0];++i)      for (unsigned int i=0;i<ext[0];++i)
4098      {      {
4099          oss << src[i+j*ext[0]] << " ";          oss << src[i+j*ext[0]] << " ";
4100      }      }
# Line 4113  escript::Data Rectangle::randomFill(long Line 4113  escript::Data Rectangle::randomFill(long
4113      double* Win=new double[inset*Eheight];  memset(Win, 0, inset*Eheight*sizeof(double));      double* Win=new double[inset*Eheight];  memset(Win, 0, inset*Eheight*sizeof(double));
4114    
4115      double* NEout=new double[inset*inset];  memset(NEout, 0, inset*inset*sizeof(double));      double* NEout=new double[inset*inset];  memset(NEout, 0, inset*inset*sizeof(double));
4116      uint base=ext[0]-inset+(ext[1]-inset)*ext[0];      unsigned int base=ext[0]-inset+(ext[1]-inset)*ext[0];
4117      for (uint i=0;i<inset;++i)      for (unsigned int i=0;i<inset;++i)
4118      {      {
4119      memcpy(NEout+inset*i, src+base, inset*sizeof(double));      memcpy(NEout+inset*i, src+base, inset*sizeof(double));
4120      base+=ext[0];      base+=ext[0];
4121      }      }
4122      double* NWout=new double[inset*inset];  memset(NWout, 0, inset*inset*sizeof(double));      double* NWout=new double[inset*inset];  memset(NWout, 0, inset*inset*sizeof(double));
4123      base=(ext[1]-inset)*ext[0];      base=(ext[1]-inset)*ext[0];
4124      for (uint i=0;i<inset;++i)      for (unsigned int i=0;i<inset;++i)
4125      {      {
4126      memcpy(NWout+inset*i, src+base, inset*sizeof(double));      memcpy(NWout+inset*i, src+base, inset*sizeof(double));
4127      base+=ext[0];      base+=ext[0];
4128      }      }
4129            
4130  // for (uint j=0;j<inset;++j)  // for (unsigned int j=0;j<inset;++j)
4131  // {  // {
4132  //     ostringstream oss;  //     ostringstream oss;
4133  //     oss << "NW: ";  //     oss << "NW: ";
4134  //     for (uint i=0;i<inset;++i)  //     for (unsigned int i=0;i<inset;++i)
4135  //     {  //     {
4136  //         oss << NWout[i+j*inset] << " ";  //         oss << NWout[i+j*inset] << " ";
4137  //     }  //     }
# Line 4152  escript::Data Rectangle::randomFill(long Line 4152  escript::Data Rectangle::randomFill(long
4152      }      }
4153      double* Nout=new double[inset*Swidth];  memset(Nout, 0, inset*Swidth*sizeof(double));      double* Nout=new double[inset*Swidth];  memset(Nout, 0, inset*Swidth*sizeof(double));
4154      base=inset+(ext[1]-inset)*ext[0];      base=inset+(ext[1]-inset)*ext[0];
4155      for (uint i=0;i<inset;++i)      for (unsigned int i=0;i<inset;++i)
4156      {      {
4157      memcpy(Nout+Swidth*i, src+base, Swidth*sizeof(double));      memcpy(Nout+Swidth*i, src+base, Swidth*sizeof(double));
4158      base+=ext[0];      base+=ext[0];
# Line 4165  escript::Data Rectangle::randomFill(long Line 4165  escript::Data Rectangle::randomFill(long
4165            
4166      double* Eout=new double[inset*Eheight];  memset(Eout, 0, inset*Eheight*sizeof(double));      double* Eout=new double[inset*Eheight];  memset(Eout, 0, inset*Eheight*sizeof(double));
4167      base=ext[0]-inset+inset*ext[0];      base=ext[0]-inset+inset*ext[0];
4168      for (uint i=0;i<Eheight;++i)      for (unsigned int i=0;i<Eheight;++i)
4169      {      {
4170      memcpy(Eout+i*inset, src+base, inset*sizeof(double));      memcpy(Eout+i*inset, src+base, inset*sizeof(double));
4171      base+=ext[0];      base+=ext[0];
4172      }      }
4173            
4174            
4175  /* for (uint j=0;j<Eheight;++j)  /* for (unsigned int j=0;j<Eheight;++j)
4176  {  {
4177      ostringstream oss;      ostringstream oss;
4178      oss << "E: ";      oss << "E: ";
4179      for (uint i=0;i<inset;++i)      for (unsigned int i=0;i<inset;++i)
4180      {      {
4181          oss << Eout[i+j*inset] << " ";          oss << Eout[i+j*inset] << " ";
4182      }      }
# Line 4326  deliberate error to test buildbot, now w Line 4326  deliberate error to test buildbot, now w
4326      if (swused)      if (swused)
4327      {      {
4328      base=0;      base=0;
4329      for (uint i=0;i<inset;++i)      for (unsigned int i=0;i<inset;++i)
4330      {      {
4331          memcpy(src+base, SWin+i*inset, inset*sizeof(double));          memcpy(src+base, SWin+i*inset, inset*sizeof(double));
4332          base+=ext[0];          base+=ext[0];
# Line 4335  deliberate error to test buildbot, now w Line 4335  deliberate error to test buildbot, now w
4335      if (seused)      if (seused)
4336      {      {
4337          base=ext[0]-inset;          base=ext[0]-inset;
4338      for (uint i=0;i<inset;++i)      for (unsigned int i=0;i<inset;++i)
4339      {      {
4340          memcpy(src+base, SEin+i*inset, inset*sizeof(double));          memcpy(src+base, SEin+i*inset, inset*sizeof(double));
4341          base+=ext[0];          base+=ext[0];
# Line 4344  deliberate error to test buildbot, now w Line 4344  deliberate error to test buildbot, now w
4344      if (nwused)      if (nwused)
4345      {      {
4346          base=(ext[1]-inset)*ext[0];          base=(ext[1]-inset)*ext[0];
4347      for (uint i=0;i<inset;++i)      for (unsigned int i=0;i<inset;++i)
4348      {      {
4349          memcpy(src+base, NWin+i*inset, inset*sizeof(double));          memcpy(src+base, NWin+i*inset, inset*sizeof(double));
4350          base+=ext[0];          base+=ext[0];
# Line 4353  deliberate error to test buildbot, now w Line 4353  deliberate error to test buildbot, now w
4353      if (sused)      if (sused)
4354      {      {
4355         base=inset;         base=inset;
4356         for (uint i=0;i<inset;++i)         for (unsigned int i=0;i<inset;++i)
4357         {         {
4358         memcpy(src+base, Sin+i*Swidth, Swidth*sizeof(double));         memcpy(src+base, Sin+i*Swidth, Swidth*sizeof(double));
4359         base+=ext[0];         base+=ext[0];
# Line 4362  deliberate error to test buildbot, now w Line 4362  deliberate error to test buildbot, now w
4362      if (wused)      if (wused)
4363      {      {
4364      base=inset*ext[0];      base=inset*ext[0];
4365      for (uint i=0;i<Eheight;++i)      for (unsigned int i=0;i<Eheight;++i)
4366      {      {
4367          memcpy(src+base, Win+i*inset, inset*sizeof(double));          memcpy(src+base, Win+i*inset, inset*sizeof(double));
4368          base+=ext[0];          base+=ext[0];
4369      }      }
4370                
4371      }      }
4372      for (uint j=0;j<ext[1];++j)      for (unsigned int j=0;j<ext[1];++j)
4373      {      {
4374      ostringstream oss;      ostringstream oss;
4375          oss << "<;" << m_mpiInfo->rank << "; ";          oss << "<;" << m_mpiInfo->rank << "; ";
4376      for (uint i=0;i<ext[0];++i)      for (unsigned int i=0;i<ext[0];++i)
4377      {      {
4378          oss << src[i+j*ext[0]] << " ";          oss << src[i+j*ext[0]] << " ";
4379      }      }

Legend:
Removed from v.4584  
changed lines
  Added in v.4585

  ViewVC Help
Powered by ViewVC 1.1.26