00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef INC_PASO_MPI
00016 #define INC_PASO_MPI
00017
00018 #include "Common.h"
00019 #include "Paso.h"
00020
00021 #ifdef PASO_MPI
00022 #include "mpi_C.h"
00023 #else
00024 typedef int MPI_Comm;
00025 typedef int MPI_Request;
00026 #define MPI_INT 6
00027 #define MPI_DOUBLE 11
00028 #define MPI_COMM_WORLD 91
00029 #endif
00030
00031 typedef int Paso_MPI_rank;
00032
00033 #define PASO_MPI_TODO { fprintf( stdout, "\nTODO : %s:%d\n", __FILE__, __LINE__); MPI_Finalize(); exit(1); }
00034
00035
00036 struct Paso_MPIInfo {
00037 dim_t reference_counter;
00038 int size;
00039 Paso_MPI_rank rank;
00040 MPI_Comm comm;
00041 int msg_tag_counter;
00042 };
00043
00044 typedef struct Paso_MPIInfo Paso_MPIInfo;
00045
00046
00047
00048 PASO_DLL_API
00049 Paso_MPIInfo* Paso_MPIInfo_alloc( MPI_Comm comm );
00050
00051 PASO_DLL_API
00052 void Paso_MPIInfo_free( Paso_MPIInfo* );
00053
00054 PASO_DLL_API
00055 Paso_MPIInfo *Paso_MPIInfo_getReference( Paso_MPIInfo* in );
00056
00057 PASO_DLL_API
00058 int Paso_MPIInfo_initialized( void );
00059
00060 PASO_DLL_API
00061 index_t Paso_MPIInfo_mod(index_t n, index_t k);
00062
00063 PASO_DLL_API
00064 dim_t Paso_MPIInfo_setDistribution(Paso_MPIInfo* in ,index_t min_id,index_t max_id,index_t* distribution);
00065
00066 PASO_DLL_API
00067 void Paso_MPIInfo_Split( Paso_MPIInfo *mpi_info, dim_t n, dim_t* local_N,index_t* offset);
00068
00069 PASO_DLL_API
00070 bool_t Paso_MPIInfo_noError( Paso_MPIInfo *mpi_info);
00071
00072 PASO_DLL_API
00073 char *Paso_MPI_appendRankToFileName(const char *, int, int);
00074
00075 #endif