More bindings
This commit was SVN r2672.
Этот коммит содержится в:
родитель
a2667dae11
Коммит
148580acad
@ -46,11 +46,14 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_F90_COMPLEX,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_create_f90_complex_f(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_create_f90_complex_f(MPI_Fint *p, MPI_Fint *r,
|
||||
MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_newtype = MPI_Type_f2c(*newtype);
|
||||
|
||||
*ierr = MPI_Type_create_f90_complex(*p, *r, &c_newtype);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_create_f90_complex(OMPI_FINT_2_INT(*p),
|
||||
OMPI_FINT_2_INT(*r),
|
||||
&c_newtype));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f (c_newtype);
|
||||
|
@ -46,11 +46,13 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_F90_INTEGER,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_create_f90_integer_f(MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_create_f90_integer_f(MPI_Fint *r, MPI_Fint *newtype,
|
||||
MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_new = MPI_Type_f2c(*newtype);
|
||||
|
||||
*ierr = MPI_Type_create_f90_integer( *r, &c_new);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_create_f90_integer(OMPI_FINT_2_INT(*r),
|
||||
&c_new));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
|
@ -46,11 +46,14 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_F90_REAL,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_create_f90_real_f(MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_create_f90_real_f(MPI_Fint *p, MPI_Fint *r,
|
||||
MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_new = MPI_Type_f2c(*newtype);
|
||||
|
||||
*ierr = MPI_Type_create_f90_real(*p, *r, &c_new);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_create_f90_real(OMPI_FINT_2_INT(*p),
|
||||
OMPI_FINT_2_INT(*r),
|
||||
&c_new));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
|
@ -52,29 +52,41 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_HINDEXED,
|
||||
static const char FUNC_NAME[] = "MPI_TYPE_CREATE_HINDEXED";
|
||||
|
||||
|
||||
void mpi_type_create_hindexed_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_create_hindexed_f(MPI_Fint *count,
|
||||
MPI_Fint *array_of_blocklengths,
|
||||
MPI_Fint *array_of_displacements,
|
||||
MPI_Fint *oldtype, MPI_Fint *newtype,
|
||||
MPI_Fint *ierr)
|
||||
{
|
||||
int c_err;
|
||||
MPI_Datatype c_old = MPI_Type_f2c(*oldtype);
|
||||
MPI_Datatype c_new = MPI_Type_f2c(*newtype);
|
||||
MPI_Aint *c_disp_array;
|
||||
int i;
|
||||
OMPI_ARRAY_NAME_DECL(array_of_blocklengths);
|
||||
|
||||
c_disp_array = malloc(*count * sizeof(MPI_Aint));
|
||||
if (NULL == c_disp_array) {
|
||||
*ierr = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,
|
||||
FUNC_NAME);
|
||||
return;
|
||||
c_err = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,
|
||||
FUNC_NAME);
|
||||
*ierr = OMPI_INT_2_FINT(c_err);
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < *count; i++) {
|
||||
c_disp_array[i] = (MPI_Aint) array_of_displacements[i];
|
||||
}
|
||||
|
||||
OMPI_ARRAY_FINT_2_INT(array_of_blocklengths, *count);
|
||||
|
||||
*ierr = MPI_Type_create_hindexed(*count, array_of_blocklengths,
|
||||
c_disp_array, c_old, &c_new);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_create_hindexed(OMPI_FINT_2_INT(*count),
|
||||
OMPI_ARRAY_NAME_CONVERT(array_of_blocklengths),
|
||||
c_disp_array, c_old,
|
||||
&c_new));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
}
|
||||
|
||||
|
||||
OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_blocklengths);
|
||||
free(c_disp_array);
|
||||
}
|
||||
|
@ -46,14 +46,18 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_HVECTOR,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_create_hvector_f(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_create_hvector_f(MPI_Fint *count, MPI_Fint *blocklength,
|
||||
MPI_Fint *stride, MPI_Fint *oldtype,
|
||||
MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_old = MPI_Type_f2c(*oldtype);
|
||||
MPI_Datatype c_new;
|
||||
MPI_Aint c_stride = (MPI_Aint)*stride;
|
||||
|
||||
*ierr = MPI_Type_hvector(*count, *blocklength, c_stride,
|
||||
c_old, &c_new);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_hvector(OMPI_FINT_2_INT(*count),
|
||||
OMPI_FINT_2_INT(*blocklength),
|
||||
c_stride,
|
||||
c_old, &c_new));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
|
@ -46,16 +46,27 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_INDEXED_BLOCK,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_create_indexed_block_f(MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_create_indexed_block_f(MPI_Fint *count, MPI_Fint *blocklength,
|
||||
MPI_Fint *array_of_displacements,
|
||||
MPI_Fint *oldtype, MPI_Fint *newtype,
|
||||
MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_old = MPI_Type_f2c(*oldtype);
|
||||
MPI_Datatype c_new;
|
||||
OMPI_ARRAY_NAME_DECL(array_of_displacements);
|
||||
|
||||
*ierr = MPI_Type_create_indexed_block(*count, *blocklength, array_of_displacements,
|
||||
c_old, &c_new);
|
||||
OMPI_ARRAY_FINT_2_INT(array_of_displacements, *count);
|
||||
|
||||
*ierr = OMPI_INT_2_FINT(
|
||||
MPI_Type_create_indexed_block(OMPI_FINT_2_INT(*count),
|
||||
OMPI_FINT_2_INT(*blocklength),
|
||||
OMPI_ARRAY_NAME_CONVERT(array_of_displacements),
|
||||
c_old, &c_new));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
}
|
||||
|
||||
OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_displacements);
|
||||
}
|
||||
|
||||
|
@ -46,12 +46,16 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_RESIZED,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_create_resized_f(MPI_Fint *oldtype, MPI_Fint *lb, MPI_Fint *extent, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_create_resized_f(MPI_Fint *oldtype, MPI_Fint *lb,
|
||||
MPI_Fint *extent, MPI_Fint *newtype,
|
||||
MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_old = MPI_Type_f2c(*oldtype);
|
||||
MPI_Datatype c_new;
|
||||
|
||||
*ierr = MPI_Type_create_resized(c_old, *lb, *extent, &c_new);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_create_resized(c_old, (MPI_Aint)(*lb),
|
||||
(MPI_Aint)(*extent),
|
||||
&c_new));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
|
@ -52,12 +52,17 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_STRUCT,
|
||||
static const char FUNC_NAME[] = "MPI_TYPE_CREATE_STRUCT";
|
||||
|
||||
|
||||
void mpi_type_create_struct_f(MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Fint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_create_struct_f(MPI_Fint *count,
|
||||
MPI_Fint *array_of_block_lengths,
|
||||
MPI_Fint *array_of_displacements,
|
||||
MPI_Fint *array_of_types, MPI_Fint *newtype,
|
||||
MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_new;
|
||||
MPI_Datatype *c_type_old_array;
|
||||
MPI_Aint *c_disp_array;
|
||||
int i;
|
||||
OMPI_ARRAY_NAME_DECL(array_of_block_lengths);
|
||||
|
||||
c_type_old_array = malloc(*count * (sizeof(MPI_Datatype) +
|
||||
sizeof(MPI_Aint)));
|
||||
@ -73,8 +78,13 @@ void mpi_type_create_struct_f(MPI_Fint *count, MPI_Fint *array_of_block_lengths,
|
||||
c_type_old_array[i] = MPI_Type_f2c(array_of_types[i]);
|
||||
}
|
||||
|
||||
*ierr = MPI_Type_create_struct(*count, array_of_block_lengths,
|
||||
c_disp_array, c_type_old_array, &c_new);
|
||||
OMPI_ARRAY_FINT_2_INT(array_of_block_lengths, *count);
|
||||
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_create_struct(OMPI_FINT_2_INT(*count),
|
||||
OMPI_ARRAY_NAME_CONVERT(array_of_block_lengths),
|
||||
c_disp_array, c_type_old_array, &c_new));
|
||||
|
||||
OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_block_lengths);
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
|
@ -46,20 +46,35 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_SUBARRAY,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_create_subarray_f(MPI_Fint *ndims, MPI_Fint *size_array, MPI_Fint *subsize_array, MPI_Fint *start_array, MPI_Fint *order, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_create_subarray_f(MPI_Fint *ndims, MPI_Fint *size_array,
|
||||
MPI_Fint *subsize_array,
|
||||
MPI_Fint *start_array, MPI_Fint *order,
|
||||
MPI_Fint *oldtype, MPI_Fint *newtype,
|
||||
MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_old;
|
||||
MPI_Datatype c_new;
|
||||
OMPI_ARRAY_NAME_DECL(size_array);
|
||||
OMPI_ARRAY_NAME_DECL(subsize_array);
|
||||
OMPI_ARRAY_NAME_DECL(start_array);
|
||||
|
||||
c_old = MPI_Type_f2c(*oldtype);
|
||||
|
||||
*ierr = MPI_Type_create_subarray(*ndims,
|
||||
size_array,
|
||||
subsize_array,
|
||||
start_array,
|
||||
*order, c_old, &c_new);
|
||||
OMPI_ARRAY_FINT_2_INT(size_array, *ndims);
|
||||
OMPI_ARRAY_FINT_2_INT(subsize_array, *ndims);
|
||||
OMPI_ARRAY_FINT_2_INT(start_array, *ndims);
|
||||
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_create_subarray(OMPI_FINT_2_INT(*ndims),
|
||||
OMPI_ARRAY_NAME_CONVERT(size_array),
|
||||
OMPI_ARRAY_NAME_CONVERT(subsize_array),
|
||||
OMPI_ARRAY_NAME_CONVERT(start_array),
|
||||
*order, c_old, &c_new));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
}
|
||||
|
||||
OMPI_ARRAY_FINT_2_INT_CLEANUP(size_array);
|
||||
OMPI_ARRAY_FINT_2_INT_CLEANUP(subsize_array);
|
||||
OMPI_ARRAY_FINT_2_INT_CLEANUP(start_array);
|
||||
}
|
||||
|
@ -46,11 +46,14 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_DELETE_ATTR,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_delete_attr_f(MPI_Fint *type, MPI_Fint *type_keyval, MPI_Fint *ierr)
|
||||
void mpi_type_delete_attr_f(MPI_Fint *type, MPI_Fint *type_keyval,
|
||||
MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_type = MPI_Type_f2c(*type);
|
||||
|
||||
*ierr = MPI_Type_delete_attr( c_type, *type_keyval );
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_delete_attr(c_type,
|
||||
OMPI_FINT_2_INT(*type_keyval)
|
||||
));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*type = MPI_Type_c2f( c_type );
|
||||
|
@ -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 = MPI_Type_dup(c_type, &c_new);
|
||||
*ierr = OMPI_FINT_2_INT(MPI_Type_dup(c_type, &c_new));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
|
@ -51,7 +51,7 @@ void mpi_type_extent_f(MPI_Fint *type, MPI_Fint *extent, MPI_Fint *ierr)
|
||||
MPI_Datatype c_type = MPI_Type_f2c(*type);
|
||||
MPI_Aint c_extent;
|
||||
|
||||
*ierr = MPI_Type_extent(c_type, &c_extent);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_extent(c_type, &c_extent));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*extent = (MPI_Fint)c_extent;
|
||||
|
@ -46,9 +46,16 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_GET_ATTR,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_get_attr_f(MPI_Fint *type, MPI_Fint *type_keyval, char *attribute_val, MPI_Fint *flag, MPI_Fint *ierr)
|
||||
void mpi_type_get_attr_f(MPI_Fint *type, MPI_Fint *type_keyval,
|
||||
char *attribute_val, MPI_Fint *flag, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_type = MPI_Type_f2c( *type );
|
||||
OMPI_SINGLE_NAME_DECL(flag);
|
||||
|
||||
*ierr = MPI_Type_get_attr( c_type, *type_keyval, attribute_val, flag );
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_get_attr(c_type,
|
||||
OMPI_FINT_2_INT(*type_keyval),
|
||||
attribute_val,
|
||||
OMPI_SINGLE_NAME_CONVERT(flag)));
|
||||
|
||||
OMPI_SINGLE_INT_2_FINT(flag);
|
||||
}
|
||||
|
@ -52,12 +52,17 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_GET_CONTENTS,
|
||||
static const char FUNC_NAME[] = "MPI_TYPE_GET_CONTENTS";
|
||||
|
||||
|
||||
void mpi_type_get_contents_f(MPI_Fint *mtype, MPI_Fint *max_integers, MPI_Fint *max_addresses, MPI_Fint *max_datatypes, MPI_Fint *array_of_integers, MPI_Fint *array_of_addresses, MPI_Fint *array_of_datatypes, MPI_Fint *ierr)
|
||||
void mpi_type_get_contents_f(MPI_Fint *mtype, MPI_Fint *max_integers,
|
||||
MPI_Fint *max_addresses, MPI_Fint *max_datatypes,
|
||||
MPI_Fint *array_of_integers,
|
||||
MPI_Fint *array_of_addresses,
|
||||
MPI_Fint *array_of_datatypes, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Aint *c_address_array = NULL;
|
||||
MPI_Datatype *c_datatype_array = NULL;
|
||||
MPI_Datatype c_mtype = MPI_Type_f2c(*mtype);
|
||||
int i;
|
||||
OMPI_ARRAY_NAME_DECL(array_of_integers);
|
||||
|
||||
if (*max_datatypes) {
|
||||
c_datatype_array = malloc(*max_datatypes * sizeof(MPI_Datatype));
|
||||
@ -81,9 +86,14 @@ void mpi_type_get_contents_f(MPI_Fint *mtype, MPI_Fint *max_integers, MPI_Fint *
|
||||
}
|
||||
}
|
||||
|
||||
*ierr = MPI_Type_get_contents(c_mtype, *max_integers, *max_addresses,
|
||||
*max_datatypes, array_of_integers,
|
||||
c_address_array, c_datatype_array);
|
||||
OMPI_ARRAY_FINT_2_INT(array_of_integers, *max_integers);
|
||||
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_get_contents(c_mtype,
|
||||
OMPI_FINT_2_INT(*max_integers),
|
||||
OMPI_FINT_2_INT(*max_addresses),
|
||||
OMPI_FINT_2_INT(*max_datatypes),
|
||||
OMPI_ARRAY_NAME_CONVERT(array_of_integers),
|
||||
c_address_array, c_datatype_array));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
for (i = 0; i < *max_addresses; i++) {
|
||||
@ -95,4 +105,5 @@ void mpi_type_get_contents_f(MPI_Fint *mtype, MPI_Fint *max_integers, MPI_Fint *
|
||||
}
|
||||
free(c_address_array);
|
||||
free(c_datatype_array);
|
||||
OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_integers);
|
||||
}
|
||||
|
@ -46,10 +46,26 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_GET_ENVELOPE,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_get_envelope_f(MPI_Fint *type, MPI_Fint *num_integers, MPI_Fint *num_addresses, MPI_Fint *num_datatypes, MPI_Fint *combiner, MPI_Fint *ierr)
|
||||
void mpi_type_get_envelope_f(MPI_Fint *type, MPI_Fint *num_integers,
|
||||
MPI_Fint *num_addresses,
|
||||
MPI_Fint *num_datatypes, MPI_Fint *combiner,
|
||||
MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_type = MPI_Type_f2c(*type);
|
||||
OMPI_SINGLE_NAME_DECL(num_integers);
|
||||
OMPI_SINGLE_NAME_DECL(num_addresses);
|
||||
OMPI_SINGLE_NAME_DECL(num_datatypes);
|
||||
OMPI_SINGLE_NAME_DECL(combiner);
|
||||
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_get_envelope(c_type,
|
||||
OMPI_SINGLE_NAME_CONVERT(num_integers),
|
||||
OMPI_SINGLE_NAME_CONVERT(num_addresses),
|
||||
OMPI_SINGLE_NAME_CONVERT(num_datatypes),
|
||||
OMPI_SINGLE_NAME_CONVERT(combiner)));
|
||||
|
||||
OMPI_SINGLE_INT_2_FINT(num_integers);
|
||||
OMPI_SINGLE_INT_2_FINT(num_addresses);
|
||||
OMPI_SINGLE_INT_2_FINT(num_datatypes);
|
||||
OMPI_SINGLE_INT_2_FINT(combiner);
|
||||
|
||||
*ierr = MPI_Type_get_envelope(c_type, num_integers, num_addresses,
|
||||
num_datatypes, combiner);
|
||||
}
|
||||
|
@ -46,13 +46,14 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_GET_EXTENT,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_get_extent_f(MPI_Fint *type, MPI_Fint *lb, MPI_Fint *extent, MPI_Fint *ierr)
|
||||
void mpi_type_get_extent_f(MPI_Fint *type, MPI_Fint *lb,
|
||||
MPI_Fint *extent, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_type = MPI_Type_f2c(*type);
|
||||
MPI_Aint c_lb;
|
||||
MPI_Aint c_extent;
|
||||
|
||||
*ierr = MPI_Type_get_extent(c_type, &c_lb, &c_extent);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_get_extent(c_type, &c_lb, &c_extent));
|
||||
|
||||
if (MPI_SUCCESS == *ierr){
|
||||
*lb = (MPI_Fint) c_lb;
|
||||
|
@ -52,7 +52,9 @@ void mpi_type_get_true_extent_f(MPI_Fint *datatype, MPI_Fint *true_lb, MPI_Fint
|
||||
MPI_Aint c_true_lb;
|
||||
MPI_Aint c_true_extent;
|
||||
|
||||
*ierr = MPI_Type_get_true_extent(c_type, &c_true_lb, &c_true_extent);
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_get_true_extent(c_type,
|
||||
&c_true_lb,
|
||||
&c_true_extent));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*true_lb = (MPI_Fint) c_true_lb;
|
||||
|
@ -52,12 +52,15 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_HINDEXED,
|
||||
static const char FUNC_NAME[] = "MPI_TYPE_HINDEXED";
|
||||
|
||||
|
||||
void mpi_type_hindexed_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_hindexed_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths,
|
||||
MPI_Fint *array_of_displacements,
|
||||
MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_old = MPI_Type_f2c(*oldtype);
|
||||
MPI_Datatype c_new;
|
||||
MPI_Aint *c_disp_array;
|
||||
int i;
|
||||
OMPI_ARRAY_NAME_DECL(array_of_blocklengths);
|
||||
|
||||
c_disp_array = malloc(*count * sizeof(MPI_Aint));
|
||||
if (NULL == c_disp_array) {
|
||||
@ -68,12 +71,17 @@ void mpi_type_hindexed_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_F
|
||||
for (i = 0; i < *count; i++) {
|
||||
c_disp_array[i] = (MPI_Aint) array_of_displacements[i];
|
||||
}
|
||||
*ierr = MPI_Type_hindexed(*count, array_of_blocklengths,
|
||||
c_disp_array, c_old, &c_new);
|
||||
|
||||
OMPI_ARRAY_FINT_2_INT(array_of_blocklengths, *count);
|
||||
|
||||
*ierr = OMPI_INT_2_FINT(MPI_Type_hindexed(OMPI_FINT_2_INT(*count),
|
||||
OMPI_ARRAY_NAME_CONVERT(array_of_blocklengths),
|
||||
c_disp_array, c_old, &c_new));
|
||||
|
||||
if (MPI_SUCCESS == *ierr) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
}
|
||||
|
||||
free(c_disp_array);
|
||||
OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_blocklengths);
|
||||
}
|
||||
|
@ -46,7 +46,9 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_INDEXED,
|
||||
#include "mpi/f77/profile/defines.h"
|
||||
#endif
|
||||
|
||||
void mpi_type_indexed_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
void mpi_type_indexed_f(MPI_Fint *count, MPI_Fint *array_of_blocklengths,
|
||||
MPI_Fint *array_of_displacements, MPI_Fint *oldtype,
|
||||
MPI_Fint *newtype, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_old = MPI_Type_f2c(*oldtype);
|
||||
MPI_Datatype c_new;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user