00001
00002 #ifdef _USE_PVM
00003 #include "pvm3.h"
00004 #define __comm_selected
00005 #endif
00006
00007 #ifdef _USE_MPI
00008 #include "mpi.h"
00009 #define __comm_selected
00010 #define PARALLEL_ANY_SOURCE MPI_ANY_SOURCE
00011 #define PARALLEL_ANY_TAG MPI_ANY_TAG
00012 #endif
00013
00014 #ifdef _USE_PTHREAD
00015 #include <pthread.h>
00016 #endif
00017
00018
00019 #ifdef __comm_selected
00020
00021
00022
00023
00024
00025
00026
00027 int parallel_init(int *argc, char ***argv);
00028
00029 int parallel_close(void);
00030
00031 int parallel_master_task(void);
00032 int parallel_slave_task(void);
00033
00034 int parallel_group_size(void);
00035
00036 int parallel_send_text(char *str, int dest, int tag);
00037 int parallel_recv_text(char **str, int src, int tag);
00038
00039 int parallel_send_data(void *data, int data_size,int dest, int tag);
00040 int parallel_recv_data(void **data,int *data_size, int src, int tag);
00041
00042 int parallel_send_int(int num, int dest, int tag);
00043 int parallel_recv_int(int *num, int src, int tag);
00044
00045 int parallel_probe( int *src_val, int *tag_val);
00046
00047
00048 typedef int (*request_function)(int, void *, void **);
00049 typedef void (*result_function)(int, void *, void *, int);
00050 typedef int (*work_function)(int, void *, void*, int, void**);
00051
00052 void parallel_master_work(int work_count,
00053 request_function req_func,
00054 result_function res_func,
00055 void *data);
00056
00057 void parallel_slave_work(work_function work_func, void *data);
00058
00059 #endif