Muscle C/C++ API: cppmuscle.hpp Source File

cppmuscle.hpp

Go to the documentation of this file.
00001 #ifndef CPPMUSCLE_HPP
00002 #define CPPMUSCLE_HPP
00003 
00004 //#define CPPMUSCLE_TRACE  
00005
00006 #include <string>
00007 #include <vector>
00008 #include <sys/types.h>
00009
00010 #include "muscle_types.h"
00011 #include "logger.hpp"
00012
00013 namespace muscle {
00014 class env
00015 {
00016 public:
00017
00019         static muscle_error_t init(int* argc, char ***argv);
00021         static void finalize(void);
00022
00024         static bool will_stop(void);
00025
00027         static void send(std::string entrance_name, const void *data, size_t count, muscle_datatype_t type);
00029         static void sendDoubleVector(std::string entrance_name, const std::vector<double>& data);
00030
00036         static void* receive(std::string exit_name, void *data, size_t &count, muscle_datatype_t type);
00037         static std::vector<double> receiveDoubleVector(std::string exit_name);
00038
00039         static void free_data(void *ptr, muscle_datatype_t type);
00040
00041         static std::string get_tmp_path(void);
00042
00043         static bool has_next(std::string exit_name);
00044         static bool is_main_processor;
00045
00046 private:
00047
00048         static int detect_mpi_rank();
00049         static pid_t spawn(char * const *argv);
00050         static pid_t muscle2_spawn(int* argc, char ***argv);
00051         static char * create_tmpfifo();
00052         static void muscle2_tcp_location(pid_t pid, char *host, unsigned short *port);
00053 };
00054
00055 class cxa
00056 {
00057 public:
00058         static std::string kernel_name(void);
00059         static std::string get_property(std::string name);
00060         static std::string get_properties(void);
00061 };
00062
00063 } // EO namespace muscle
00064 #endif

Generated on Thu Oct 18 14:28:28 2012 for Muscle C/C++ API by  doxygen 1.5.6