1
1
This commit was SVN r2676.
Этот коммит содержится в:
Vishal Sahay 2004-09-15 07:40:58 +00:00
родитель 6221cac318
Коммит b5e26196fa
19 изменённых файлов: 105 добавлений и 39 удалений

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

@ -56,7 +56,7 @@ void mpi_pack_size_f(MPI_Fint *incount, MPI_Fint *datatype,
c_comm = MPI_Comm_f2c(*comm);
c_type = MPI_Type_f2c(*datatype);
*ierr = OMPI_FINT_2_INT(MPI_Pack_size(OMPI_FINT_2_INT(*incount),
*ierr = OMPI_INT_2_FINT(MPI_Pack_size(OMPI_FINT_2_INT(*incount),
c_type, c_comm,
OMPI_SINGLE_NAME_CONVERT(size)));

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

@ -51,7 +51,7 @@ void mpi_type_dup_f(MPI_Fint *type, MPI_Fint *newtype, MPI_Fint *ierr)
MPI_Datatype c_type = MPI_Type_f2c(*type);
MPI_Datatype c_new;
*ierr = OMPI_FINT_2_INT(MPI_Type_dup(c_type, &c_new));
*ierr = OMPI_INT_2_FINT(MPI_Type_dup(c_type, &c_new));
if (MPI_SUCCESS == *ierr) {
*newtype = MPI_Type_c2f(c_new);

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

@ -52,9 +52,15 @@ void mpi_type_indexed_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths,
{
MPI_Datatype c_old = MPI_Type_f2c(*oldtype);
MPI_Datatype c_new;
OMPI_ARRAY_NAME_DECL(array_of_blocklengths);
*ierr = MPI_Type_indexed(*count, array_of_blocklengths,
array_of_displacements, c_old, &c_new);
OMPI_ARRAY_FINT_2_INT(array_of_blocklengths, *count);
*ierr = OMPI_INT_2_FINT(MPI_Type_indexed(OMPI_FINT_2_INT(*count),
OMPI_ARRAY_NAME_CONVERT(array_of_blocklengths),
array_of_displacements, c_old, &c_new));
OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_blocklengths);
if (MPI_SUCCESS == *ierr) {
*newtype = MPI_Type_c2f(c_new);

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

@ -51,7 +51,7 @@ void mpi_type_lb_f(MPI_Fint *type, MPI_Fint *lb, MPI_Fint *ierr)
MPI_Datatype c_type = MPI_Type_f2c(*type);
MPI_Aint c_lb;
*ierr = MPI_Type_lb(c_type, &c_lb);
*ierr = OMPI_INT_2_FINT(MPI_Type_lb(c_type, &c_lb));
if (MPI_SUCCESS == *ierr) {
*lb = (MPI_Fint)c_lb;

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

@ -50,7 +50,9 @@ void mpi_type_match_size_f(MPI_Fint *typeclass, MPI_Fint *size, MPI_Fint *type,
{
MPI_Datatype c_type;
*ierr = MPI_Type_match_size(*typeclass, *size, &c_type);
*ierr = OMPI_INT_2_FINT(MPI_Type_match_size(OMPI_FINT_2_INT(*typeclass),
OMPI_FINT_2_INT(*size),
&c_type));
if (MPI_SUCCESS == *ierr) {
*type = MPI_Type_c2f(c_type);

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

@ -50,7 +50,9 @@ void mpi_type_set_attr_f(MPI_Fint *type, MPI_Fint *type_keyval, char *attr_val,
{
MPI_Datatype c_type = MPI_Type_f2c( *type );
*ierr = MPI_Type_set_attr( c_type, *type_keyval, attr_val );
*ierr = OMPI_INT_2_FINT(MPI_Type_set_attr( c_type,
OMPI_FINT_2_INT(*type_keyval),
attr_val ));
if (MPI_SUCCESS == *ierr) {
*type = MPI_Type_c2f( c_type );

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

@ -49,6 +49,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_SIZE,
void mpi_type_size_f(MPI_Fint *type, MPI_Fint *size, MPI_Fint *ierr)
{
MPI_Datatype c_type = MPI_Type_f2c(*type);
OMPI_SINGLE_NAME_DECL(size);
*ierr = MPI_Type_size(c_type, size);
*ierr = OMPI_INT_2_FINT(MPI_Type_size(c_type,
OMPI_SINGLE_NAME_CONVERT(size)));
OMPI_SINGLE_INT_2_FINT(size);
}

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

@ -52,18 +52,23 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_STRUCT,
static const char FUNC_NAME[] = "MPI_TYPE_STRUCT";
void mpi_type_struct_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr)
void mpi_type_struct_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths,
MPI_Fint *array_of_displacements,
MPI_Fint *array_of_types, MPI_Fint *newtype,
MPI_Fint *ierr)
{
MPI_Aint *c_disp_array;
MPI_Datatype *c_type_old_array;
MPI_Datatype c_new;
int i;
int i, c_err;
OMPI_ARRAY_NAME_DECL(array_of_blocklengths);
c_type_old_array = malloc(*count * (sizeof(MPI_Datatype) +
sizeof(MPI_Aint)));
if (NULL == c_type_old_array) {
*ierr = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,
c_err = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,
FUNC_NAME);
*ierr = OMPI_INT_2_FINT(c_err);
return;
}
c_disp_array = (MPI_Aint*) c_type_old_array + *count;
@ -73,8 +78,14 @@ void mpi_type_struct_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fin
c_type_old_array[i] = MPI_Type_f2c(array_of_types[i]);
}
*ierr = MPI_Type_struct(*count, array_of_blocklengths, c_disp_array,
c_type_old_array, &c_new);
OMPI_ARRAY_FINT_2_INT(array_of_blocklengths, *count);
*ierr = OMPI_INT_2_FINT(MPI_Type_struct(OMPI_FINT_2_INT(*count),
OMPI_ARRAY_NAME_CONVERT(array_of_blocklengths),
c_disp_array,
c_type_old_array, &c_new));
OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_blocklengths);
if (MPI_SUCCESS == *ierr) {
*newtype = MPI_Type_c2f(c_new);
@ -82,3 +93,4 @@ void mpi_type_struct_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fin
free(c_type_old_array);
}

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

@ -51,7 +51,7 @@ void mpi_type_ub_f(MPI_Fint *mtype, MPI_Fint *ub, MPI_Fint *ierr)
MPI_Datatype c_mtype = MPI_Type_f2c(*mtype);
MPI_Aint c_ub;
*ierr = MPI_Type_ub(c_mtype, &c_ub);
*ierr = OMPI_INT_2_FINT(MPI_Type_ub(c_mtype, &c_ub));
if (MPI_SUCCESS == *ierr) {
*ub = (MPI_Fint)c_ub;

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

@ -46,15 +46,19 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_VECTOR,
#include "mpi/f77/profile/defines.h"
#endif
void mpi_type_vector_f(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr)
void mpi_type_vector_f(MPI_Fint *count, MPI_Fint *blocklength,
MPI_Fint *stride, MPI_Fint *oldtype,
MPI_Fint *newtype, MPI_Fint *ierr)
{
MPI_Datatype c_old;
MPI_Datatype c_new;
c_old = MPI_Type_f2c(*oldtype);
*ierr = MPI_Type_vector(*count, *blocklength, *stride,
c_old, &c_new);
*ierr = OMPI_INT_2_FINT(MPI_Type_vector(OMPI_FINT_2_INT(*count),
OMPI_FINT_2_INT(*blocklength),
OMPI_FINT_2_INT(*stride),
c_old, &c_new));
if (MPI_SUCCESS == *ierr) {
*newtype = MPI_Type_c2f(c_new);

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

@ -46,11 +46,18 @@ OMPI_GENERATE_F77_BINDINGS (MPI_UNPACK_EXTERNAL,
#include "mpi/f77/profile/defines.h"
#endif
void mpi_unpack_external_f (char *datarep, char *inbuf, MPI_Fint *insize, MPI_Fint *position, char *outbuf, MPI_Fint *outcount, MPI_Fint *datatype, MPI_Fint *ierr)
void mpi_unpack_external_f (char *datarep, char *inbuf, MPI_Fint *insize,
MPI_Fint *position, char *outbuf,
MPI_Fint *outcount, MPI_Fint *datatype,
MPI_Fint *ierr)
{
MPI_Datatype c_type;
c_type = MPI_Type_f2c(*datatype);
*ierr = MPI_Unpack_external(datarep, inbuf, *insize, (MPI_Aint *)position,
outbuf, *outcount, c_type);
*ierr = OMPI_INT_2_FINT(MPI_Unpack_external(datarep, inbuf,
(MPI_Aint)*insize,
(MPI_Aint *)position,
outbuf,
OMPI_FINT_2_INT(*outcount),
c_type));
}

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

@ -51,7 +51,7 @@ void mpi_wait_f(MPI_Fint *request, MPI_Fint *status, MPI_Fint *ierr)
MPI_Request c_req = MPI_Request_f2c(*request);
MPI_Status c_status;
*ierr = MPI_Wait(&c_req, &c_status);
*ierr = OMPI_INT_2_FINT(MPI_Wait(&c_req, &c_status));
if (MPI_SUCCESS == *ierr) {
/* reset request handle to MPI_REQUEST_NULL */

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

@ -52,7 +52,8 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WAITALL,
static const char FUNC_NAME[] = "MPI_WAITALL";
void mpi_waitall_f(MPI_Fint *count, MPI_Fint *array_of_requests, MPI_Fint *array_of_statuses, MPI_Fint *ierr)
void mpi_waitall_f(MPI_Fint *count, MPI_Fint *array_of_requests,
MPI_Fint *array_of_statuses, MPI_Fint *ierr)
{
MPI_Request *c_req;
MPI_Status *c_status;
@ -70,7 +71,8 @@ void mpi_waitall_f(MPI_Fint *count, MPI_Fint *array_of_requests, MPI_Fint *array
c_req[i] = MPI_Request_f2c(array_of_requests[i]);
}
*ierr = MPI_Waitall(*count, c_req, c_status);
*ierr = OMPI_INT_2_FINT(MPI_Waitall(OMPI_FINT_2_INT(*count),
c_req, c_status));
if (MPI_SUCCESS == *ierr) {
for (i = 0; i < *count; i++) {

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

@ -52,16 +52,19 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WAITANY,
static const char FUNC_NAME[] = "MPI_WAITANY";
void mpi_waitany_f(MPI_Fint *count, MPI_Fint *array_of_requests, MPI_Fint *index, MPI_Fint *status, MPI_Fint *ierr)
void mpi_waitany_f(MPI_Fint *count, MPI_Fint *array_of_requests,
MPI_Fint *index, MPI_Fint *status, MPI_Fint *ierr)
{
MPI_Request *c_req;
MPI_Status c_status;
int i;
int i, c_err;
OMPI_SINGLE_NAME_DECL(index);
c_req = malloc(*count * sizeof(MPI_Request));
if (NULL == c_req) {
*ierr = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,
c_err = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,
FUNC_NAME);
*ierr = OMPI_INT_2_FINT(c_err);
return;
}
@ -69,9 +72,13 @@ void mpi_waitany_f(MPI_Fint *count, MPI_Fint *array_of_requests, MPI_Fint *index
c_req[i] = MPI_Request_f2c(array_of_requests[i]);
}
*ierr = MPI_Waitany(*count, c_req, index, &c_status);
*ierr = OMPI_INT_2_FINT(MPI_Waitany(OMPI_FINT_2_INT(*count), c_req,
OMPI_SINGLE_NAME_CONVERT(index),
&c_status));
if (MPI_SUCCESS == *ierr) {
OMPI_SINGLE_INT_2_FINT(index);
/*
* Increment index by one for fortran conventions
*/
@ -79,6 +86,7 @@ void mpi_waitany_f(MPI_Fint *count, MPI_Fint *array_of_requests, MPI_Fint *index
*index += 1;
}
MPI_Status_c2f( &c_status, status);
}
free(c_req);
}

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

@ -52,11 +52,15 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WAITSOME,
static const char FUNC_NAME[] = "MPI_WAITSOME";
void mpi_waitsome_f(MPI_Fint *incount, MPI_Fint *array_of_requests, MPI_Fint *outcount, MPI_Fint *array_of_indices, MPI_Fint *array_of_statuses, MPI_Fint *ierr)
void mpi_waitsome_f(MPI_Fint *incount, MPI_Fint *array_of_requests,
MPI_Fint *outcount, MPI_Fint *array_of_indices,
MPI_Fint *array_of_statuses, MPI_Fint *ierr)
{
MPI_Request *c_req;
MPI_Status *c_status;
int i;
OMPI_SINGLE_NAME_DECL(outcount);
OMPI_ARRAY_NAME_DECL(array_of_indices);
c_req = malloc(*incount * (sizeof(MPI_Request) + sizeof(MPI_Status)));
if (NULL == c_req) {
@ -70,10 +74,15 @@ void mpi_waitsome_f(MPI_Fint *incount, MPI_Fint *array_of_requests, MPI_Fint *ou
c_req[i] = MPI_Request_f2c(array_of_requests[i]);
}
*ierr = MPI_Waitsome(*incount, c_req, outcount, array_of_indices,
c_status);
OMPI_ARRAY_FINT_2_INT_ALLOC(array_of_indices, *incount);
*ierr = OMPI_INT_2_FINT(MPI_Waitsome(OMPI_FINT_2_INT(*incount), c_req,
OMPI_SINGLE_NAME_CONVERT(outcount),
OMPI_ARRAY_NAME_CONVERT(array_of_indices),
c_status));
if (MPI_SUCCESS == *ierr) {
OMPI_SINGLE_INT_2_FINT(outcount);
OMPI_ARRAY_INT_2_FINT(array_of_indices, *incount);
/*
* Increment indexes by one for fortran conventions
*/

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

@ -69,7 +69,7 @@ void mpi_win_create_keyval_f(MPI_Fint *win_copy_attr_fn, MPI_Fint *win_delete_at
del_fn.attr_F_delete_fn = (MPI_F_delete_function *)win_delete_attr_fn;
ret = ompi_attr_create_keyval(WIN_ATTR, copy_fn, del_fn,
win_keyval, extra_state, OMPI_KEYVAL_F77);
win_keyval, extra_state, OMPI_KEYVAL_F77);
if (MPI_SUCCESS != ret) {
c_err = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,

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

@ -51,12 +51,13 @@ static const char FUNC_NAME[] = "MPI_Win_delete_attr_f";
void mpi_win_delete_attr_f(MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr)
{
MPI_Win c_win = MPI_Win_f2c( *win );
int ret;
int ret, c_err;
if (MPI_PARAM_CHECK) {
if (MPI_WIN_NULL == c_win) {
*ierr = OMPI_ERRHANDLER_INVOKE(c_win, MPI_ERR_WIN,
FUNC_NAME);
c_err = OMPI_ERRHANDLER_INVOKE(c_win, MPI_ERR_WIN,
FUNC_NAME);
*ierr = OMPI_INT_2_FINT(c_err);
}
}
@ -68,5 +69,4 @@ void mpi_win_delete_attr_f(MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr)
} else {
*ierr = MPI_SUCCESS;
}
}

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

@ -46,9 +46,16 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_GET_ATTR,
#include "mpi/f77/profile/defines.h"
#endif
void mpi_win_get_attr_f(MPI_Fint *win, MPI_Fint *win_keyval, char *attribute_val, MPI_Fint *flag, MPI_Fint *ierr)
void mpi_win_get_attr_f(MPI_Fint *win, MPI_Fint *win_keyval,
char *attribute_val, MPI_Fint *flag, MPI_Fint *ierr)
{
MPI_Win c_win = MPI_Win_f2c( *win );
OMPI_SINGLE_NAME_DECL(flag);
*ierr = MPI_Win_get_attr( c_win, *win_keyval, attribute_val, flag );
*ierr = OMPI_INT_2_FINT(MPI_Win_get_attr( c_win,
OMPI_FINT_2_INT(*win_keyval),
attribute_val,
OMPI_SINGLE_NAME_CONVERT(flag) ));
OMPI_SINGLE_INT_2_FINT(flag);
}

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

@ -46,9 +46,12 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_SET_ATTR,
#include "mpi/f77/profile/defines.h"
#endif
void mpi_win_set_attr_f(MPI_Fint *win, MPI_Fint *win_keyval, char *attribute_val, MPI_Fint *ierr)
void mpi_win_set_attr_f(MPI_Fint *win, MPI_Fint *win_keyval,
char *attribute_val, MPI_Fint *ierr)
{
MPI_Win c_win = MPI_Win_f2c( *win );
*ierr = MPI_Win_set_attr( c_win, *win_keyval, attribute_val );
*ierr = OMPI_INT_2_FINT(MPI_Win_set_attr( c_win,
OMPI_FINT_2_INT(*win_keyval),
attribute_val ));
}