Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Enable setting a specific data copy callback to any comm
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Fri, 23 Jul 2021 09:25:09 +0000 (11:25 +0200)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Fri, 23 Jul 2021 09:41:34 +0000 (11:41 +0200)
commit7369715466314d1ab38ee29586b632717c98fcad
tree59f10be67eef70cafb1d5628248cb8ea3242d09b
parent94cee0547a96ae874c04f2435c9e326c5a3f474e
Enable setting a specific data copy callback to any comm

This is becoming mandatory if one has the silly idea to mix SMPI
communications and S4U communications within the same simulation
launched with smpirun.

smpirun sets its own callback for ALL comms in smpi_main and thus
consider that averything is a SMPI communication. If you need to
trick SMPI to have S4U comms on the side, you thus have to
override this callback:

Sender side:
  mbox->put_init(payload, size)
      ->set_copy_data_callback(SIMIX_comm_copy_pointer_callback)
      ->detach(); // or start/vetoable_start/wait

Receiver side:
 mbox->get_init()
     ->set_dst_data(reinterpret_cast<void**>(data), sizeof(void*))
     ->set_copy_data_callback(SIMIX_comm_copy_pointer_callback)
     ->wait(); // or start/vetoable_start
include/simgrid/s4u/Comm.hpp
src/s4u/s4u_Comm.cpp