Exemple #1
0
//------------------------------------------------------------------
// It fills in the array grid_end[8] allocated in this file with
// 0 or 1. If the machine is a torus all entries are set to 0.
// If it is a mesh then if a single hop along the direction dir
// is outside the machine the grid_end[dir] is set to 1.
// Should be called once before any other routines in this file are 
// used. 
//------------------------------------------------------------------
void BGLCPSGrid_InitFill (void)
{
  int nn;
  int x, y, z;
  int Lx, Ly, Lz;
  BGLPersonality pers;

  // Get personality info
  rts_get_personality(&pers, sizeof(pers));

  // Get the sizes of each direction 
  // (size starts from 1)
  Lx = pers.xSize;
  Ly = pers.ySize;
  Lz = pers.zSize;

  // Get the coordinates of this node 
  // (coordinate ranges fro 0 to size-1)
  x = pers.xCoord;
  y = pers.yCoord;
  z = pers.zCoord;


  // Set the grid_end array
  grid_end[0] = 0;
  //  if( (!(pers.isTorus & PERSONALITY_TORUS_X)) && (x == Lx-1) ) {
  if( (!(BGLPersonality_isTorusX(&pers))) && (x == Lx-1) ) {
    grid_end[0] = 1;
  }

  grid_end[1] = 0;
  //  if( (!(pers.isTorus & PERSONALITY_TORUS_X)) && (x == 0) ) {
  if( (!(BGLPersonality_isTorusX(&pers))) && (x == 0) ) {
    grid_end[1] = 1;
  }

  grid_end[2] = 0;
  //  if( (!(pers.isTorus & PERSONALITY_TORUS_Y)) && (y == Ly-1) ) {
  if( (!(BGLPersonality_isTorusY(&pers))) && (y == Ly-1) ) {
    grid_end[2] = 1;
  }

  grid_end[3] = 0;
  //  if( (!(pers.isTorus & PERSONALITY_TORUS_Y)) && (y == 0) ) {
  if( (!(BGLPersonality_isTorusY(&pers))) && (y == 0) ) {
    grid_end[3] = 1;
  }

  grid_end[4] = 0;
  //  if( (!(pers.isTorus & PERSONALITY_TORUS_Z)) && (z == Lz-1) ) {
  if( (!(BGLPersonality_isTorusZ(&pers))) && (z == Lz-1) ) {
    grid_end[4] = 1;
  }

  grid_end[5] = 0;
  //  if( (!(pers.isTorus & PERSONALITY_TORUS_Z)) && (z == 0) ) {
  if( (!(BGLPersonality_isTorusZ(&pers))) && (z == 0) ) {
    grid_end[5] = 1;
  }

  grid_end[6] = 0;

  grid_end[7] = 0;

  /*
  int t = rts_get_processor_id();
  qprintf_all("V=(%d,%d,%d), ts=(%d,%d,%d), r=(%d, %d, %d, %d), ge=(%d,%d,%d,%d,%d,%d)\n", 
	      Lx,Ly,Lz,
	      (int) BGLPersonality_isTorusX(&pers),
	      (int) BGLPersonality_isTorusY(&pers),
	      (int) BGLPersonality_isTorusZ(&pers),
	      x,y,z,t,
	      grid_end[0],
	      grid_end[1],
	      grid_end[2],
	      grid_end[3],
	      grid_end[4],
	      grid_end[5]);
  */

}
Exemple #2
0
/** print DDI Blue Gene/L runtime */
void DDI_BGL_Runtime_print(FILE *stream) {
    BGLPersonality personality;
    int rank,nprocs;
    int dim = 0,torus_dim = 0;
    char topology[] = "torus";
    char *topology_axis, mesh_axis[] = "XYZ", torus_axis[] = "XYZ";
    char *bglmpi_eager = NULL;
    char *bglmpi_mapping = NULL;
    char *bglmpi_pacing = NULL;
    
    rts_get_personality(&personality, sizeof(personality));
    MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
    MPI_Comm_rank(MPI_COMM_WORLD,&rank);

    /* determine mesh */
    dim = 0;
    strcpy(topology,"mesh");
    strcpy(mesh_axis,"");
    if (BGLPersonality_xSize(&personality) > 1) { ++dim; strcat(mesh_axis,"X"); }
    if (BGLPersonality_ySize(&personality) > 1) { ++dim; strcat(mesh_axis,"Y"); }
    if (BGLPersonality_zSize(&personality) > 1) { ++dim; strcat(mesh_axis,"Z"); }
    if (dim == 0) { dim = 1; strcpy(mesh_axis,"X"); }
    topology_axis = mesh_axis;
    
    /* determine torus */
    torus_dim = 0;
    strcpy(torus_axis,"");
    if (BGLPersonality_isTorusX(&personality)) { ++torus_dim; strcat(torus_axis,"X"); }
    if (BGLPersonality_isTorusY(&personality)) { ++torus_dim; strcat(torus_axis,"Y"); }
    if (BGLPersonality_isTorusZ(&personality)) { ++torus_dim; strcat(torus_axis,"Z"); }
    if (torus_dim > 0) { dim = torus_dim; strcpy(topology,"torus"); topology_axis = torus_axis; }

    /* determine BGLMPI_MAPPING */
    bglmpi_eager = getenv("BGLMPI_EAGER");
    bglmpi_mapping = getenv("BGLMPI_MAPPING");
    bglmpi_pacing = getenv("BGLMPI_PACING");
    
    /* print DDI Posix runtime */
    DDI_POSIX_Runtime_print(stream);

    /* print DDI Blue Gene/L runtime */
    fprintf(stream,"%i compute nodes, %s mode, %i I/O nodes\n",
	    BGLPersonality_numComputeNodes(&personality),
	    BGLPersonality_virtualNodeMode(&personality) ? "VN" : "CO",
	    BGLPersonality_numIONodes(&personality));
    fprintf(stream,"%i-D %s(%s) <%i,%i,%i>\n",
	    dim,topology,topology_axis,
	    BGLPersonality_xSize(&personality),
	    BGLPersonality_ySize(&personality),
	    BGLPersonality_zSize(&personality));
    if (bglmpi_eager) fprintf(stream,"BGLMPI_EAGER=%s\n", bglmpi_eager);
    if (bglmpi_mapping) fprintf(stream,"BGLMPI_MAPPING=%s\n", bglmpi_mapping);
    if (bglmpi_pacing) fprintf(stream,"BGLMPI_PACING=%s\n", bglmpi_pacing);
    fprintf(stream,"MPI %i/%i <%i,%i,%i> %iMHz %iMB\n",
	    rank,nprocs,
	    BGLPersonality_xCoord(&personality),
	    BGLPersonality_yCoord(&personality),
	    BGLPersonality_zCoord(&personality),
	    BGLPersonality_clockHz(&personality)/1000000,
	    BGLPersonality_DDRSize(&personality)/(1024*1024));

}