- 'clean-atexit' is now 'debug/clean-atexit'
S4U:
+- Define new template functions Mailbox::get_unique(), returning a std::unique_ptr.
- Functions Mailbox::get() and Mailbox::get_async() are now templated with the
type of the pointee. Untyped functions are deprecated. Use Mailbox::get<void>()
or Mailbox::get_async<void>() if you really want to play with void*.
- smpicc/cxx/ff/f90 now will actually perform definition checks at link time. When
building shared libraries, this may cause issues, so environment variable
SMPI_NO_UNDEFINED_CHECK can be added to disable this.
- - most temporary files should now be created in /tmp dir (or equivalent).
+ - most temporary files should now be created in /tmp dir (or equivalent).
If this one does not allow execution of code (noexec flag), this may cause issues.
- Please use another tmp directory (using TMPDIR or equivalent system variable)
+ Please use another tmp directory (using TMPDIR or equivalent system variable)
in this case.
Model-Checker:
static void receiver(std::string mailbox)
{
auto* mbox = simgrid::s4u::Mailbox::by_name(mailbox);
- auto msg = std::unique_ptr<Message>(mbox->get<Message>());
+ auto msg = mbox->get_unique<Message>();
XBT_INFO("[%s] %s received %d bytes from %s",
mailbox.c_str(),
simgrid::s4u::this_actor::get_host()->get_name().c_str(),
simgrid::s4u::this_actor::sleep_for(2);
while (true) { // I am an eternal emigrant
- auto destination = std::unique_ptr<std::string>(mailbox->get<std::string>());
+ auto destination = mailbox->get_unique<std::string>();
if (destination->empty())
break; // there is no destination, die
simgrid::s4u::this_actor::set_host(simgrid::s4u::Host::by_name(*destination));
#include <smpi/forward.hpp>
#include <xbt/string.hpp>
+#include <memory>
#include <string>
namespace simgrid {
/** Blocking data reception */
template <typename T> T* get() { return static_cast<T*>(get<void>()); }
XBT_ATTRIB_DEPRECATED_v331("Please use typed template Mailbox::get<>()") void* get();
+ template <typename T> std::unique_ptr<T> get_unique() { return std::unique_ptr<T>(get<T>()); }
+
/** Blocking data reception with timeout */
template <typename T> T* get(double timeout) { return static_cast<T*>(get<void>(timeout)); }
XBT_ATTRIB_DEPRECATED_v331("Please use typed template Mailbox::get<>()") void* get(double timeout);
+ template <typename T> std::unique_ptr<T> get_unique(double timeout) { return std::unique_ptr<T>(get<T>(timeout)); }
};
template <> CommPtr Mailbox::get_async<void>(void** data);