1
1

added implementation of the following functions.

This commit was SVN r1403.
Этот коммит содержится в:
Edgar Gabriel 2004-06-17 22:40:49 +00:00
родитель 6dd383b884
Коммит 66d555b070
5 изменённых файлов: 109 добавлений и 9 удалений

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "runtime/runtime.h"
#include "errhandler/errclass.h"
#include "communicator/communicator.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Add_error_class = PMPI_Add_error_class
@ -15,7 +18,23 @@
#include "mpi/c/profile/defines.h"
#endif
int MPI_Add_error_class(int *errorclass) {
return MPI_SUCCESS;
int MPI_Add_error_class(int *errorclass)
{
int class;
if ( MPI_PARAM_CHECK ) {
if ( ompi_mpi_finalized )
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
"MPI_Add_error_class");
}
class = ompi_errclass_add();
if ( 0 > class ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
"MPI_Add_error_class");
}
*errorclass = class;
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,10 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "runtime/runtime.h"
#include "errhandler/errcode.h"
#include "errhandler/errclass.h"
#include "communicator/communicator.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Add_error_code = PMPI_Add_error_code
@ -15,6 +19,26 @@
#include "mpi/c/profile/defines.h"
#endif
int MPI_Add_error_code(int errorclass, int *errorcode){
return MPI_SUCCESS;
int MPI_Add_error_code(int errorclass, int *errorcode)
{
int code;
if ( MPI_PARAM_CHECK ) {
if ( ompi_mpi_finalized)
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
"MPI_Add_error_code");
if ( ompi_errclass_is_invalid(errorclass) )
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Add_error_code");
}
code = ompi_mpi_errcode_add ( errorclass);
if ( 0 > code ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
"MPI_Add_error_code");
}
*errorcode = code;
return MPI_SUCCESS;
}

Просмотреть файл

@ -3,9 +3,13 @@
* * */
#include "ompi_config.h"
#include <stdio.h>
#include <string.h>
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "runtime/runtime.h"
#include "errhandler/errcode.h"
#include "communicator/communicator.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Add_error_string = PMPI_Add_error_string
@ -15,6 +19,24 @@
#include "mpi/c/profile/defines.h"
#endif
int MPI_Add_error_string(int errorcode, char *string){
return MPI_SUCCESS;
int MPI_Add_error_string(int errorcode, char *string)
{
int rc;
if ( MPI_PARAM_CHECK ) {
if ( ompi_mpi_finalized)
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
"MPI_Add_error_string");
if ( ompi_mpi_errcode_is_invalid(errorcode) )
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Add_error_string");
}
rc = ompi_mpi_errcode_add_string (errorcode, string, strlen(string)+1);
if ( OMPI_SUCCESS != rc ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
"MPI_Add_error_string");
}
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "runtime/runtime.h"
#include "errhandler/errcode.h"
#include "communicator/communicator.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Error_class = PMPI_Error_class
@ -15,6 +18,19 @@
#include "mpi/c/profile/defines.h"
#endif
int MPI_Error_class(int errorcode, int *errorclass) {
int MPI_Error_class(int errorcode, int *errorclass)
{
if ( MPI_PARAM_CHECK ) {
if ( ompi_mpi_finalized )
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
"MPI_Error_class");
if ( ompi_mpi_errcode_is_invalid(errorcode))
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Error_class");
}
*errorclass = ompi_mpi_errcode_get_class(errorcode);
return MPI_SUCCESS;
}

Просмотреть файл

@ -1,11 +1,14 @@
/*
* $HEADER$
*/
#include <string.h>
#include "ompi_config.h"
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "runtime/runtime.h"
#include "errhandler/errcode.h"
#include "communicator/communicator.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Error_string = PMPI_Error_string
@ -15,6 +18,22 @@
#include "mpi/c/profile/defines.h"
#endif
int MPI_Error_string(int errorcode, char *string, int *resultlen) {
int MPI_Error_string(int errorcode, char *string, int *resultlen)
{
char *tmpstring;
if ( MPI_PARAM_CHECK ) {
if ( ompi_mpi_finalized )
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
"MPI_Error_string");
if ( ompi_mpi_errcode_is_invalid(errorcode))
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Error_string");
}
tmpstring = ompi_mpi_errcode_get_string (errorcode);
strcpy(string, tmpstring);
*resultlen = strlen(string);
return MPI_SUCCESS;
}