00001 #ifndef FUPERMOD_KERNEL_H_ 00002 #define FUPERMOD_KERNEL_H_ 00003 00004 #include <pthread.h> 00005 #include "fupermod_conf.h" 00006 00007 #ifdef __cplusplus 00008 extern "C" { 00009 #endif 00010 00021 #define FUPERMOD_SUCCESS 0 00022 00024 #define FUPERMOD_FAIL -1 00025 00027 #define FUPERMOD_ALLOC_FAIL -2 00028 00034 typedef double (*fupermod_complexity)(long long int d, void* params); 00035 00037 typedef struct fupermod_kernel { 00045 int (*load)(MPI_Comm comm, fupermod_process_conf* conf); 00046 00052 int (*unload)(MPI_Comm comm); 00053 00055 fupermod_complexity complexity; 00056 00063 int (*initialize)(long long int d, void** params); 00064 00077 int (*execute)(pthread_mutex_t* mutex, void* params); 00078 00084 int (*finalize)(void* params); 00085 } fupermod_kernel; 00086 00088 #define FUPERMOD_KERNEL_INSTANCE "fupermod_kernel_instance" 00089 00091 typedef struct fupermod_library { 00093 char* path; 00094 00099 fupermod_process_conf* conf; 00100 00102 void* handle; 00103 00105 fupermod_kernel* kernel; 00106 } fupermod_library; 00107 00116 int fupermod_library_load(MPI_Comm comm, char* path, fupermod_process_conf* conf, fupermod_library* library); 00117 00124 int fupermod_library_unload(MPI_Comm comm, fupermod_library* library); 00125 00129 #ifdef __cplusplus 00130 } 00131 #endif 00132 00133 #endif /* FUPERMOD_KERNEL_H_ */