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. |
| 160 | |
| 161 | === Logger === |
| 162 | |
| 163 | MUSCLE provides logging facilities for C++. The functions are all static. |
| 164 | {{{ |
| 165 | void muscle::logger::severe(std::string message, ...); |
| 166 | void muscle::logger::warning(std::string message, ...); |
| 167 | void muscle::logger::info(std::string message, ...); |
| 168 | void muscle::logger::config(std::string message, ...); |
| 169 | void muscle::logger::fine(std::string message, ...); |
| 170 | void muscle::logger::finer(std::string message, ...); |
| 171 | void muscle::logger::finest(std::string message, ...); |
| 172 | }}} |
| 173 | Each takes a message, and optionally more arguments provided in printf syntax. For instance: |
| 174 | {{{ |
| 175 | muscle::logger::info("the temporary path is %s", muscle::env::get_tmp_path().c_str()); |
| 176 | }}} |
| 177 | This 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. |