Beispiel #1
0
int read_complex_scidac_xml(QIO_Reader *infile, complex *dest, int count, 
			    QIO_String *recxml){
  int status;
  int typesize, datacount;
  QIO_RecordInfo recinfo;

  /* Read the lattice field: "count" complex numbers per site */
  status = QIO_read_record_info(infile, &recinfo, recxml);
  status = qio_status(status);
  if(status < 0)return -1;
  if(status > 0)terminate(1);

  datacount = QIO_get_datacount(&recinfo);
  if(datacount != count){
    node0_printf("read_complex_scidac_xml: Got datacount %d but wanted %d\n",
		 datacount, count);
    terminate(1);
  }
  typesize = QIO_get_typesize(&recinfo);

  if(typesize == 2*4)
    status = read_F_C_to_field(infile, recxml, dest, count);
  else
    status = read_D_C_to_field(infile, recxml, dest, count);

  return status;
}
Beispiel #2
0
int read_kspropsource_C_usqcd(QIO_Reader *infile, char *srcinfo, int n,
			      complex *dest)
{
  QIO_USQCDKSPropSourceInfo propsource_info;
  QIO_String *recxml;
  char *info;
  int status, typesize;
  QIO_RecordInfo recinfo;

  recxml = QIO_string_create();

  /* Check the record type (double or single precision) */
  status = QIO_read_record_info(infile, &recinfo, recxml);
  if(status != QIO_SUCCESS)return status;
  typesize = QIO_get_typesize(&recinfo);

  if(typesize == 8)
    status = read_F_C_to_field(infile, recxml, dest, 1);
  else
    status = read_D_C_to_field(infile, recxml, dest, 1);

  if(status != QIO_SUCCESS)return status;

  status = QIO_decode_usqcd_kspropsource_info(&propsource_info, recxml);
  if(status != QIO_SUCCESS)terminate(1);
  QIO_string_destroy(recxml);

  info = QIO_get_usqcd_kspropsource_info(&propsource_info);

  strncpy(srcinfo, info, n);
  return QIO_SUCCESS;
}