예제 #1
0
/* Save random number state. (SITERAND case only) */
void save_random_state_scidac_from_site(char *filename, 
        char *fileinfo, char *recinfo, int volfmt, field_offset src)
{
  QIO_Layout layout;
  QIO_Filesystem fs;
  QIO_Writer *outfile;
  QIO_String *filexml;
  QIO_String *recxml;
  int status;

#ifndef SITERAND
  node0_printf("save_random_state_scidac_from_site: requires SITERAND. Save skipped\n");
  if(1)return;
#endif  

  QIO_verbose(QIO_VERB_OFF);

  /* Build the layout structure */
  build_qio_layout(&layout);

  /* Define the I/O system */
  build_qio_filesystem(&fs);

  /* Open file for writing */
  filexml = QIO_string_create();
  QIO_string_set(filexml, fileinfo);
  outfile = open_scidac_output(filename, volfmt, QIO_SERIAL,
			       QIO_ILDGNO, NULL, &layout, &fs, filexml);
  if(outfile == NULL)terminate(1);
  QIO_string_destroy(filexml);

  /* Write the lattice field */
  recxml = QIO_string_create();
  QIO_string_set(recxml, recinfo);
  status = write_S_from_site(outfile, recxml, src);
  QIO_string_destroy(recxml);
  if(status)terminate(1);
  
  /* Write information */
  if(volfmt == QIO_SINGLEFILE){
    node0_printf("Saved random state serially to binary file %s\n",
		 filename);
  }
  else if(volfmt == QIO_MULTIFILE){
    node0_printf("Saved random state multifile to binary file %s\n",
	   filename);
  }
  else if(volfmt == QIO_PARTFILE){
    node0_printf("Saved random state in partition format to binary file %s\n",
	   filename);
  }

  node0_printf("Checksums %x %x\n",
	       QIO_get_writer_last_checksuma(outfile),
	       QIO_get_writer_last_checksumb(outfile));

  close_scidac_output(outfile);
}
예제 #2
0
void save_color_matrix_scidac_from_field(char *filename,
  char *fileinfo, char *recinfo, int volfmt, su3_matrix *src, int count, int prec)
{
  QIO_Layout layout;
  QIO_Writer *outfile;
  QIO_Filesystem fs;
  QIO_String *filexml;
  QIO_String *recxml;
  int status;

  QIO_verbose(QIO_VERB_OFF);

  /* Build the layout structure */
  build_qio_layout(&layout);

  /* Build the structure defining the I/O nodes */
  build_qio_filesystem(&fs);

  /* Open file for writing */
  filexml = QIO_string_create();
  QIO_string_set(filexml, fileinfo);
  outfile = open_scidac_output(filename, volfmt, QIO_SERIAL,
                               QIO_ILDGNO, NULL, &layout, &fs, filexml);
  if(outfile == NULL)terminate(1);
  QIO_string_destroy(filexml);

  /* Write the lattice field */
  recxml = QIO_string_create();
  QIO_string_set(recxml, recinfo);
  if(prec == 1)
    status = write_F3_M_from_field(outfile, recxml, src, count);
  else
    status = write_D3_M_from_field(outfile, recxml, src, count);
  if(status)terminate(1);
  QIO_string_destroy(recxml);

  /* Write information */
  if(volfmt == QIO_SINGLEFILE){
    node0_printf("Saved KS matrix serially to binary file %s\n",
                 filename);
  }
  else if(volfmt == QIO_MULTIFILE){
    node0_printf("Saved KS matrix as multifile to binary file %s\n",
           filename);
  }
  else if(volfmt == QIO_PARTFILE){
    node0_printf("Saved KS matrix in partition format to binary file %s\n",
           filename);
  }

  node0_printf("Checksums %x %x\n",
               QIO_get_writer_last_checksuma(outfile),
               QIO_get_writer_last_checksumb(outfile));

  close_scidac_output(outfile);
}
예제 #3
0
void close_usqcd_ksprop_write(QIO_Writer *outfile){
  close_scidac_output(outfile);
}