Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix the put/get(_async) mailbox methods in the Python bindings
authorTom Cornebize <tom.cornebize@intel.com>
Thu, 16 Jun 2022 19:10:47 +0000 (21:10 +0200)
committerTom Cornebize <tom.cornebize@intel.com>
Fri, 17 Jun 2022 07:21:15 +0000 (09:21 +0200)
The message sizes had to fit in an int, which is too small for
some reasonable cases (e.g. sending 10 GB).

src/bindings/python/simgrid_python.cpp

index db71ba4..9d86a99 100644 (file)
@@ -659,28 +659,28 @@ PYBIND11_MODULE(simgrid, m)
                              "Check if there is a communication ready to be consumed from a mailbox.")
       .def(
           "put",
-          [](Mailbox* self, py::object data, int size, double timeout) {
+          [](Mailbox* self, py::object data, uint64_t size, double timeout) {
             data.inc_ref();
             self->put(data.ptr(), size, timeout);
           },
           py::call_guard<py::gil_scoped_release>(), "Blocking data transmission with a timeout")
       .def(
           "put",
-          [](Mailbox* self, py::object data, int size) {
+          [](Mailbox* self, py::object data, uint64_t size) {
             data.inc_ref();
             self->put(data.ptr(), size);
           },
           py::call_guard<py::gil_scoped_release>(), "Blocking data transmission")
       .def(
           "put_async",
-          [](Mailbox* self, py::object data, int size) {
+          [](Mailbox* self, py::object data, uint64_t size) {
             data.inc_ref();
             return self->put_async(data.ptr(), size);
           },
           py::call_guard<py::gil_scoped_release>(), "Non-blocking data transmission")
       .def(
           "put_init",
-          [](Mailbox* self, py::object data, int size) {
+          [](Mailbox* self, py::object data, uint64_t size) {
             data.inc_ref();
             return self->put_init(data.ptr(), size);
           },