本文整理汇总了C++中OMPI_ERRHANDLER_INVOKE函数的典型用法代码示例。如果您正苦于以下问题:C++ OMPI_ERRHANDLER_INVOKE函数的具体用法?C++ OMPI_ERRHANDLER_INVOKE怎么用?C++ OMPI_ERRHANDLER_INVOKE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OMPI_ERRHANDLER_INVOKE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MPI_Comm_set_errhandler
int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler)
{
/* Error checking */
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_comm_invalid(comm)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
FUNC_NAME);
} else if (NULL == errhandler ||
MPI_ERRHANDLER_NULL == errhandler ||
( OMPI_ERRHANDLER_TYPE_COMM != errhandler->eh_mpi_object_type &&
OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) {
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG,
FUNC_NAME);
}
}
/* Ditch the old errhandler, and decrement its refcount */
OBJ_RELEASE(comm->error_handler);
/* We have a valid comm and errhandler, so increment its refcount */
comm->error_handler = errhandler;
OBJ_RETAIN(comm->error_handler);
/* All done */
return MPI_SUCCESS;
}
示例2: MPI_Win_get_errhandler
int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler)
{
MPI_Errhandler tmp;
OPAL_CR_NOOP_PROGRESS();
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_win_invalid(win)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN,
FUNC_NAME);
} else if (NULL == errhandler) {
return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ARG,
FUNC_NAME);
}
}
/* On 64 bits environments we have to make sure the reading of the
error_handler became atomic. */
do {
tmp = win->error_handler;
} while (!OPAL_ATOMIC_CMPSET_PTR(&(win->error_handler), tmp, tmp));
/* Retain the errhandler, corresponding to object refcount
decrease in errhandler_free.c. */
OBJ_RETAIN(win->error_handler);
*errhandler = win->error_handler;
/* All done */
return MPI_SUCCESS;
}
示例3: MPI_Comm_get_name
int MPI_Comm_get_name(MPI_Comm comm, char *name, int *length)
{
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if ( ompi_comm_invalid ( comm ) )
return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_COMM,
FUNC_NAME);
if ( NULL == name || NULL == length )
return OMPI_ERRHANDLER_INVOKE ( comm, MPI_ERR_ARG,
FUNC_NAME);
}
#ifdef USE_MUTEX_FOR_COMMS
OPAL_THREAD_LOCK(&(comm->c_lock));
#endif
if ( comm->c_flags & OMPI_COMM_NAMEISSET ) {
strncpy ( name, comm->c_name, MPI_MAX_OBJECT_NAME );
*length = strlen ( comm->c_name );
}
else {
memset ( name, 0, MPI_MAX_OBJECT_NAME );
*length = 0;
}
#ifdef USE_MUTEX_FOR_COMMS
OPAL_THREAD_UNLOCK(&(comm->c_lock));
#endif
return MPI_SUCCESS;
}
示例4: MPI_Open_port
int MPI_Open_port(MPI_Info info, char *port_name)
{
int rc;
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if ( NULL == port_name ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME);
}
if (NULL == info || ompi_info_is_freed(info)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO,
FUNC_NAME);
}
}
if ( MPI_INFO_NULL != info ) {
/* in theory, they user might tell us here
how to establish the address. Since our communication
is relying on OOB, we probably won't use the info-object.
Potential values defined in MPI-2:
- "ip_port" : value contains IP port number
- "ip_address" : value contains IP address
*/
}
OPAL_CR_ENTER_LIBRARY();
rc = ompi_dpm_open_port(port_name);
OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
示例5: MPI_Publish_name
int MPI_Publish_name(char *service_name, MPI_Info info,
char *port_name)
{
int rc;
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if ( NULL == port_name || 0 == strlen(port_name) ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME);
}
if ( NULL == service_name || 0 == strlen(service_name) ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME);
}
if (NULL == info || ompi_info_is_freed(info)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO,
FUNC_NAME);
}
}
/*
* No predefined info-objects for this function in MPI-2,
* therefore, we do not parse the info-object at the moment.
*/
rc = ompi_comm_namepublish (service_name, port_name);
if ( OMPI_SUCCESS != rc ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
FUNC_NAME);
}
return MPI_SUCCESS;
}
示例6: MPI_Initialized
int MPI_Initialized(int *flag)
{
MPI_Comm null = NULL;
OPAL_CR_NOOP_PROGRESS();
if (MPI_PARAM_CHECK) {
if (NULL == flag) {
/* If we have an error, the action that we take depends on
whether we're currently (after MPI_Init and before
MPI_Finalize) or not */
if (ompi_mpi_initialized && !ompi_mpi_finalized) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME);
} else {
return OMPI_ERRHANDLER_INVOKE(null, MPI_ERR_ARG,
FUNC_NAME);
}
}
}
/* Pretty simple */
*flag = ompi_mpi_initialized;
return MPI_SUCCESS;
}
示例7: MPI_Pack_size
int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm,
int *size)
{
ompi_convertor_t local_convertor;
size_t length;
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (MPI_COMM_NULL == comm) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
FUNC_NAME);
} else if (NULL == size) {
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
} else if (MPI_DATATYPE_NULL == datatype) {
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
}
}
OBJ_CONSTRUCT( &local_convertor, ompi_convertor_t );
/* the resulting convertor will be set to the position ZERO */
ompi_convertor_copy_and_prepare_for_send( ompi_mpi_local_convertor, datatype, incount, NULL, 0, &local_convertor );
ompi_convertor_get_packed_size( &local_convertor, &length );
*size = (int)length;
OBJ_DESTRUCT( &local_convertor );
return MPI_SUCCESS;
}
示例8: MPI_Win_get_info
int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used)
{
int ret;
OPAL_CR_NOOP_PROGRESS();
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_win_invalid(win)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN, FUNC_NAME);
}
if (NULL == info_used) {
return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ARG, FUNC_NAME);
}
}
if (NULL == win->super.s_info) {
/*
* Setup any defaults if MPI_Win_set_info was never called
*/
opal_infosubscribe_change_info(win, &MPI_INFO_NULL->super);
}
(*info_used) = OBJ_NEW(ompi_info_t);
if (NULL == (*info_used)) {
return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_NO_MEM, FUNC_NAME);
}
ret = opal_info_dup(&win->super.s_info, &(*info_used)->super);
OMPI_ERRHANDLER_RETURN(ret, win, ret, FUNC_NAME);
}
示例9: MPI_File_get_info
int MPI_File_get_info(MPI_File fh, MPI_Info *info_used)
{
OPAL_CR_NOOP_PROGRESS();
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (NULL == info_used) {
return OMPI_ERRHANDLER_INVOKE(fh, MPI_ERR_INFO, FUNC_NAME);
}
if (ompi_file_invalid(fh)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
FUNC_NAME);
}
}
if (NULL == fh->super.s_info) {
/*
* Setup any defaults if MPI_Win_set_info was never called
*/
opal_infosubscribe_change_info(fh, &MPI_INFO_NULL->super);
}
(*info_used) = OBJ_NEW(ompi_info_t);
if (NULL == (*info_used)) {
return OMPI_ERRHANDLER_INVOKE(fh, MPI_ERR_NO_MEM, FUNC_NAME);
}
opal_info_dup(fh->super.s_info, &(*info_used)->super);
return OMPI_SUCCESS;
}
示例10: MPI_Comm_get_info
int MPI_Comm_get_info(MPI_Comm comm, MPI_Info *info_used)
{
OPAL_CR_NOOP_PROGRESS();
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (NULL == info_used) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO,
FUNC_NAME);
}
if (ompi_comm_invalid(comm)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
FUNC_NAME);
}
}
if (NULL == comm->super.s_info) {
/*
* Setup any defaults if MPI_Win_set_info was never called
*/
opal_infosubscribe_change_info(&comm->super, &MPI_INFO_NULL->super);
}
(*info_used) = OBJ_NEW(ompi_info_t);
if (NULL == (*info_used)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,
FUNC_NAME);
}
opal_info_t *opal_info_used = &(*info_used)->super;
opal_info_dup_mpistandard(comm->super.s_info, &opal_info_used);
return MPI_SUCCESS;
}
示例11: MPI_Comm_set_name
int MPI_Comm_set_name(MPI_Comm comm, char *name)
{
int rc;
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if ( ompi_comm_invalid ( comm ) ) {
return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_COMM,
FUNC_NAME);
}
if ( NULL == name ) {
return OMPI_ERRHANDLER_INVOKE ( comm, MPI_ERR_ARG,
FUNC_NAME);
}
}
rc = ompi_comm_set_name (comm, name );
/* -- Tracing information for new communicator name -- */
#if 0
/* Force TotalView DLL to take note of this name setting */
++ompi_tv_comm_sequence_number;
#endif
#if OMPI_PROFILING_DEFINES
#include "ompi/mpi/c/profile/defines.h"
#endif
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}
示例12: MPI_Win_set_errhandler
int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler)
{
MPI_Errhandler tmp;
OPAL_CR_NOOP_PROGRESS();
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_win_invalid(win)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN,
FUNC_NAME);
} else if (NULL == errhandler ||
MPI_ERRHANDLER_NULL == errhandler ||
(OMPI_ERRHANDLER_TYPE_WIN != errhandler->eh_mpi_object_type &&
OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) {
return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ARG, FUNC_NAME);
}
}
/* Prepare the new error handler */
OBJ_RETAIN(errhandler);
/* Ditch the old errhandler, and decrement its refcount. On 64
bits environments we have to make sure the reading of the
error_handler became atomic. */
do {
tmp = win->error_handler;
} while (!OPAL_ATOMIC_CMPSET(&(win->error_handler), tmp, errhandler));
OBJ_RELEASE(tmp);
/* All done */
return MPI_SUCCESS;
}
示例13: MPI_Win_get_name
int MPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen)
{
int ret;
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_win_invalid(win)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN, FUNC_NAME);
} else if (NULL == win_name || NULL == resultlen) {
return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ARG, FUNC_NAME);
}
}
OPAL_CR_ENTER_LIBRARY();
/* Note that MPI-2.1 requires:
- terminating the string with a \0
- name[*resultlen] == '\0'
- and therefore (*resultlen) cannot be > (MPI_MAX_OBJECT_NAME-1)
The Fortran API version will pad to the right if necessary.
Note that win->name is guaranteed to be \0-terminated and
able to completely fit into MPI_MAX_OBJECT_NAME bytes (i.e.,
name+\0). ompi_win_get_name() does the Right things. */
ret = ompi_win_get_name(win, win_name, resultlen);
OMPI_ERRHANDLER_RETURN(ret, win, ret, FUNC_NAME);
}
示例14: MPI_Win_set_errhandler
int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler)
{
MPI_Errhandler tmp;
OPAL_CR_NOOP_PROGRESS();
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_win_invalid(win)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN,
FUNC_NAME);
} else if (NULL == errhandler ||
MPI_ERRHANDLER_NULL == errhandler ||
(OMPI_ERRHANDLER_TYPE_WIN != errhandler->eh_mpi_object_type &&
OMPI_ERRHANDLER_TYPE_PREDEFINED != errhandler->eh_mpi_object_type) ) {
return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ARG, FUNC_NAME);
}
}
/* Prepare the new error handler */
OBJ_RETAIN(errhandler);
OPAL_THREAD_LOCK(&win->w_lock);
/* Ditch the old errhandler, and decrement its refcount. */
tmp = win->error_handler;
win->error_handler = errhandler;
OBJ_RELEASE(tmp);
OPAL_THREAD_UNLOCK(&win->w_lock);
/* All done */
return MPI_SUCCESS;
}
示例15: MPI_Type_hvector
int MPI_Type_hvector(int count,
int blocklength,
MPI_Aint stride,
MPI_Datatype oldtype,
MPI_Datatype *newtype)
{
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype ||
NULL == newtype) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE,
FUNC_NAME );
} else if (count < 0) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT,
FUNC_NAME );
} else if (blocklength < 0) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME );
}
}
return MPI_Type_create_hvector(count,
blocklength,
stride,
oldtype,
newtype);
}