Beispiel #1
0
void
setup_layout(void)
{
  int c[4];
  int i,n_mach;
  int d[4];

#ifdef FIX_NODE_GEOM
  int *geom = node_geometry;
#else
  int *geom = NULL;
#endif

  if(mynode()==0){
    printf("LAYOUT = Hypercubes, options = ");
    printf("QDP");
    printf("\n");
  }

  /* Is there already a grid? 
     This could be a grid architecture with a preset dimension, or
     a geometry could have been set by the -qmp-geom command line arg. 
     In either case we have a nonzero allocated number of dimensions. 
  */

  if(QMP_get_allocated_number_of_dimensions() == 0)
    /* Set the geometry if requested */
    set_qmp_layout_grid(geom, 4);

  c[0] = nx;
  c[1] = ny;
  c[2] = nz;
  c[3] = nt;
  QDP_set_latsize(4, c);
  QDP_create_layout();
  sites_on_node = QDP_sites_on_node;
  even_sites_on_node = QDP_subset_len(QDP_even);
  odd_sites_on_node = QDP_subset_len(QDP_odd);
  n_mach = QMP_get_logical_number_of_dimensions();
  dim_mach = QMP_get_logical_dimensions();

  /* Initialize I/O node function */
#ifdef FIX_IONODE_GEOM
  init_io_node();
#endif
  
  /* Report sublattice dimensions */
  for(i = 0; i < 4; i++){
    /* Any extra machine dimensions are assumed to be 1 */
    if(i < n_mach)d[i] = c[i]/dim_mach[i];
    else d[i] = c[i];
  }
  if( mynode()==0)
    printf("ON EACH NODE %d x %d x %d x %d\n",d[0],d[1],d[2],d[3]);

#if 0
  mpi_whoami();  /* Debug */
#endif
}
QLA_Real
QOPPCV(relnorm2)(Vector2 **rsd, Vector2 **out, QDP_Subset subset, int nv)
{
  g_rel = 0;
  for(int i=0; i<nv; i++) {
    g_r = expose_V(rsd[i]);
    V_eq_funcit(out[i], relnorm_func, subset);
    reset_V(rsd[i]);
  }
  QMP_sum_double(&g_rel);
  QLA_Real rel = g_rel/QDP_subset_len(subset);
  return rel;
}
Beispiel #3
0
void
setup_layout(void)
{
  int c[4];
  int i,n_mach;
  int d[4];

  if(mynode()==0){
    printf("LAYOUT = Hypercubes, options = ");
    printf("QDP");
    printf("\n");
  }
  c[0] = nx;
  c[1] = ny;
  c[2] = nz;
  c[3] = nt;
  QDP_set_latsize(4, c);
  QDP_create_layout();
  sites_on_node = QDP_sites_on_node;
  even_sites_on_node = QDP_subset_len(QDP_even);
  odd_sites_on_node = QDP_subset_len(QDP_odd);
  n_mach = QMP_get_logical_number_of_dimensions();
  dim_mach = QMP_get_logical_dimensions();

#ifdef FIX_IONODE_GEOM
  /* Initialize I/O node function */
  init_io_node();
#endif
  
  /* Report sublattice dimensions */
  for(i = 0; i < 4; i++){
    /* Any extra machine dimensions are assumed to be 1 */
    if(i < n_mach)d[i] = c[i]/dim_mach[i];
    else d[i] = c[i];
  }
  if( mynode()==0)
    printf("ON EACH NODE %d x %d x %d x %d\n",d[0],d[1],d[2],d[3]);
}