Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 13 Mar 2021 22:17:28 +0000 (23:17 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 13 Mar 2021 22:17:28 +0000 (23:17 +0100)
1  2 
src/simix/popping_accessors.hpp
src/simix/popping_bodies.cpp
src/simix/popping_enum.hpp
src/simix/popping_generated.cpp
src/simix/simcalls.in

@@@ -684,31 -622,68 +684,6 @@@ static inline void simcall_comm_wait__s
    simgrid::simix::marshal<double>(simcall->args_[1], arg);
  }
  
- static inline smx_cond_t simcall_cond_wait__get__cond(smx_simcall_t simcall)
 -static inline simgrid::kernel::activity::CommImpl* simcall_comm_test__get__comm(smx_simcall_t simcall)
--{
-   return simgrid::simix::unmarshal<smx_cond_t>(simcall->args_[0]);
 -  return simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl*>(simcall->args_[0]);
--}
- static inline smx_cond_t simcall_cond_wait__getraw__cond(smx_simcall_t simcall)
 -static inline simgrid::kernel::activity::CommImpl* simcall_comm_test__getraw__comm(smx_simcall_t simcall)
--{
-   return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args_[0]);
 -  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::CommImpl*>(simcall->args_[0]);
--}
- static inline void simcall_cond_wait__set__cond(smx_simcall_t simcall, smx_cond_t arg)
 -static inline void simcall_comm_test__set__comm(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* arg)
--{
-   simgrid::simix::marshal<smx_cond_t>(simcall->args_[0], arg);
 -  simgrid::simix::marshal<simgrid::kernel::activity::CommImpl*>(simcall->args_[0], arg);
--}
- static inline smx_mutex_t simcall_cond_wait__get__mutex(smx_simcall_t simcall)
 -static inline bool simcall_comm_test__get__result(smx_simcall_t simcall)
--{
-   return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args_[1]);
 -  return simgrid::simix::unmarshal<bool>(simcall->result_);
--}
- static inline smx_mutex_t simcall_cond_wait__getraw__mutex(smx_simcall_t simcall)
 -static inline bool simcall_comm_test__getraw__result(smx_simcall_t simcall)
--{
-   return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args_[1]);
 -  return simgrid::simix::unmarshal_raw<bool>(simcall->result_);
--}
- static inline void simcall_cond_wait__set__mutex(smx_simcall_t simcall, smx_mutex_t arg)
 -static inline void simcall_comm_test__set__result(smx_simcall_t simcall, bool result)
--{
-   simgrid::simix::marshal<smx_mutex_t>(simcall->args_[1], arg);
 -  simgrid::simix::marshal<bool>(simcall->result_, result);
 -}
 -
 -static inline simgrid::kernel::activity::CommImpl** simcall_comm_testany__get__comms(smx_simcall_t simcall)
 -{
 -  return simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall->args_[0]);
 -}
 -static inline simgrid::kernel::activity::CommImpl** simcall_comm_testany__getraw__comms(smx_simcall_t simcall)
 -{
 -  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::CommImpl**>(simcall->args_[0]);
 -}
 -static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl** arg)
 -{
 -  simgrid::simix::marshal<simgrid::kernel::activity::CommImpl**>(simcall->args_[0], arg);
 -}
 -static inline size_t simcall_comm_testany__get__count(smx_simcall_t simcall)
 -{
 -  return simgrid::simix::unmarshal<size_t>(simcall->args_[1]);
 -}
 -static inline size_t simcall_comm_testany__getraw__count(smx_simcall_t simcall)
 -{
 -  return simgrid::simix::unmarshal_raw<size_t>(simcall->args_[1]);
 -}
 -static inline void simcall_comm_testany__set__count(smx_simcall_t simcall, size_t arg)
 -{
 -  simgrid::simix::marshal<size_t>(simcall->args_[1], arg);
 -}
 -static inline int simcall_comm_testany__get__result(smx_simcall_t simcall)
 -{
 -  return simgrid::simix::unmarshal<int>(simcall->result_);
 -}
 -static inline int simcall_comm_testany__getraw__result(smx_simcall_t simcall)
 -{
 -  return simgrid::simix::unmarshal_raw<int>(simcall->result_);
 -}
 -static inline void simcall_comm_testany__set__result(smx_simcall_t simcall, int result)
 -{
 -  simgrid::simix::marshal<int>(simcall->result_, result);
--}
--
  static inline smx_cond_t simcall_cond_wait_timeout__get__cond(smx_simcall_t simcall)
  {
    return simgrid::simix::unmarshal<smx_cond_t>(simcall->args_[0]);
@@@ -837,15 -799,13 +799,13 @@@ static inline void simcall_run_blocking
  /* The prototype of all simcall handlers, automatically generated for you */
  
  XBT_PRIVATE void simcall_HANDLER_execution_waitany_for(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl** execs, size_t count, double timeout);
 -XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout);
 -XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, bool detached);
  XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate);
  XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
 -XBT_PRIVATE void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout);
 -XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm, double timeout);
 +XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout);
 +XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, bool detached);
  XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm);
  XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl** comms, size_t count);
- XBT_PRIVATE void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex);
 +XBT_PRIVATE void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout);
 +XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm, double timeout);
  XBT_PRIVATE void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex, double timeout);
- XBT_PRIVATE void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem);
  XBT_PRIVATE void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, double timeout);
@@@ -90,27 -104,6 +90,20 @@@ inline static int simcall_BODY_comm_tes
    return simcall<int, simgrid::kernel::activity::CommImpl**, size_t>(Simcall::COMM_TESTANY, comms, count);
  }
  
- inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex)
- {
-   if (false) /* Go to that function to follow the code flow through the simcall barrier */
-     simcall_HANDLER_cond_wait(&SIMIX_process_self()->simcall_, cond, mutex);
-   return simcall<void, smx_cond_t, smx_mutex_t>(Simcall::COND_WAIT, cond, mutex);
- }
 +inline static int simcall_BODY_comm_waitany(simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout)
 +{
 +  if (false) /* Go to that function to follow the code flow through the simcall barrier */
 +    simcall_HANDLER_comm_waitany(&SIMIX_process_self()->simcall_, comms, count, timeout);
 +  return simcall<int, simgrid::kernel::activity::CommImpl**, size_t, double>(Simcall::COMM_WAITANY, comms, count, timeout);
 +}
 +
 +inline static void simcall_BODY_comm_wait(simgrid::kernel::activity::CommImpl* comm, double timeout)
 +{
 +  if (false) /* Go to that function to follow the code flow through the simcall barrier */
 +    simcall_HANDLER_comm_wait(&SIMIX_process_self()->simcall_, comm, timeout);
 +  return simcall<void, simgrid::kernel::activity::CommImpl*, double>(Simcall::COMM_WAIT, comm, timeout);
 +}
 +
  inline static int simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout)
  {
    if (false) /* Go to that function to follow the code flow through the simcall barrier */
@@@ -22,17 -22,15 +22,15 @@@ namespace simix 
  enum class Simcall {
    NONE,
    EXECUTION_WAITANY_FOR,
 -  COMM_SEND,
 -  COMM_ISEND,
    COMM_RECV,
    COMM_IRECV,
 -  COMM_WAITANY,
 -  COMM_WAIT,
 +  COMM_SEND,
 +  COMM_ISEND,
    COMM_TEST,
    COMM_TESTANY,
-   COND_WAIT,
 +  COMM_WAITANY,
 +  COMM_WAIT,
    COND_WAIT_TIMEOUT,
-   SEM_ACQUIRE,
    SEM_ACQUIRE_TIMEOUT,
    RUN_KERNEL,
    RUN_BLOCKING,
@@@ -30,17 -30,15 +30,15 @@@ using simgrid::simix::Simcall
  constexpr std::array<const char*, simgrid::simix::NUM_SIMCALLS> simcall_names{{
      "Simcall::NONE",
      "Simcall::EXECUTION_WAITANY_FOR",
 -    "Simcall::COMM_SEND",
 -    "Simcall::COMM_ISEND",
      "Simcall::COMM_RECV",
      "Simcall::COMM_IRECV",
 -    "Simcall::COMM_WAITANY",
 -    "Simcall::COMM_WAIT",
 +    "Simcall::COMM_SEND",
 +    "Simcall::COMM_ISEND",
      "Simcall::COMM_TEST",
      "Simcall::COMM_TESTANY",
-     "Simcall::COND_WAIT",
 +    "Simcall::COMM_WAITANY",
 +    "Simcall::COMM_WAIT",
      "Simcall::COND_WAIT_TIMEOUT",
-     "Simcall::SEM_ACQUIRE",
      "Simcall::SEM_ACQUIRE_TIMEOUT",
      "Simcall::RUN_KERNEL",
      "Simcall::RUN_BLOCKING",
@@@ -90,18 -96,6 +88,14 @@@ void simgrid::kernel::actor::ActorImpl:
        simcall_HANDLER_comm_testany(&simcall_, simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall_.args_[0]), simgrid::simix::unmarshal<size_t>(simcall_.args_[1]));
        break;
  
-     case Simcall::COND_WAIT:
-       simcall_HANDLER_cond_wait(&simcall_, simgrid::simix::unmarshal<smx_cond_t>(simcall_.args_[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall_.args_[1]));
-       break;
 +    case Simcall::COMM_WAITANY:
 +      simcall_HANDLER_comm_waitany(&simcall_, simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall_.args_[0]), simgrid::simix::unmarshal<size_t>(simcall_.args_[1]), simgrid::simix::unmarshal<double>(simcall_.args_[2]));
 +      break;
 +
 +    case Simcall::COMM_WAIT:
 +      simcall_HANDLER_comm_wait(&simcall_, simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl*>(simcall_.args_[0]), simgrid::simix::unmarshal<double>(simcall_.args_[1]));
 +      break;
 +
      case Simcall::COND_WAIT_TIMEOUT:
        simcall_HANDLER_cond_wait_timeout(&simcall_, simgrid::simix::unmarshal<smx_cond_t>(simcall_.args_[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall_.args_[1]), simgrid::simix::unmarshal<double>(simcall_.args_[2]));
        break;
  
  int           execution_waitany_for(simgrid::kernel::activity::ExecImpl** execs, size_t count, double timeout) [[block]];
  
 -void           comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]];
 -boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, bool detached);
  void           comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) [[block]];
  boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
 -int            comm_waitany(simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout) [[block]];
 -void           comm_wait(simgrid::kernel::activity::CommImpl* comm, double timeout) [[block]];
 +void           comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]];
 +boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, bool detached);
  bool           comm_test(simgrid::kernel::activity::CommImpl* comm) [[block]];
  int            comm_testany(simgrid::kernel::activity::CommImpl** comms, size_t count) [[block]];
 +int            comm_waitany(simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout) [[block]];
 +void           comm_wait(simgrid::kernel::activity::CommImpl* comm, double timeout) [[block]];
  
- void       cond_wait(smx_cond_t cond, smx_mutex_t mutex) [[block]];
  int        cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) [[block]];
  
- void      sem_acquire(smx_sem_t sem) [[block]];
  int       sem_acquire_timeout(smx_sem_t sem, double timeout) [[block]];
  
  void       run_kernel(std::function<void()> const* code) [[nohandler]];