Changes between Version 7 and Version 8 of C++ API

Show
Ignore:
Timestamp:
09/10/12 18:53:58 (12 years ago)
Author:
jorisborgdorff
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • C++ API

    v7 v8  
    1010void MUSCLE_Finalize(void); 
    1111 
    12 const char* MUSCLE_Get_Kernel_Name(void); 
     12const char* MUSCLE_Kernel_Name(void); 
    1313const char* MUSCLE_Get_Property(const char* name); 
    1414int MUSCLE_Will_Stop(void); 
     
    2727} 
    2828}}} 
    29 After this, any code can be written. The MUSCLE_Get_Kernel_Name function gives the current kernel name. This must be freed after use. Similarly, MUSCLE_Get_Property gives a property as a string, which must be freed afterwards. 
     29After this, any code can be written. The {{{MUSCLE_Kernel_Name}}} function gives the current kernel name. This must be freed after use. Similarly, MUSCLE_Get_Property gives a property as a string, which must be freed afterwards. 
    3030 
    3131The send and receive functions can transport several datatypes, which are enumerated in {{{muscle2/muscle_types.h}}}. For reference, it takes the following datatypes 
     
    9696 
    9797std::string muscle::env::get_tmp_path(void); 
     98 
     99std::string muscle::cxa::get_property(std::string name); 
     100std::string muscle::cxa::get_properties(void); 
     101std::string muscle::cxa::kernel_name(void); 
     102 
    98103}}} 
    99 {{{init}}}, {{{finalize}}}, {{{will_stop}}}, {{{send}}}, and {{{receive}}} behave exactly as their C counterparts. Since scientific data is often vectors of doubles, there are two new convenience functions to send or receive only double vectors. Vectors are safer than arrays memory-wise and they do range-checking. If other vector methods are of interest to you, send us [[mailto:j.borgdorff@uva.nl|an email]]. Except for vectors, the data that is received must be freed by MUSCLE by calling {{{free_data}}} with the received pointer and the datatype of the received pointer. 
     104{{{init}}}, {{{finalize}}}, {{{will_stop}}}, {{{send}}}, {{{receive}}}, {{{get_property}}}, and {{{kernel_name}}} behave exactly as their C counterparts. Since scientific data is often vectors of doubles, there are two new convenience functions to send or receive only double vectors. Vectors are safer than arrays memory-wise and they do range-checking. If other vector methods are of interest to you, send us [[mailto:j.borgdorff@uva.nl|an email]]. Except for vectors, the data that is received must be freed by MUSCLE by calling {{{free_data}}} with the received pointer and the datatype of the received pointer. 
    100105 
    101106=== Complex data === 
     
    153158muscle::env::send("matrixOut", &cdata, cdata.length(), MUSCLE_COMPLEX); 
    154159}}} 
     160 
     161=== Logger === 
     162 
     163MUSCLE provides logging facilities for C++. The functions are all static. 
     164{{{ 
     165void muscle::logger::severe(std::string message, ...); 
     166void muscle::logger::warning(std::string message, ...); 
     167void muscle::logger::info(std::string message, ...); 
     168void muscle::logger::config(std::string message, ...); 
     169void muscle::logger::fine(std::string message, ...); 
     170void muscle::logger::finer(std::string message, ...); 
     171void muscle::logger::finest(std::string message, ...); 
     172}}} 
     173Each takes a message, and optionally more arguments provided in printf syntax. For instance: 
     174{{{ 
     175muscle::logger::info("the temporary path is %s", muscle::env::get_tmp_path().c_str()); 
     176}}} 
     177This will print the message to stdout and prepend the current kernel name and the log level. A planned feature is to write this output to a fixed file.