Exemple #1
0
/* bgl/bgp timers */
void metric_read_bgtimers(int tid, int idx, double values[]) {
#ifdef TAU_BGL
  static double bgl_clockspeed = 0.0;

  if (bgl_clockspeed == 0.0) {
    BGLPersonality mybgl;
    rts_get_personality(&mybgl, sizeof(BGLPersonality));
    bgl_clockspeed = 1.0e6 / (double)BGLPersonality_clockHz(&mybgl);
  }
  values[idx] = (rts_get_timebase() * bgl_clockspeed);
#endif /* TAU_BGL */

#ifdef TAU_BGP
#ifdef BGP_TIMERS
  static double bgp_clockspeed = 0.0;

  if (bgp_clockspeed == 0.0) {
    _BGP_Personality_t mybgp;
    Kernel_GetPersonality(&mybgp, sizeof(_BGP_Personality_t));
    bgp_clockspeed = 1.0 / (double)BGP_Personality_clockMHz(&mybgp);
  }
  values[idx] =  (_bgp_GetTimeBase() * bgp_clockspeed);
#else /* TAU_BGPTIMERS */
  printf("TAU: Error: You must specify -BGPTIMERS at configure time\n");
  values[idx] = 0;
#endif /* TAU_BGPTIMERS */
#endif /* TAU_BGP */
}
/* platform specific initialization */
void vt_pform_init() {
  rts_get_personality(&mybgl, sizeof(BGLPersonality));
#if TIMER == TIMER_RTS_GET_TIMEBASE
  vt_ticks_per_sec = (uint64_t)BGLPersonality_clockHz(&mybgl);
#elif TIMER == TIMER_PAPI_REAL_USEC
  vt_time_base = vt_metric_real_usec();
#endif
}
Exemple #3
0
    Main(CkArgMsg* m) {
#if CMK_BLUEGENEL
      BGLPersonality bgl_p;
      int i = rts_get_personality(&bgl_p, sizeof(BGLPersonality));
#elif CMK_BLUEGENEP
      DCMF_Hardware_t bgp_hwt;
      DCMF_Hardware(&bgp_hwt);
#elif XT3_TOPOLOGY
      XT3TorusManager xt3tm;
#elif XT4_TOPOLOGY || XT5_TOPOLOGY
      XTTorusManager xttm;
#endif

      mainProxy = thishandle;
      CkPrintf("Testing TopoManager .... \n");
      TopoManager tmgr;
      CkPrintf("Torus Size [%d] [%d] [%d] [%d]\n", tmgr.getDimNX(), tmgr.getDimNY(), tmgr.getDimNZ(), tmgr.getDimNT());

#if CMK_BLUEGENEP
      CkPrintf("Torus Size [%d] [%d] [%d] [%d]\n", bgp_hwt.xSize, bgp_hwt.ySize, bgp_hwt.zSize, bgp_hwt.tSize);
#endif
      int x, y, z, t;

      for(int i=0; i<CkNumPes(); i++) {
	tmgr.rankToCoordinates(i, x, y, z, t);
	CkPrintf("---- Processor %d ---> x %d y %d z %d t %d\n", i, x, y, z, t);
#if CMK_BLUEGENEL
	unsigned int tmp_t, tmp_x, tmp_y, tmp_z;
	rts_coordinatesForRank(i, &tmp_x, &tmp_y, &tmp_z, &tmp_t);
	CkPrintf("Real Processor %d ---> x %d y %d z %d t %d\n", i, tmp_x, tmp_y, tmp_z, tmp_t);
#elif CMK_BLUEGENEP
	unsigned int tmp_t, tmp_x, tmp_y, tmp_z;
    #if (DCMF_VERSION_MAJOR >= 3)
	DCMF_NetworkCoord_t nc;
	DCMF_Messager_rank2network(i, DCMF_DEFAULT_NETWORK, &nc);
	tmp_x = nc.torus.x;
	tmp_y = nc.torus.y;
	tmp_z = nc.torus.z;
	tmp_t = nc.torus.t;
    #else
	DCMF_Messager_rank2torus(c, &tmp_x, &tmp_y, &tmp_z, &tmp_t);
    #endif
	CkPrintf("Real Processor %d ---> x %d y %d z %d t %d\n", i, tmp_x, tmp_y, tmp_z, tmp_t);
#elif XT3_TOPOLOGY
	int tmp_t, tmp_x, tmp_y, tmp_z;
	xt3tm.realRankToCoordinates(i, tmp_x, tmp_y, tmp_z, tmp_t);
	CkPrintf("Real Processor %d ---> x %d y %d z %d t %d\n", i, tmp_x, tmp_y, tmp_z, tmp_t);
#elif XT4_TOPOLOGY || XT5_TOPOLOGY
	int tmp_t, tmp_x, tmp_y, tmp_z;
	xttm.realRankToCoordinates(i, tmp_x, tmp_y, tmp_z, tmp_t);
	CkPrintf("Real Processor %d ---> x %d y %d z %d t %d\n", i, tmp_x, tmp_y, tmp_z, tmp_t);
#endif
      } // end of for loop

      int size = tmgr.getDimNX() * tmgr.getDimNY() * tmgr.getDimNZ();
      CkPrintf("Torus Contiguity Metric %d : %d [%f] \n", size, CkNumPes()/tmgr.getDimNT(), (float)(CkNumPes())/(tmgr.getDimNT()*size) );
      CkExit();
    };
 double bsp_rdtsc() {
     static double bgl_clockspeed = 0.0;
     if (bgl_clockspeed == 0.0)
     {
         BGLPersonality mybgl;
         rts_get_personality(&mybgl, sizeof(BGLPersonality));
         bgl_clockspeed = 1.0e6/(double)BGLPersonality_clockHz(&mybgl);
     }
     return (rts_get_timebase() * bgl_clockspeed);
 }
/* platform specific initialization */
void elg_pform_init() {
  rts_get_personality(&mybgl, sizeof(BGLPersonality));
  elg_clockspeed = 1.0/(double)BGLPersonality_clockHz(&mybgl);
}
Exemple #6
0
// this will return number of nanoseconds in a single BGL cycle
// use for converting from cycle units returned by rts_gettimebase
// to nanoseconds.
static double get_ns_per_cycle() {
    BGLPersonality personality;
    if (rts_get_personality(&personality, sizeof(personality)) != 0)
        return 0;
    return 1.0e9/((double) personality.clockHz);
}
Exemple #7
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 #8
0
void init_qmp(int * argc, char ***argv) {

#if 0
  printf("init_qmp(%d %p)\n",*argc,*argv);
  for(int i = 0; i<*argc;i++){
    printf("argv[%d](before)=%s\n",i,(*argv)[i]); 
  }
#endif

#if 0
   spi_init();
#endif
  
    QMP_thread_level_t prv;
#ifndef UNIFORM_SEED_NO_COMMS
    QMP_status_t init_status = QMP_init_msg_passing(argc, argv, QMP_THREAD_SINGLE, &prv);
    if (init_status) printf("QMP_init_msg_passing returned %d\n",init_status);
    peRank = QMP_get_node_number();
    peNum = QMP_get_number_of_nodes();
    if(!peRank)printf("QMP_init_msg_passing returned %d\n",init_status);

    if (init_status != QMP_SUCCESS) {
      QMP_error("%s\n",QMP_error_string(init_status));
    }

    // check QMP thread level
    // Added by Hantao
    if(peRank == 0) {
        switch(prv) {
        case QMP_THREAD_SINGLE:
            printf("QMP thread level = QMP_THREAD_SINGLE\n");
            break;
        case QMP_THREAD_FUNNELED:
            printf("QMP thread level = QMP_THREAD_FUNNELED\n");
            break;
        case QMP_THREAD_SERIALIZED:
            printf("QMP thread level = QMP_THREAD_SERIALIZED\n");
            break;
        case QMP_THREAD_MULTIPLE:
            printf("QMP thread level = QMP_THREAD_MULTIPLE\n");
            break;
        default:
            printf("QMP thread level = no idea what this is, boom!\n");
        }
    }

    //Check to make sure that this machine is a GRID machine
    //Exit if not GRID machine
    QMP_ictype qmp_type = QMP_get_msg_passing_type();

    //Get information about the allocated machine
    peNum = QMP_get_number_of_nodes();
    NDIM = QMP_get_allocated_number_of_dimensions();
    peGrid = QMP_get_allocated_dimensions();
    pePos = QMP_get_allocated_coordinates();

    if(peRank==0){
      for(int i = 0; i<*argc;i++){
        printf("argv[%d])(after)=%s\n",i,(*argv)[i]); 
      }
    }
#else
    QMP_status_t init_status = QMP_SUCCESS;
    peRank=0;
    peNum=1;
    NDIM=4;
#endif

//#if (TARGET == BGL) || (TARGET == BGP)
  if (NDIM>5){
    peNum = 1;
    for(int i = 0;i<5;i++)
	peNum *= peGrid[i];
    peRank = peRank % peNum;
  }
  int if_print=1;
  for(int i = 0;i<NDIM;i++)
  if (pePos[i]>=2) if_print=0;

  if (if_print){
      printf("Rank=%d Num=%d NDIM=%d\n",peRank,peNum,NDIM);
      printf("dim:");
      for(int i = 0;i<NDIM;i++)
        printf(" %d",peGrid[i]);
      printf("\n");
      printf("pos:");
      for(int i = 0;i<NDIM;i++)
        printf(" %d",pePos[i]);
      printf("\n");

#if 0
    int rc;
    BGLPersonality pers;
    rts_get_personality(&pers, sizeof(pers));
    printf("from personality: %d %d %d %d\n",pers.xCoord,pers.yCoord,pers.zCoord,rts_get_processor_id());
#endif
  }


//     printf("from personality:\n");

#if 0
    if ( (qmp_type!= QMP_GRID) && (qmp_type !=QMP_MESH)  ) {
      QMP_error("CPS on QMP only implemented for GRID or MESH, not (%d) machines\n",qmp_type);
    }
#endif

//     printf("QMP_declare_logical_topology(peGrid, NDIM)\n");
#ifndef UNIFORM_SEED_NO_COMMS
    //Declare the logical topology (Redundant for GRID machines)
    if (QMP_declare_logical_topology(peGrid, NDIM) != QMP_SUCCESS) {
      QMP_error("Node %d: Failed to declare logical topology\n",peRank);
      exit(-4);
    }
#endif
    initialized = true;
  printf("Rank=%d init_qmp() done\n",peRank);
    
  }
Exemple #9
0
//------------------------------------------------------------------
// It fills in the buffer hdr_send_buf allocated in this file with
// 8x3=24 headers : one for each of x+, x-, y+, y-, z+, z-, t_, t-
// and for each of those for sizes 32B, 128B, 256B. The headers
// for t+, t- are set to 0, since they are not used by the memory
// communications.
//
// It also sets the hint bits for nearest neighbor communication.
//
// Should be called once before any other routines in this file are 
// used. 
//------------------------------------------------------------------
void BGLCPSTorusPacketHeader_InitFill (void)
{
  int nn;
  int x, y, z;
  int Lx, Ly, Lz;
  int pir;
  BGLPersonality pers;

  // Get the core id 
  pir = rts_get_processor_id();

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

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

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

  // Fill the header for a packet destined to go to the 
  // nearest neighbor along x+
  if(x == Lx-1){
    nn = 0;
  } else {
    nn = x+1;
  }
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[0][0]), 1, 0, 0, 0, 0, 0, nn, y, z, pir, 0);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[0][1]), 1, 0, 0, 0, 0, 0, nn, y, z, pir, 3);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[0][2]), 1, 0, 0, 0, 0, 0, nn, y, z, pir, 7);


  // Fill the header for a packet destined to go to the 
  // nearest neighbor along x-
  if(x == 0){
    nn = Lx-1;
  } else {
    nn = x-1;
  }
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[1][0]), 0, 1, 0, 0, 0, 0, nn, y, z, pir, 0);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[1][1]), 0, 1, 0, 0, 0, 0, nn, y, z, pir, 3);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[1][2]), 0, 1, 0, 0, 0, 0, nn, y, z, pir, 7);

  // Fill the header for a packet destined to go to the 
  // nearest neighbor along y+
  if(y == Ly-1){
    nn = 0;
  } else {
    nn = y+1;
  }
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[2][0]), 0, 0, 1, 0, 0, 0, x, nn, z, pir, 0);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[2][1]), 0, 0, 1, 0, 0, 0, x, nn, z, pir, 3);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[2][2]), 0, 0, 1, 0, 0, 0, x, nn, z, pir, 7);

  // Fill the header for a packet destined to go to the 
  // nearest neighbor along y-
  if(y == 0){
    nn = Ly-1;
  } else {
    nn = y-1;
  }
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[3][0]), 0, 0, 0, 1, 0, 0, x, nn, z, pir, 0);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[3][1]), 0, 0, 0, 1, 0, 0, x, nn, z, pir, 3);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[3][2]), 0, 0, 0, 1, 0, 0, x, nn, z, pir, 7);

  // Fill the header for a packet destined to go to the 
  // nearest neighbor along z+
  if(z == Lz-1){
    nn = 0;
  } else {
    nn = z+1;
  }
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[4][0]), 0, 0, 0, 0, 1, 0, x, y, nn, pir, 0);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[4][1]), 0, 0, 0, 0, 1, 0, x, y, nn, pir, 3);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[4][2]), 0, 0, 0, 0, 1, 0, x, y, nn, pir, 7);

  // Fill the header for a packet destined to go to the 
  // nearest neighbor along z-
  if(z == 0){
    nn = Lz-1;
  } else {
    nn = z-1;
  }
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[5][0]), 0, 0, 0, 0, 0, 1, x, y, nn, pir, 0);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[5][1]), 0, 0, 0, 0, 0, 1, x, y, nn, pir, 3);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[5][2]), 0, 0, 0, 0, 0, 1, x, y, nn, pir, 7);

  // Fill a dummy header for t+ with 0 
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[6][0]), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[6][1]), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[6][2]), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

  // Fill a dummy header for t- with 0 
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[7][0]), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[7][1]), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  BGLCPSTorusPacketHeader_Init(&(hdr_send_buf[7][2]), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);


}
int main(int argc, char* argv[]) {
  double v1[N], v2[N], v3[N], r1[N], r2[N];
  double a=1.01,b=1.02,c=1.03,t=0.0,t2=0.0;
  int i, rank;
  int retval, perr, ev_set = PAPI_NULL;
  int encoding;
  long long counts[NCOUNTS];

#include "bglpersonality.h"
#include "rts.h"

  if(PAPI_VER_CURRENT!=(perr=PAPI_library_init(PAPI_VER_CURRENT)))
    printf("\nPAPI_library_init failed. %s\n",PAPI_strerror(perr));

 {
   BGLPersonality me;
   rts_get_personality(&me,sizeof(me));
   if(me.xCoord != 0 ) goto fine;
   if(me.yCoord != 0 ) goto fine;
   if(me.zCoord != 0 ) goto fine;
 }

  for(i=0;i<N;i++) {
    v1[i]=1.01+0.01*i;
    v2[i]=2.01+0.01*i;
    v3[i]=3.01+0.01*i;
    r1[i]=v1[i]*v2[i]+v3[i];
  }

  if((perr=PAPI_create_eventset(&ev_set)))
    printf("\nPAPI_create_eventset failed. %s\n",PAPI_strerror(perr));

  /*
  encoding=( BGL_FPU_ARITH_MULT_DIV & 0x3FF );
  encoding=( BGL_FPU_ARITH_ADD_SUBTRACT & 0x3FF );
  encoding=( BGL_FPU_ARITH_TRINARY_OP & 0x3FF );
  */

  if((perr=PAPI_add_event(ev_set,PAPI_TOT_CYC)))
    printf("PAPI_add_event failed. %s\n",PAPI_strerror(perr));

  retval = PAPI_event_name_to_code("BGL_FPU_ARITH_OEDIPUS_OP", &encoding);
  if (retval != PAPI_OK)
      printf("%s:%d  PAPI_event_name_to_code  %d\n", __FILE__,__LINE__, retval);

  if((perr=PAPI_add_event(ev_set,encoding)))
    printf("\nPAPI_add_event failed. %s\n",PAPI_strerror(perr));

  retval = PAPI_event_name_to_code("BGL_2NDFPU_ARITH_OEDIPUS_OP", &encoding);
  if (retval != PAPI_OK)
      printf("%s:%d  PAPI_event_name_to_code  %d\n", __FILE__,__LINE__, retval);
  
  if((perr=PAPI_add_event(ev_set,encoding)))
    printf("\nPAPI_add_event failed. %s\n",PAPI_strerror(perr));

  retval = PAPI_event_name_to_code("BGL_FPU_LDST_QUAD_LD", &encoding);
  if (retval != PAPI_OK)
      printf("%s:%d  PAPI_event_name_to_code  %d\n", __FILE__,__LINE__, retval);

  if((perr=PAPI_add_event(ev_set,encoding)))
    printf("\nPAPI_add_event failed. %s\n",PAPI_strerror(perr));


  retval = PAPI_event_name_to_code("BGL_2NDFPU_LDST_QUAD_LD", &encoding);
  if (retval != PAPI_OK)
      printf("%s:%d  PAPI_event_name_to_code  %d\n", __FILE__,__LINE__, retval);
  
  if((perr=PAPI_add_event(ev_set,encoding)))
    printf("\nPAPI_add_event failed. %s\n",PAPI_strerror(perr));


  printf("\nAssigning a vector of length %1d and computing "
	 "A()=B()*C()+D().\n",N);

  if((perr=PAPI_start(ev_set)))
    printf("\nPAPI_start_event failed. %s\n",PAPI_strerror(perr));

  for(i=0;i<N;i++) r2[i]=-1.001;
  fpmaddv(N,v1,v2,v3,r2);

  if((perr=PAPI_read(ev_set,counts)))
    printf("PAPI_read failed. %s\n",PAPI_strerror(perr));

  printf("Counts registered: ");
  for(i=0;i<NCOUNTS;i++) printf("  %12llu",counts[i]);
  printf("\n");


  for(i=0;i<N;i++) {
    printf(" %g * %g + % g = %g  (%g)\n",
	   v1[i],v2[i],v3[i],r2[i],r1[i]);
  }

  for(i=0;i<N;i++) r2[i]=-1.001;

  printf("\nResetting the running counter and computing "
	 "A(1:%1d)=B()*C()+D().\n",N);

  if((perr=PAPI_reset(ev_set)))
    printf("\nPAPI_reset failed. %s\n",PAPI_strerror(perr));

  fpmaddv(N,v1,v2,v3,r2);


  if((perr=PAPI_stop(ev_set,counts)))
    printf("PAPI_stop failed. %s\n",PAPI_strerror(perr));

  for(i=0;i<N;i++) {
    printf(" %g * %g + % g = %g  (%g)\n",
	   v1[i],v2[i],v3[i],r2[i],v1[i]*v2[i]+v3[i]);
  }

  printf("Testing to read stopped counters\n");
  if((perr=PAPI_read(ev_set,counts)))
    printf("PAPI_read failed. %s\n",PAPI_strerror(perr));
    
  printf("Counts registered: ");
  for(i=0;i<NCOUNTS;i++) printf("  %12llu",counts[i]);
  printf("\n");

 fine:
  PAPI_shutdown();
  return 0;
}
Exemple #11
0
/** Rank in I/O  */
int DDI_BGL_File_IO_rank(DDI_Comm *comm) {
    BGLPersonality personality;

    rts_get_personality(&personality, sizeof(personality));
    return BGLPersonality_rankInPset(&personality);
}
Exemple #12
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));

}
Exemple #13
0
/** Rank of I/O node */
int DDI_BGL_File_IONode_rank(DDI_Comm *comm) {
    BGLPersonality personality;
    
    rts_get_personality(&personality, sizeof(personality));
    return BGLPersonality_psetNum(&personality);
}