예제 #1
0
int
setup(void)
{
  int prompt;

  
  /* print banner, get volume, seed */
  prompt = initial_set();
  /* initialize the node random number generator */
  initialize_prn( &node_prn, iseed, volume+mynode() );
  /* Initialize the layout functions, which decide where sites live */
  setup_layout();
  /* allocate space for lattice, set up coordinate fields */
  make_lattice();
  node0_printf("Made lattice\n"); fflush(stdout);

  /* set up neighbor pointers and comlink structures */
  make_nn_gathers();
  node0_printf("Made nn gathers\n"); fflush(stdout);
  /* set up 3rd nearest neighbor pointers and comlink structures
     code for this routine is below  */
  make_3n_gathers();
  node0_printf("Made 3nn gathers\n"); fflush(stdout);
  /* set up K-S phase vectors, boundary conditions */
  phaseset();
  
  node0_printf("Finished setup\n"); fflush(stdout);
  return( prompt );
}
예제 #2
0
void setup_fixed_geom(int *geom, int n){
  int i;
  int node_count;
  int len[4];
  int status;

  len[0] = nx; len[1] = ny; len[2] = nz; len[3] = nt;

  node_count = 1;
  status = 0;
  for(i = 0; i < 4; i++){
    nsquares[i] = geom[i];
    node_count *= geom[i];
    if(len[i] % nsquares[i] != 0)status++;
    squaresize[i] = len[i]/nsquares[i];
  }

  if(node_count != numnodes()){
    node0_printf("/nsetup_fixed_geom: Requested geometry %d %d %d %d ",
		 geom[0], geom[1], geom[2], geom[3]);
    node0_printf("does not match number of nodes %d\n",numnodes());
    terminate(1);
  }

  if(status){
    node0_printf("setup_fixed_geom: Requested geometry %d %d %d %d ",
		 geom[0], geom[1], geom[2], geom[3]);
    node0_printf("is not commensurate with the lattice dims %d %d %d %d\n",
		 nx, ny, nz, nt);
    terminate(1);
  }
}
예제 #3
0
int save_complex_scidac(QIO_Writer *outfile, char *filename, char *recinfo,
			int volfmt, complex *src, int count)
{
  QIO_String *recxml;
  int status;

  recxml = QIO_string_create();
  QIO_string_set(recxml, recinfo);
  status = write_F_C_from_field(outfile, recxml, src, count);
  QIO_string_destroy(recxml);
  if(status)return status;
  
  /* Write information */
  if(volfmt == QIO_SINGLEFILE){
    node0_printf("Saved complex field serially to binary file %s\n",
		 filename);
  }
  else if(volfmt == QIO_MULTIFILE){
    node0_printf("Saved complex field as multifile to binary file %s\n",
	   filename);
  }
  else if(volfmt == QIO_PARTFILE){
    node0_printf("Saved complex field 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));

  return status;
}
예제 #4
0
double d_action(){
double hmom_action(),fermion_action();
    double ssplaq,stplaq,g_action,h_action,f_action;

    d_plaquette(&ssplaq,&stplaq);
    ssplaq *= -1.0; stplaq *= -1.0;
    g_action = -beta*volume*(ssplaq+stplaq);
    node0_printf("PLAQUETTE ACTION: %e\n",g_action);

    rephase(OFF);
    g_action = (beta/3.0)*imp_gauge_action();
    rephase(ON);
    h_action = hmom_action();
    f_action = fermion_action();

    node0_printf("ACTION: g,h,f = %e  %e  %e  %e\n",
    g_action, h_action, f_action, g_action+h_action+f_action );

/*DEBUG*/
node0_printf("DG = %e, DH = %e, DF = %e, D = %e\n",
g_action-old_g, h_action-old_h, f_action-old_f,
g_action+h_action+f_action-old_a);
old_g=g_action; old_h=h_action; old_f=f_action;
old_a=g_action+h_action+f_action;
/*ENDDEBUG*/

    return(g_action+h_action+f_action);
}
예제 #5
0
파일: setup.c 프로젝트: erinaldi/milc_qcd
int
setup()
{
  int prompt;

  /* print banner, get volume, nflavors1,nflavors2, seed */
  prompt = initial_set();
  if(prompt == 2)return prompt;
  /* initialize the node random number generator */
  initialize_prn( &node_prn, iseed, volume+mynode() );
  /* Initialize the layout functions, which decide where sites live */
  setup_layout();
  /* allocate space for lattice, set up coordinate fields */
  make_lattice();
  node0_printf("Made lattice\n"); fflush(stdout);
  /* Mark t_longlink and t_fatlink unallocted */
  // init_ferm_links(&fn_links, &ks_act_paths);
  /* set up neighbor pointers and comlink structures
     code for this routine is in com_machine.c  */
  make_nn_gathers();
  node0_printf("Made nn gathers\n"); fflush(stdout);
  /* set up 3rd nearest neighbor pointers and comlink structures
     code for this routine is below  */
  make_3n_gathers();
  node0_printf("Made 3nn gathers\n"); fflush(stdout);
  /* set up K-S phase vectors, boundary conditions */
  phaseset();

  node0_printf("Finished setup\n"); fflush(stdout);
  return( prompt );
}
예제 #6
0
static QOP_FermionLinksWilson *
create_qop_wilson_fermion_links( Real clov )
{
  QOP_FermionLinksWilson *qop_links = NULL;
  QOP_info_t info;
  QOP_GaugeField *links;
  QOP_wilson_coeffs_t coeffs;
  double remaptime;

  /* Load coeffs structure */
  load_qop_wilson_coeffs(&coeffs, clov);

  /* Map SU(3) gauge field to G type */
  remaptime = -dclock(); 
  links = create_G_from_site4(F_OFFSET(link),EVENANDODD);
  remaptime += dclock();

  /* Create links */
  qop_links = QOP_wilson_create_L_from_G(&info, &coeffs, links);

  QOP_destroy_G(links);

#ifdef FFTIME
#ifdef REMAP
    node0_printf("FFREMAP:  time = %e\n",remaptime);
#endif
  node0_printf("FFTIME:  time = %e (cl_qop) terms = 1 mflops = %e\n",
	       info.final_sec, (Real)info.final_flop/(1e6*info.final_sec) );
#endif
  return qop_links;
}
예제 #7
0
int remap_stdio_from_args(int argc, char *argv[]){
  FILE *fp;

  /* stdin is remapped only on node 0 on any machine */
  if(argc > 1 && mynode() == 0){
    fp = freopen(argv[1],"r",stdin);
    if(fp == NULL){
      node0_printf("Can't open stdin file %s for reading.\n",argv[1]);
      return 1;
    }
  }

#ifdef QCDOC
  /* stdout and stderr are remapped only on node 0 on the QCDOC */
  if(mynode() != 0)return 0;
#endif

  if(argc > 2){
    fp = freopen(argv[2],"w",stdout);
    if(fp == NULL){
      node0_printf("Can't open stdout file %s for writing\n",argv[2]);
      return 1;
    }
  }
  if(argc > 3){
    fp = freopen(argv[3],"w",stderr);
    if(fp == NULL){
      node0_printf("Can't open stderr file %s for writing\n",argv[3]);
      return 1;
    }
  }
  return 0;
}
예제 #8
0
static void init_io_node(){
  int i;
  int status = 0;

  if(ionodegeom() == NULL){
    ionodegeomvals = ionode_geometry;
    node0_printf("Setting ionodegeomvals to %d %d %d %d\n",
		 ionodegeomvals[0], ionodegeomvals[1],
		 ionodegeomvals[2], ionodegeomvals[3]);
  } else {
    node0_printf("init_io_node: Command line ionode geometry overrides request\n");
    ionodegeomvals = ionodegeom();
  }

  if(ionodegeomvals == NULL)return;

  /* Compute the number of nodes per I/O node along each direction */
  for(i = 0; i < 4; i++){
    if(dim_mach[i] % ionodegeomvals[i] != 0)status++;
    nodes_per_ionode[i] = dim_mach[i]/ionodegeomvals[i];
  }
  
  if(status){
    node0_printf("init_io_node: ionode geometry %d %d %d %d \n",
		 ionodegeomvals[0], ionodegeomvals[1],
		 ionodegeomvals[2], ionodegeomvals[3]);
    node0_printf("is incommensurate with node geometry %d %d %d %d\n",
		 dim_mach[0], dim_mach[1], dim_mach[2], dim_mach[3]);
    terminate(1);
  }
}
예제 #9
0
파일: setup.c 프로젝트: jcosborn/milc_qcd
int
setup()
{
  int initial_set();
  int prompt;
  
  /* print banner, get initial parameters */
  prompt = initial_set();
  if(prompt == 2)return prompt;
  /* initialize the node random number generator */
  initialize_prn( &node_prn, iseed, volume+mynode() );
  /* Initialize the layout functions, which decide where sites live */
  setup_layout();
  /* allocate space for lattice, set up coordinate fields */
  make_lattice();

  node0_printf("Made lattice\n"); fflush(stdout);
  /* set up neighbor pointers and comlink structures
     code for this routine is in com_machine.c  */
  make_nn_gathers();
  node0_printf("Made nn gathers\n"); fflush(stdout);
  
  node0_printf("Finished setup\n"); fflush(stdout);
  return prompt;
}
예제 #10
0
/*--------------------------------------------------------------------*/
static void setup_qmp_grid(){
  int ndim = 4;
  int len[4];
  int ndim2, i;
  const int *nsquares2;

  len[0] = nx; len[1] = ny; len[2] = nz; len[3] = nt;

  if(mynode()==0){
    printf("qmp_grid,");
    printf("\n");
  }

  ndim2 = QMP_get_allocated_number_of_dimensions();
  nsquares2 = QMP_get_allocated_dimensions();

  /* If the dimensions are not already allocated, use the
     node_geometry request.  Otherwise a hardware or command line
     specification trumps the parameter input. */
#ifdef FIX_NODE_GEOM
  if(ndim2 == 0){
    ndim2 = 4;
    nsquares2 = node_geometry;
  }
  else{
    node0_printf("setup_qmp_grid: Preallocated machine geometry overrides request\n");
  }
#endif

  if(mynode()==0){
    printf("Using machine geometry: ");
    for(i=0; i<ndim; i++){
      printf("%d ",nsquares2[i]);
      if(i < ndim-1)printf("X ");
    }
    printf("\n");
  }

  /* In principle, we could now rotate coordinate axes */
  /* Save this for a future upgrade */

  set_qmp_layout_grid(nsquares2, ndim2);

  ndim2 = QMP_get_logical_number_of_dimensions();
  nsquares2 = QMP_get_logical_dimensions();

  for(i=0; i<ndim; i++) {
    if(i<ndim2) nsquares[i] = nsquares2[i];
    else nsquares[i] = 1;
  }

  for(i=0; i<ndim; i++) {
    if(len[i]%nsquares[i] != 0) {
      node0_printf("LATTICE SIZE DOESN'T FIT GRID\n");
      QMP_abort(0);
    }
    squaresize[i] = len[i]/nsquares[i];
  }
}
예제 #11
0
void setup_analyze()
{
  node0_printf("With spectrum measurements\n");
  node0_printf("With screening function measurements\n");

  /* Set up gathers for wave function computations */
  setup_wavefunc_t();
}
예제 #12
0
파일: setup.c 프로젝트: liu0604/milc_qcd
int  setup()   {
    int initial_set();
    void make_gen_pt();
    void make_3n_gathers(),
        setup_layout();
    int prompt;
//#ifdef HAVE_QDP
//    int i;
//#endif

	/* print banner, get volume, seed */
    prompt=initial_set();
   	/* initialize the node random number generator */
    initialize_prn( &node_prn, iseed, volume+mynode() );
	/* Initialize the layout functions, which decide where sites live */
    setup_layout();
	/* allocate space for lattice, set up coordinate fields */
    make_lattice();
    node0_printf("Made lattice\n"); fflush(stdout);
    //init_ferm_links(&fn_links, &ks_act_paths);
	/* set up neighbor pointers and comlink structures
	   code for this routine is in com_machine.c  */
    make_nn_gathers();
node0_printf("Made nn gathers\n"); fflush(stdout);
#ifdef FN
	/* set up 3rd nearest neighbor pointers and comlink structures
	   code for this routine is below  */
    make_3n_gathers();
node0_printf("Made 3nn gathers\n"); fflush(stdout);
#endif
	/* set up K-S phase vectors, boundary conditions */
    phaseset();

//#if HAVE_QOP
//  /* Initialize QOP */
//  if(initialize_qop() != QOP_SUCCESS){
//    node0_printf("setup: Error initializing QOP\n");
//    terminate(1);
//  }
//#endif

//#ifdef HAVE_QDP
//    make_rand_seed();
//node0_printf("Made random seed\n"); fflush(stdout);
//
//  for(i=0; i<4; ++i) {
//    shiftdirs[i] = QDP_neighbor[i];
//    shiftdirs[i+4] = neighbor3[i];
//  }
//  for(i=0; i<8; ++i) {
//    shiftfwd[i] = QDP_forward;
//    shiftbck[i] = QDP_backward;
//  }
//#endif

node0_printf("Finished setup\n"); fflush(stdout);
    return( prompt );
}
예제 #13
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);
}
예제 #14
0
// -----------------------------------------------------------------
static void setup_hyper_prime() {
  int i, j, k, dir;

  if (mynode()==0) {
    printf("hyper_prime,");
    printf("\n");
  }

  // Figure out dimensions of rectangle
  squaresize[XUP] = nx;
  squaresize[YUP] = ny;
  squaresize[ZUP] = nz;
  squaresize[TUP] = nt;
  nsquares[XUP] = 1;
  nsquares[YUP] = 1;
  nsquares[ZUP] = 1;
  nsquares[TUP] = 1;

  i = 1;  // Current number of hypercubes
  while (i < numnodes()) {
    // Figure out which prime to divide by starting with largest
    k = MAXPRIMES - 1;
    while ((numnodes() / i) % prime[k] != 0 && k > 0)
      --k;

    // Figure out which direction to divide
    // Find largest even dimension of h-cubes
    for (j = 1, dir = XUP; dir <= TUP; dir++) {
      if (squaresize[dir] > j && squaresize[dir] % prime[k] == 0)
        j = squaresize[dir];
    }

    /* if one direction with largest dimension has already been
       divided, divide it again.  Otherwise divide first direction
       with largest dimension. */
    for (dir = XUP; dir <= TUP; dir++) {
      if (squaresize[dir] == j && nsquares[dir] > 1)
        break;
    }
    if (dir > TUP) {
      for (dir = XUP; dir <= TUP; dir++) {
        if (squaresize[dir] == j)
          break;
      }
    }
    // This can fail if I run out of prime factors in the dimensions
    if (dir > TUP) {
      node0_printf("LAYOUT: Can't lay out this lattice, ");
      node0_printf("not enough factors of %d\n", prime[k]);
      terminate(1);
    }

    // Do the surgery
    i *= prime[k];
    squaresize[dir] /= prime[k];
    nsquares[dir] *= prime[k];
  }
}
예제 #15
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);
}
예제 #16
0
static int 
bicgilu_cl_qop_generic( QOP_FermionLinksWilson *qop_links, 
			QOP_invert_arg_t *qop_invert_arg,
			QOP_resid_arg_t  ***qop_resid_arg,
			MYREAL *kappas[], int nkappa[], 
			QOP_DiracFermion **qop_sol[], 
			QOP_DiracFermion *qop_src[], 
			int nsrc,		    
			int *final_restart,
			Real *final_rsq_ptr )
{
  int isrc, ikappa;
  int iters;
  QOP_info_t info;
  
  if(nsrc == 1 && nkappa[0] == 1)
    QOP_wilson_invert( &info, qop_links, qop_invert_arg, qop_resid_arg[0][0],
		       kappas[0][0], qop_sol[0][0], qop_src[0] );
  else
    QOP_wilson_invert_multi( &info, qop_links, qop_invert_arg, qop_resid_arg,
			     kappas, nkappa, qop_sol, qop_src, nsrc );

  /* For now we return the largest value and total iterations */
  *final_rsq_ptr = 0;
  *final_restart = 0;
  iters = 0;
  for(isrc = 0; isrc < nsrc; isrc++)
    for(ikappa = 0; ikappa < nkappa[isrc]; ikappa++){
      if(*final_rsq_ptr < qop_resid_arg[isrc][ikappa]->final_rsq)
	*final_rsq_ptr = qop_resid_arg[isrc][ikappa]->final_rsq;
      if(*final_restart < qop_resid_arg[isrc][ikappa]->final_restart)
	*final_restart = qop_resid_arg[isrc][ikappa]->final_restart;
      iters += qop_resid_arg[isrc][ikappa]->final_iter;
#ifdef CG_DEBUG
      if(nsrc > 1 || nkappa[isrc] > 1)
	node0_printf("CONGRAD5(src %d,kappa %d): iters = %d resid = %e\n",
	       isrc, ikappa,
	       qop_resid_arg[isrc][ikappa]->final_iter,
	       qop_resid_arg[isrc][ikappa]->final_rsq);
#endif
    }

#ifdef CGTIME
  node0_printf("CGTIME: time = %e (wilson_qop %s) ",
	       info.final_sec,qop_prec[QOP_Precision-1]);
  for(isrc = 0; isrc < nsrc; isrc++)
    node0_printf("nkappa[%d] = %d iters = %d ",
		 isrc,nkappa[isrc],qop_resid_arg[isrc][0]->final_iter);
  node0_printf("mflops = %e\n", info.final_flop/(1.0e6*info.final_sec) );
  fflush(stdout);
#endif

  return iters;
}
예제 #17
0
void show_generic_ks_md_opts( void ){

#ifdef KS_MULTIFF
  node0_printf("KS_MULTIFF=%s\n",ks_multiff_opt_chr());

#ifdef VECLENGTH
  node0_printf("VECLENGTH=%d\n",VECLENGTH);
#endif
#endif

}
예제 #18
0
int make_path_table(ks_action_paths *ap, ks_action_paths *ap_dmdu0) {

    int i,j;
#ifdef TADPOLE_IMPROVE
    int k;
#endif

    // Don't remake the table if already made

    if(ap->constructed)return 0;
    // node0_printf("MAKING PATH TABLES\n");
  
    /* table of directions, 1 for each kind of path */
    /**int path_ind[MAX_BASIC_PATHS][MAX_LENGTH];**/
    /* table of coefficients in action, for each path */

    node0_printf("%s\n",QUARK_ACTION_DESCRIPTION);
    num_q_paths = 0;
    num_basic_paths = 0;
    if(MAX_LENGTH > MAX_PATH_LENGTH){
      printf("Path length for this action is too long.  Recompile.\n");
      terminate(1);
    }

    /* add rots. and reflects to table, print out the path coefficients */
    node0_printf("path coefficients: npath  path_coeff  multiplicity\n");
    for(j=0;j<quark_action_npaths;j++) {
	Real this_coeff;
	this_coeff = path_coeff[j];
#ifdef TADPOLE_IMPROVE
	for(k=1;k< path_length_in[j];k++)this_coeff /= u0;
#endif
	act_path_coeff[j] = this_coeff ;
#ifdef DM_DU0
	act_path_coeff_dmdu0[j] = this_coeff*(1-path_length_in[j])/u0;
#endif
	i = add_basic_path( path_ind[j], path_length_in[j],
	    this_coeff );
	node0_printf("                    %d      %e     %d\n",
	    j,this_coeff,i);
    }
    ap->num_q_paths = num_q_paths;
    ap->q_paths = q_paths;
    ap->act_path_coeff = act_path_coeff;
#ifdef DM_DU0
    ap_dmdu0->num_q_paths = num_q_paths;
    ap_dmdu0->q_paths = q_paths;
    ap_dmdu0->act_path_coeff = act_path_coeff_dmdu0;
#endif
    ap->constructed = 1;
    return 1;
}
예제 #19
0
static int 
make_path_table_hisq( char *action_desc, int npaths, int max_paths,
		      int *path_length, Real *coeff,
		      int paths[][MAX_LENGTH], Real *act_coeff, 
		      Q_path *this_q_paths, Real naik_term_epsilon, 
		      int index_onelink, int index_naik ) 
{

  int i,j;
  int n_basic_paths;	 // number of paths before rotation/reflection
  int n_q_paths; // total number of paths in table
#ifdef TADPOLE_IMPROVE
  int k;
#endif
  
  /* table of directions, 1 for each kind of path */
  /**int paths[npaths][MAX_LENGTH];**/
  /* table of coefficients in action, for each path */
  
  node0_printf("%s\n",action_desc);
  n_q_paths = 0;
  n_basic_paths = 0;
  if(MAX_LENGTH > MAX_PATH_LENGTH){
    printf("Path length for this action is too long.  Recompile.\n");
    terminate(1);
  }
  
  /* add rots. and reflects to table, print out the path coefficients */
  node0_printf("path coefficients: npath  path_coeff  multiplicity\n");
  for(j=0;j<npaths;j++) {
    Real this_coeff;
    this_coeff = coeff[j];
#ifdef TADPOLE_IMPROVE
    for(k=1;k< path_length[j];k++)this_coeff /= u0;
#endif
    act_coeff[j] = this_coeff ;
    //AB THIS SHOULD BE REMOVED
    // Apply mass correction to one-link and Naik coefficients
    if(j == index_onelink){
      ; //this_coeff += onelink_mass_renorm_fact * naik_term_epsilon * naik_term_epsilon;
    }
    if(j == index_naik){
      ; //this_coeff += naik_mass_renorm_fact * naik_term_epsilon * naik_term_epsilon;
    }
    i = add_basic_path( this_q_paths, n_q_paths, paths[j],
			path_length[j], this_coeff, max_paths );
    n_q_paths += i;
    n_basic_paths++;
    node0_printf("                    %d      %e     %d\n", j,this_coeff,i);
  }
  return( n_q_paths );
} //make_path_table_hisq()
예제 #20
0
REQUIRES QIO
#else
#include <qio.h>
#endif
#include "../include/io_scidac.h"
#include "../include/io_scidac_ks.h"
#include <string.h>

/********************************************************************/
/* Generic color vector file (not USQCD)                            */
/* Write color vectors in SciDAC format, taking data from the site
   structure */

int save_ks_vector_scidac(QIO_Writer *outfile, char *filename, char *recinfo,
			  int volfmt, su3_vector *src, int count, int prec)
{
  QIO_String *recxml;
  int status;

  recxml = QIO_string_create();
  QIO_string_set(recxml, recinfo);
  if(prec == 1)
    status = write_F3_V_from_field(outfile, recxml, src, count);
  else
    status = write_D3_V_from_field(outfile, recxml, src, count); 

  QIO_string_destroy(recxml);
  if(status != QIO_SUCCESS)return status;
  
  /* Write information */
  if(volfmt == QIO_SINGLEFILE){
    node0_printf("Saved KS vector serially to binary file %s\n",
		 filename);
  }
  else if(volfmt == QIO_MULTIFILE){
    node0_printf("Saved KS vector as multifile to binary file %s\n",
	   filename);
  }
  else if(volfmt == QIO_PARTFILE){
    node0_printf("Saved KS vector 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));

  return status;
}
예제 #21
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;
}
예제 #22
0
void do_phases()  {
/* Multiply gauge and boundary fields with fermionic phase factors */

  register int i,j,k,dir;
  register site *sit;
  register Real phr,phi,ddr,ddi;

  for(dir=XUP;dir<=ZUP;dir++){
    if(ferm_phases[dir] != 0.0){
      switch(dir){
	case(XUP):	ddr = ferm_phases[dir] / (Real)nx;	break;
	case(YUP):	ddr = ferm_phases[dir] / (Real)ny;	break;
	case(ZUP):	ddr = ferm_phases[dir] / (Real)nz;	break;
      }
      phr = cos((double)ddr);
      phi = sin((double)ddr);

      FORALLSITES(i,sit){
	for(j=0; j<3; j++) for(k=0; k<3; k++)  {
	  ddr = sit->link[dir].e[j][k].real;
	  ddi = sit->link[dir].e[j][k].imag;
	  sit->link[dir].e[j][k].real = phr*ddr - phi*ddi;
	  sit->link[dir].e[j][k].imag = phr*ddi + phi*ddr;
	  ddr = sit->boundary[dir].e[j][k].real;
	  ddi = sit->boundary[dir].e[j][k].imag;
	  sit->boundary[dir].e[j][k].real = phr*ddr - phi*ddi;
	  sit->boundary[dir].e[j][k].imag = phr*ddi + phi*ddr;
	}
      }
    }
  }
  node0_printf("Fermion phases set\n");
}
예제 #23
0
/* Print compiler option macros */
void 
show_hypisq_force_opts(void){

#ifdef HYPISQ_FORCE_FILTER
  node0_printf("HYPISQ_FORCE_FILTER = %g\n",HYPISQ_FORCE_FILTER);
#endif

#ifdef HYPISQ_FF_MULTI_WRAPPER
  node0_printf("HYPISQ_FF_MULTI_WRAPPER is ON\n");
#endif

#ifdef HYPISQ_FF_DEBUG
  node0_printf("HYPISQ_FF_DEBUG is ON\n");
#endif

}
예제 #24
0
static void
create_asqtad_links(int both, ferm_links_t *fn, ks_action_paths *ap) {
  Real *act_path_coeff = ap->act_path_coeff;

  double remaptime;
  char myname[] = "create_asqtad_links";

  if( phases_in != 1){
    node0_printf("create_asqtad_links: BOTCH: needs phases in\n");
    terminate(1);
  }

  /* Initialize QOP */
  if(initialize_qop() != QOP_SUCCESS){
    printf("%s(%d): Error initializing QOP\n",myname,this_node);
    terminate(1);
  }

  /* Use MILC link fattening routines */
  load_fatlinks(fn, ap);
  load_longlinks(fn, ap);

  /* Map to MILC fat and long links to QOP including possible change
     of precision */
  create_qop_links_from_milc_fn(fn);
}
예제 #25
0
/*----------------------------------------------------------------------*/
void setup_restrict_fourier( int *key, int *slice){
  /* "key" is a four component array.  If a component is 1, the Fourier
     transform is done in that direction, if it is 0 that direction is
     left alone. 
     If it is 2, then do the FT on a subset of the lattice with a
     fixed value slice[dir] of the coordinate in that direction. 
     "slice" is a four component array.  Not used unless key[dir]=2. */
  
  int dims[NDIM] = {nx, ny, nz, nt};
  int ndim = NDIM;
  int dir;
  
  /* No support for key[dir] = 2 */
  for(dir = 0; dir < ndim; dir++){
    if(key[dir] == 2){
      node0_printf("setup_restrict_fourier: No support for remapped slice FT's\n");
      terminate(1);
    }
  }

  /* Create the layouts for the 1D FT's */

  ft_create_layouts(layout, &layout[MILC_DIR], ndim, dims, key);

  /* Create the maps for switching layouts */

  ft_make_maps(layout, key, ndim);
}
void restore_smeared_spectator(int color, int k_spectator)
{
  int k_zonked_light;
  int spin;

  /* If the spectator quark is the same as one of the zonked light
     quarks, copy the preloaded smeared zonked light quark instead */
  
  k_zonked_light = find_matching_zonked_light(k_spectator);
  
  if(k_zonked_light >= 0)
    {
      copy_site_spin_wilson_vector(
              F_OFFSET(quark_zonked_light[k_zonked_light]), 
	      F_OFFSET(quark_spectator)); 
    }
  else
    {
      for(spin=0; spin<4; spin++)
	load_in_spectator(color, spin, k_spectator,
			  F_OFFSET(quark_spectator.d[spin]));

      /**** sink smear the spectator_shell quark 
	    with the generic smearing function ****/
      
      node0_printf("Smearing light spectator.\n");
      fflush(stdout);
      M_SINK_SMEAR(quark_spectator,heavy_smear_func_mom[0]) ;
    }
}
예제 #27
0
int read_gauge_info_i(FILE* fp, char *key, int* value)
{
    char *gleich = "=";
    char line[MAX_REC_LEN];
    char *pos;
    int success=0;

    
    
    rewind(fp);
    while (!feof(fp))
    {
	if (fgets(line, MAX_REC_LEN, fp))
	{
	    if (strstr(line,key) && (pos = strstr(line, gleich)))
	    {
		pos++;
		sscanf(pos,"%i",value);
		node0_printf("FOUND %s to be %i \n",key, *value);
		success=1;
		fflush(stdout);
	    }
	} else {
	    break;
	}
    }
    return success;
}
예제 #28
0
파일: twopt.c 프로젝트: erinaldi/milc_qcd
void all_pw_prop(int dir1, int dir2)
{

  int i;
  int my_t;

  pauli_propagator *quark;
  pauli_propagator *antiquark;
  site *s;

  FORALLSITES(i,s){
    my_t = s->t;

    antiquark = &antiquark_prop[i].up;
    quark     = &quark_prop_smear[i].up;
    pw_nr_meson(antiquark, quark, raw_prop[my_t][dir1][dir2]);
    
#if 0   /* Debug */
    if(s->t==0&&s->x==0&&s->y==0&&s->z==0){
      int j,k;
      for(j=0;j<4;j++)
	for(k=0;k<4;k++){
	  node0_printf("[%d][%d][%d][%d] %e\n", 
		       dir1,dir2,j,k, raw_prop[my_t][dir1][dir2][j][k].real);
	}      
    }
#endif

    antiquark = &antiquark_prop[i].dn;
    quark     = &quark_prop_smear[i].dn;
    pw_nr_meson(antiquark, quark, raw_prop[my_t][dir1][dir2]);
    
  }
예제 #29
0
void Matrix_Vec_mult(su3_vector *src, su3_vector *res, int parity,
		     imp_ferm_links_t *fn )
{  
  register site *s;
  register  int i;
  int otherparity = EVENANDODD;

  if(temp == NULL ){
    temp = (su3_vector *)malloc(sites_on_node*sizeof(su3_vector));
  }
  
  switch(parity){
  case EVEN:
    otherparity = ODD ;
    break ;
  case ODD:
    otherparity = EVEN ;
    break ;
  case EVENANDODD:
    otherparity = EVENANDODD ;
    break ;
  default:
    node0_printf("ERROR: wrong parity in eigen_stuff::Matrix_Vec_mult\n") ;
    terminate(1) ;
  }

  dslash_field(src , temp, otherparity, fn) ; 
  dslash_field(temp, res , parity     , fn) ;
  FORSOMEPARITY(i,s,parity){ 
    scalar_mult_su3_vector( &(res[i]), -1.0, &(res[i])) ;
  } 
예제 #30
0
void epsilon() {
  int i, j, k, l;
  setup_as_index();
  setup_sd_index();
  for (i = 0; i < DIMF; i++) {
    for (j = 0; j < DIMF; j++) {
      for (k = 0; k < DIMF; k++) {
        for (l = 0; l < DIMF; l++)
          perm[i][j][k][l] = 0;
      }
    }
  }

  for (i = 0; i < DIMF; i++) {
    for (j = 0; j < DIMF; j++) {
      if (j == i)
        continue;
      for (k = 0; k < DIMF; k++) {
        if (k == j || k == i)
          continue;
        for (l = 0; l < DIMF; l++) {
          if (l == k || l == j || l == i)
            continue;
          perm[i][j][k][l] = order(i, j, k, l);
#ifdef DEBUG_CHECK
          if (perm[i][j][k][l] * perm[i][j][k][l] > 1.0e-4)
            node0_printf("PERM %d%d%d%d = %.4g\n",
                         i, j, k, l, perm[i][j][k][l]);
#endif
        }
      }
    }
  }
  return;
}