2004-11-22 03:37:56 +03:00
|
|
|
/*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-11-22 03:37:56 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2005-04-21 18:58:25 +04:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* Progress engine for Open MPI
|
|
|
|
*/
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#ifndef _OMPI_PROGRESS_H_
|
|
|
|
#define _OMPI_PROGRESS_H_
|
2004-10-21 02:31:03 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2004-10-28 19:40:46 +04:00
|
|
|
|
2005-03-30 05:40:26 +04:00
|
|
|
/**
|
|
|
|
* Initialize the progress engine
|
|
|
|
*
|
|
|
|
* Initialize the progress engine, including constructing the
|
|
|
|
* proper locks and allocating space for the progress registration
|
|
|
|
* functions. At this point, any function in the progress engine
|
|
|
|
* interface may be called.
|
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC extern int opal_progress_init(void);
|
2005-02-16 20:42:07 +03:00
|
|
|
|
2005-03-30 05:40:26 +04:00
|
|
|
/**
|
|
|
|
* Configure the progress engine for executing MPI applications
|
|
|
|
*
|
2005-04-14 22:55:53 +04:00
|
|
|
* Register to receive any needed information from the GPR and
|
|
|
|
* intialize any data structures required for MPI applications.
|
2005-04-21 18:58:25 +04:00
|
|
|
*
|
2005-07-04 01:57:43 +04:00
|
|
|
* \note opal_progress_init() must be called before calling
|
2005-04-21 18:58:25 +04:00
|
|
|
* this function. Failure to do so is an error.
|
2005-03-30 05:40:26 +04:00
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC extern int opal_progress_mpi_init(void);
|
2005-03-30 05:40:26 +04:00
|
|
|
|
2005-04-14 22:55:53 +04:00
|
|
|
/**
|
|
|
|
* Turn on optimizations for MPI progress
|
2005-04-21 18:58:25 +04:00
|
|
|
*
|
|
|
|
* Turn on optimizations for MPI applications. This includes lowering
|
|
|
|
* the rate at which the event library is ticked if it is not under
|
|
|
|
* active use and possibly disabling the sched_yield call when the
|
|
|
|
* progress engine is idle
|
2005-04-14 22:55:53 +04:00
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC extern int opal_progress_mpi_enable(void);
|
2005-04-14 22:55:53 +04:00
|
|
|
|
2005-03-30 05:40:26 +04:00
|
|
|
/**
|
2005-07-04 01:57:43 +04:00
|
|
|
* Turn off all optimizations enabled by opal_progress_mpi_enable().
|
2005-04-21 18:58:25 +04:00
|
|
|
*
|
|
|
|
* Completely reverses all optimizations enabled by
|
2005-07-04 01:57:43 +04:00
|
|
|
* opal_progress_mpi_enable(). The event library resumes constant
|
2005-04-21 18:58:25 +04:00
|
|
|
* ticking and the progress engine yields the CPU when idle.
|
2005-03-30 05:40:26 +04:00
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC extern int opal_progress_mpi_disable(void);
|
2005-03-30 05:40:26 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Shut down the progress engine
|
|
|
|
*
|
|
|
|
* Shut down the progress engine. This includes deregistering all
|
|
|
|
* registered callbacks and freeing all resources. After finalize
|
|
|
|
* returns, no calls into the progress interface are allowed.
|
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC extern int opal_progress_finalize(void);
|
2005-03-30 05:40:26 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Control how the event library is called
|
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC extern void opal_progress_events(int);
|
2004-10-28 19:40:46 +04:00
|
|
|
|
2005-03-30 05:40:26 +04:00
|
|
|
/**
|
|
|
|
* Progress all pending events
|
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC extern void opal_progress(void);
|
2004-10-28 19:40:46 +04:00
|
|
|
|
2005-07-04 01:57:43 +04:00
|
|
|
typedef int (*opal_progress_callback_t)(void);
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-03-30 05:40:26 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Register an event to be progressed
|
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC int opal_progress_register(opal_progress_callback_t cb);
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-03-30 05:40:26 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Unregister previously registered event
|
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC int opal_progress_unregister(opal_progress_callback_t cb);
|
2005-03-18 06:43:59 +03:00
|
|
|
|
2005-03-30 05:40:26 +04:00
|
|
|
|
2005-04-21 18:58:25 +04:00
|
|
|
/**
|
|
|
|
* Increase count of MPI users of the event library
|
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC int opal_progress_event_increment(void);
|
2005-04-21 18:58:25 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Decrease count of MPI users of the event library
|
|
|
|
*/
|
2005-07-04 01:57:43 +04:00
|
|
|
OMPI_DECLSPEC int opal_progress_event_decrement(void);
|
2005-04-21 18:58:25 +04:00
|
|
|
|
2004-10-21 02:31:03 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2004-04-06 20:32:40 +04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|