Пример #1
0
/**
 * \brief Initialize the DCMF ARMCI resources
 */
int ARMCIX_Init ()
{
  DCMF_CriticalSection_enter(0);

  DCMF_Messager_initialize ();

  ARMCIX_DCMF_Connection_initialize ();

  /* Determine request pool defaults */
  int ARMCIX_DCMF_REQUESTPOOL_MAX = 1000;
  ENV_Int (getenv ("ARMCIX_DCMF_REQUESTPOOL_MAX"), &ARMCIX_DCMF_REQUESTPOOL_MAX);
  int ARMCIX_DCMF_REQUESTPOOL_INC = 0;
  ENV_Int (getenv ("ARMCIX_DCMF_REQUESTPOOL_INC"), &ARMCIX_DCMF_REQUESTPOOL_INC);
  ARMCIX_DCMF_request_initialize (ARMCIX_DCMF_REQUESTPOOL_MAX, ARMCIX_DCMF_REQUESTPOOL_INC);



  ARMCIX_DCMF_Get_register ();

  ARMCIX_DCMF_Put_register (__connection);

  ARMCIX_DCMF_Acc_register (__connection);

  ARMCIX_DCMF_Fence_register (__connection);

  ARMCIX_DCMF_Rmw_register ();

  /* Determine interrupt mode */
  int interrupts = 1;
  ENV_Bool (getenv ("DCMF_INTERRUPT"),  &interrupts);
  ENV_Bool (getenv ("DCMF_INTERRUPTS"), &interrupts);

  DCMF_Configure_t config;
  memset (&config, 0x00, sizeof(DCMF_Configure_t));
  config.interrupts = (interrupts==0)?DCMF_INTERRUPTS_OFF:DCMF_INTERRUPTS_ON;
  DCMF_Messager_configure (&config, &config);

  DCMF_Messager_configure (NULL, &config);

  //ARMCIX_DCMF_request_print ("after armcix_init");

  DCMF_CriticalSection_exit(0);

  return 0;
}
Пример #2
0
/**
 * \brief Initialize the DCMF ARMCI resources
 */
int ARMCIX_Init ()
{
  DCMF_CriticalSection_enter(0);

  DCMF_Messager_initialize ();

  ARMCIX_DCMF_Connection_initialize ();

  /* Determine request pool defaults */
  int ARMCIX_DCMF_REQUESTPOOL_MAX = 1000;
  ENV_Int (getenv ("ARMCIX_DCMF_REQUESTPOOL_MAX"), &ARMCIX_DCMF_REQUESTPOOL_MAX);
  int ARMCIX_DCMF_REQUESTPOOL_INC = 0;
  ENV_Int (getenv ("ARMCIX_DCMF_REQUESTPOOL_INC"), &ARMCIX_DCMF_REQUESTPOOL_INC);
  ARMCIX_DCMF_request_initialize (ARMCIX_DCMF_REQUESTPOOL_MAX, ARMCIX_DCMF_REQUESTPOOL_INC);



  ARMCIX_DCMF_Get_register ();

  ARMCIX_DCMF_Put_register (__connection);

  ARMCIX_DCMF_Acc_register (__connection);

  ARMCIX_DCMF_Fence_register (__connection);

  ARMCIX_DCMF_Rmw_register ();

  /* Initializer helper thread or configure interrupt mode */

  int interrupts = 0;
  ENV_Bool (getenv ("DCMF_INTERRUPT"),  &interrupts);
  ENV_Bool (getenv ("DCMF_INTERRUPTS"), &interrupts);
  //fprintf(stdout,"interrupts = %d\n",interrupts);
  /*if (interrupts==1){
     if( 0==DCMF_Messager_rank() ) fprintf(stdout,"DCMF interrupts ON\n");
  } else {
     if( 0==DCMF_Messager_rank() ) fprintf(stdout,"DCMF interrupts OFF\n");
  }*/

  if (interrupts==0) {
      int ret = pthread_create(&armcix_advance_thread, NULL, armcix_advance, NULL);
      if ( ret != 0 ) {
          if( 0==DCMF_Messager_rank() ) fprintf(stdout,"pthread_create failed\n");
          armcix_advance_active = 0;
      } else {
          if( 0==DCMF_Messager_rank() ) fprintf(stdout,"pthread_create succeeded\n");
          armcix_advance_active = 1;
      }
  }
  
  DCMF_Configure_t config;
  memset (&config, 0x00, sizeof(DCMF_Configure_t));
  config.interrupts = (interrupts==0)?DCMF_INTERRUPTS_OFF:DCMF_INTERRUPTS_ON;
  DCMF_Messager_configure (&config, &config);

  DCMF_Messager_configure (NULL, &config);

  //ARMCIX_DCMF_request_print ("after armcix_init");

  DCMF_CriticalSection_exit(0);

  return 0;
}