1
1

adding fortran interface for the MPI-1 communicator functions.

This commit was SVN r1837.
Этот коммит содержится в:
Edgar Gabriel 2004-08-02 14:35:33 +00:00
родитель 91a1458120
Коммит ae3028efe7
11 изменённых файлов: 59 добавлений и 14 удалений

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

@ -48,5 +48,8 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_COMPARE,
void mpi_comm_compare_f(MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr) void mpi_comm_compare_f(MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Comm c_comm1 = MPI_Comm_f2c ( *comm1 );
MPI_Comm c_comm2 = MPI_Comm_f2c ( *comm2 );
*ierr = MPI_Comm_compare ( c_comm1, c_comm2, result );
} }

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

@ -48,5 +48,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_CREATE,
void mpi_comm_create_f(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr) void mpi_comm_create_f(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Comm c_newcomm;
MPI_Comm c_comm = MPI_Comm_f2c (*comm);
MPI_Group c_group = MPI_Group_f2c(*group);
*ierr = MPI_Comm_create (c_comm, c_group, &c_newcomm);
*newcomm = MPI_Comm_c2f (c_newcomm);
} }

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

@ -48,5 +48,9 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_DUP,
void mpi_comm_dup_f(MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr) void mpi_comm_dup_f(MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Comm c_newcomm;
MPI_Comm c_comm = MPI_Comm_f2c( *comm );
*ierr = MPI_Comm_dup ( c_comm, &c_newcomm );
*newcomm = MPI_Comm_c2f (c_newcomm);
} }

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

@ -48,5 +48,8 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_FREE,
void mpi_comm_free_f(MPI_Fint *comm, MPI_Fint *ierr) void mpi_comm_free_f(MPI_Fint *comm, MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Comm c_comm = MPI_Comm_f2c (*comm);
*ierr = MPI_Comm_free ( &c_comm );
*comm = MPI_Comm_c2f (c_comm);
} }

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

@ -48,5 +48,9 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_GROUP,
void mpi_comm_group_f(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *ierr) void mpi_comm_group_f(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Group c_group;
MPI_Comm c_comm = MPI_Comm_f2c( *comm );
*ierr = MPI_Comm_group( c_comm, &c_group);
*group = MPI_Group_c2f (c_group);
} }

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

@ -48,5 +48,9 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_REMOTE_GROUP,
void mpi_comm_remote_group_f(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *ierr) void mpi_comm_remote_group_f(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Group c_group;
MPI_Comm c_comm = MPI_Comm_f2c ( *comm );
*ierr = MPI_Comm_remote_group ( c_comm, &c_group );
*group = MPI_Group_c2f (c_group);
} }

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

@ -48,5 +48,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_REMOTE_SIZE,
void mpi_comm_remote_size_f(MPI_Fint *comm, MPI_Fint *size, MPI_Fint *ierr) void mpi_comm_remote_size_f(MPI_Fint *comm, MPI_Fint *size, MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Comm c_comm = MPI_Comm_f2c ( *comm );
*ierr = MPI_Comm_remote_size ( c_comm, size );
} }

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

@ -46,7 +46,12 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_SPLIT,
#include "mpi/f77/profile/defines.h" #include "mpi/f77/profile/defines.h"
#endif #endif
void mpi_comm_split_f(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint *newcomm, MPI_Fint *ierr) void mpi_comm_split_f(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint *newcomm,
MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Comm c_newcomm;
MPI_Comm c_comm = MPI_Comm_f2c ( *comm );
*ierr = MPI_Comm_split ( c_comm, (int) color, (int) key, &c_newcomm );
*newcomm = MPI_Comm_c2f (c_newcomm);
} }

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

@ -48,5 +48,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_TEST_INTER,
void mpi_comm_test_inter_f(MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *ierr) void mpi_comm_test_inter_f(MPI_Fint *comm, MPI_Fint *flag, MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Comm c_comm = MPI_Comm_f2c ( *comm );
*ierr = MPI_Comm_test_inter ( c_comm, flag );
} }

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

@ -46,7 +46,15 @@ OMPI_GENERATE_F77_BINDINGS (MPI_INTERCOMM_CREATE,
#include "mpi/f77/profile/defines.h" #include "mpi/f77/profile/defines.h"
#endif #endif
void mpi_intercomm_create_f(MPI_Fint *local_comm, MPI_Fint *local_leader, MPI_Fint *bridge_comm, MPI_Fint *remote_leader, MPI_Fint *tag, MPI_Fint *newintercomm, MPI_Fint *ierr) void mpi_intercomm_create_f(MPI_Fint *local_comm, MPI_Fint *local_leader, MPI_Fint *bridge_comm,
MPI_Fint *remote_leader, MPI_Fint *tag, MPI_Fint *newintercomm,
MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Comm c_newcomm;
MPI_Comm c_local_comm = MPI_Comm_f2c (*local_comm );
MPI_Comm c_bridge_comm = MPI_Comm_f2c (*bridge_comm);
*ierr = MPI_Intercomm_create ( c_local_comm, (int) *local_leader, c_bridge_comm,
(int) *remote_leader, (int) *tag, &c_newcomm );
*newintercomm = MPI_Comm_c2f (c_newcomm);
} }

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

@ -46,7 +46,12 @@ OMPI_GENERATE_F77_BINDINGS (MPI_INTERCOMM_MERGE,
#include "mpi/f77/profile/defines.h" #include "mpi/f77/profile/defines.h"
#endif #endif
void mpi_intercomm_merge_f(MPI_Fint *intercomm, MPI_Fint *high, MPI_Fint *newintercomm, MPI_Fint *ierr) void mpi_intercomm_merge_f(MPI_Fint *intercomm, MPI_Fint *high, MPI_Fint *newintracomm,
MPI_Fint *ierr)
{ {
/* This function not yet implemented */ MPI_Comm c_newcomm;
MPI_Comm c_intercomm = MPI_Comm_f2c(*intercomm);
*ierr = MPI_Intercomm_merge (c_intercomm, (int) *high, &c_newcomm );
*newintracomm = MPI_Comm_c2f (c_newcomm);
} }