2008-05-02 15:52:33 +04:00
|
|
|
/*
|
2009-01-11 05:30:00 +03:00
|
|
|
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
2008-05-02 15:52:33 +04:00
|
|
|
*
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OMPI_BTL_OPENIB_FD_H_
|
|
|
|
#define OMPI_BTL_OPENIB_FD_H_
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
BEGIN_C_DECLS
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Typedef for fd callback function
|
|
|
|
*/
|
2008-10-06 04:46:02 +04:00
|
|
|
typedef void *(ompi_btl_openib_fd_event_callback_fn_t)(int fd, int flags,
|
|
|
|
void *context);
|
2008-05-02 15:52:33 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Typedef for generic callback function
|
|
|
|
*/
|
2008-10-06 04:46:02 +04:00
|
|
|
typedef void *(ompi_btl_openib_fd_main_callback_fn_t)(void *context);
|
2008-05-02 15:52:33 +04:00
|
|
|
|
|
|
|
/**
|
2008-10-06 04:46:02 +04:00
|
|
|
* Initialize fd monitoring.
|
|
|
|
* Called by the main thread.
|
2008-05-02 15:52:33 +04:00
|
|
|
*/
|
|
|
|
int ompi_btl_openib_fd_init(void);
|
|
|
|
|
|
|
|
/**
|
2008-10-06 04:46:02 +04:00
|
|
|
* Start monitoring an fd.
|
|
|
|
* Called by main or service thread; callback will be in service thread.
|
2008-05-02 15:52:33 +04:00
|
|
|
*/
|
|
|
|
int ompi_btl_openib_fd_monitor(int fd, int flags,
|
2008-10-06 04:46:02 +04:00
|
|
|
ompi_btl_openib_fd_event_callback_fn_t *callback,
|
2008-05-02 15:52:33 +04:00
|
|
|
void *context);
|
|
|
|
|
|
|
|
/**
|
2008-10-06 04:46:02 +04:00
|
|
|
* Stop monitoring an fd.
|
|
|
|
* Called by main or service thread; callback will be in service thread.
|
2008-05-02 15:52:33 +04:00
|
|
|
*/
|
|
|
|
int ompi_btl_openib_fd_unmonitor(int fd,
|
2008-10-06 04:46:02 +04:00
|
|
|
ompi_btl_openib_fd_event_callback_fn_t *callback,
|
2008-05-02 15:52:33 +04:00
|
|
|
void *context);
|
|
|
|
|
|
|
|
/**
|
2008-10-06 04:46:02 +04:00
|
|
|
* Run a function in the service thread.
|
|
|
|
* Called by the main thread.
|
2008-05-02 15:52:33 +04:00
|
|
|
*/
|
2008-10-06 04:46:02 +04:00
|
|
|
int ompi_btl_openib_fd_run_in_service(ompi_btl_openib_fd_main_callback_fn_t callback,
|
|
|
|
void *context);
|
2008-05-02 15:52:33 +04:00
|
|
|
|
|
|
|
/**
|
2008-10-06 04:46:02 +04:00
|
|
|
* Run a function in the main thread.
|
|
|
|
* Called by the service thread.
|
|
|
|
*/
|
|
|
|
int ompi_btl_openib_fd_run_in_main(ompi_btl_openib_fd_main_callback_fn_t callback,
|
|
|
|
void *context);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Finalize fd monitoring.
|
|
|
|
* Called by the main thread.
|
2008-05-02 15:52:33 +04:00
|
|
|
*/
|
|
|
|
int ompi_btl_openib_fd_finalize(void);
|
|
|
|
|
|
|
|
END_C_DECLS
|
|
|
|
|
|
|
|
#endif
|