liberty/lib/LAMP/LAMPparSampleLib/hooks/lamp_hooks_par.cpp
/* Master function to handle all splitting of work,
   this could become a major bottle neck, can we split it up?
   SRB
 */
Master function to handle all splitting of work,
this could become a major bottle neck, can we split it up.
SRB
Master function to handle all splitting of work this could become a major bottle neck can we split it up . SRB
void* master(void *arg)
{
#if DEBUG
  printf("Starting Master Thread...\n");
  mstart = time(NULL);
#endif
  uint32_t type;
  uint64_t  tmp;
  tmp = sq_consume(q);
  sq_consume(q);
  type = tmp >> 32;
  while ( type != FINISH )
  {
    switch(type)
    {
      case FINISH:
        pthread_exit(NULL);
        break;
      default:
        break;
    }
    tmp = sq_consume(q);
    sq_consume(q);
    type = tmp >> 32;
  }
#if DEBUG
  end = time(NULL);
  printf("Master thread exiting, took %f minutes\n", difftime(end,start)/60.0 );
#endif
  pthread_exit(NULL);
}
void * master ( void * arg ) { #if DEBUG printf ( " \n " ) ; mstart = time ( NULL ) ; #endif uint32_t type ; uint64_t tmp ; tmp = sq_consume ( q ) ; sq_consume ( q ) ; type = tmp >> 32 ; while ( type != FINISH ) { switch ( type ) { case FINISH : pthread_exit ( NULL ) ; break ; default : break ; } tmp = sq_consume ( q ) ; sq_consume ( q ) ; type = tmp >> 32 ; } #if DEBUG end = time ( NULL ) ; printf ( " \n " , difftime ( end , start ) / 60.0 ) ; #endif pthread_exit ( NULL ) ; }
Master function to handle all splitting of work,
this could become a major bottle neck, can we split it up?
Master function to handle all splitting of work this could become a major bottle neck can we split it up?
//int i=0; /*, instr*/ /*addr, value,*/ /*addr = */ /*instr = tmp;*/ /*value = 0;*/ /*
      case L1:
        LAMP_load<uint8_t>(instr, addr);
        break;
      case L2:
        LAMP_load<uint16_t>(instr, addr);
        break;
      case L4:
        LAMP_load<uint32_t>(instr, addr);
        break;
      case L8:
        LAMP_load<uint64_t>(instr, addr);
        break;

      case S1:
        LAMP_store<uint8_t>(instr, addr, value);
        break;
      case S2:
        LAMP_store<uint16_t>(instr, addr, value);
        break;
      case S4:
        LAMP_store<uint32_t>(instr, addr, value);
        break;
      case S8:
        LAMP_store<uint64_t>(instr, addr, value);
        break;

      case LIB:
        LAMP_loop_iteration_begin_par();
        break;
      case LI:
        LAMP_loop_invocation_par(instr);
        break;
      case LE:
        LAMP_loop_exit_par();
        break;
*/ /*addr = */ /*instr = tmp;*/