Fortran wrappers completed.
Reviewed by George Bosilca This commit was SVN r1306.
Этот коммит содержится в:
родитель
6511e29921
Коммит
54e823de56
@ -48,5 +48,11 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_COMMIT,
|
||||
|
||||
void mpi_type_commit_f(MPI_Fint *type, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_type = MPI_Type_f2c(*type);
|
||||
|
||||
*ierr = MPI_Type_commit(&c_type);
|
||||
|
||||
if (*ierr == MPI_SUCCESS)
|
||||
*type = MPI_Type_c2f(c_type);
|
||||
|
||||
}
|
||||
|
@ -48,5 +48,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_F90_COMPLEX,
|
||||
|
||||
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);
|
||||
|
||||
if (*ierr == MPI_SUCCESS)
|
||||
*newtype = MPI_Type_c2f (c_newtype);
|
||||
}
|
||||
|
@ -48,5 +48,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_F90_INTEGER,
|
||||
|
||||
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);
|
||||
|
||||
if (*ierr == MPI_SUCCESS)
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
}
|
||||
|
@ -48,5 +48,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_F90_REAL,
|
||||
|
||||
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);
|
||||
|
||||
if (*ierr == MPI_SUCCESS)
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
}
|
||||
|
@ -48,5 +48,17 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_SUBARRAY,
|
||||
|
||||
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;
|
||||
|
||||
c_old = MPI_Type_f2c(*oldtype);
|
||||
|
||||
*ierr = MPI_Type_create_subarray(*ndims,
|
||||
size_array,
|
||||
subsize_array,
|
||||
start_array,
|
||||
*order, c_old, &c_new);
|
||||
|
||||
if (*ierr == MPI_SUCCESS)
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
}
|
||||
|
@ -48,5 +48,8 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_GET_ENVELOPE,
|
||||
|
||||
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);
|
||||
|
||||
*ierr = MPI_Type_get_envelope(c_type, num_integers, num_addresses,
|
||||
num_datatypes, combiner);
|
||||
}
|
||||
|
@ -48,5 +48,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_GET_NAME,
|
||||
|
||||
void mpi_type_get_name_f(MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_type = MPI_Type_f2c(*type);
|
||||
|
||||
*ierr = MPI_Type_get_name(c_type, type_name, resultlen);
|
||||
}
|
||||
|
@ -48,5 +48,7 @@ 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);
|
||||
|
||||
*ierr = MPI_Type_size(c_type, size);
|
||||
}
|
||||
|
@ -48,5 +48,34 @@ OMPI_GENERATE_F77_BINDINGS (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)
|
||||
{
|
||||
MPI_Aint *c_disp_array;
|
||||
MPI_Datatype *c_type_old_array;
|
||||
MPI_Datatype c_new;
|
||||
int i;
|
||||
|
||||
c_type_old_array = malloc(*count * sizeof(MPI_Datatype));
|
||||
if (c_type_old_array == (MPI_Datatype *) NULL) {
|
||||
*ierr = MPI_ERR_INTERN;
|
||||
return;
|
||||
}
|
||||
|
||||
c_disp_array = malloc(*count * sizeof(MPI_Aint));
|
||||
if (c_disp_array == (MPI_Aint *) NULL) {
|
||||
*ierr = MPI_ERR_INTERN;
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < *count; i++) {
|
||||
c_disp_array[i] = (MPI_Aint) array_of_displacements[i];
|
||||
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);
|
||||
|
||||
if (*ierr == MPI_SUCCESS)
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
|
||||
free(c_type_old_array);
|
||||
free(c_disp_array);
|
||||
}
|
||||
|
@ -48,5 +48,15 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_VECTOR,
|
||||
|
||||
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);
|
||||
|
||||
if (*ierr == MPI_SUCCESS) {
|
||||
*newtype = MPI_Type_c2f(c_new);
|
||||
}
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user