Esempio n. 1
0
int
main( int argc, char *argv[] ) {
  // Initialize the Trema world
  init_trema( &argc, &argv );

  // =============================== Monitoring Manager ===============================
  /* Setup a timer to send request for querying port loading */
  add_periodic_event_callback( 10, send_my_port_loading_request, NULL );
  /* Setup a handler for the reply of query port loading  */
  add_callback_port_loading_requested( handle_port_loading_reply, NULL );
  /* Subscribe the port and flow notification */
  add_callback_port_loading_notified( alert_port_loading, NULL );
  add_callback_flow_loading_notified( alert_flow_loading, NULL );
  
  init_monitoring();
  send_monitoring_subscribe_request();
  // =============================== Monitoring Manager ===============================
  
  // Main loop
  start_trema();

  // Finalize monitoring
  finalize_monitoring();

  return 0;
}
static int mca_pml_monitoring_component_finish(void)
{
    if( mca_pml_monitoring_enabled && mca_pml_monitoring_active ) {
        /* Free internal data structure */
        finalize_monitoring();
        /* Call the original PML and then close */
        mca_pml_monitoring_active = 0;
        mca_pml_monitoring_enabled = 0;
        /* Restore the original PML */
        mca_pml_base_selected_component = pml_selected_component;
        mca_pml = pml_selected_module;
        /* Redirect the close call to the original PML */
        pml_selected_component.pmlm_finalize();
        /**
         * We should never release the last ref on the current component or face forever punishement.
         */
        /* mca_base_component_repository_release(&mca_pml_monitoring_component.pmlm_version); */
    }
    return OMPI_SUCCESS;
}