Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix build without smpi.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 10 Aug 2018 09:46:59 +0000 (11:46 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 10 Aug 2018 09:54:02 +0000 (11:54 +0200)
src/mc/Session.cpp
src/mc/checker/CommunicationDeterminismChecker.cpp
src/mc/remote/RemoteClient.cpp
src/plugins/host_dvfs.cpp

index da8c02b..1d7b32e 100644 (file)
@@ -86,8 +86,12 @@ pid_t do_fork(F code)
 Session::Session(pid_t pid, int socket)
 {
   std::unique_ptr<simgrid::mc::RemoteClient> process(new simgrid::mc::RemoteClient(pid, socket));
+#if HAVE_SMPI
   // TODO, automatic detection of the config from the process
   process->privatized(smpi_privatize_global_variables != SmpiPrivStrategies::NONE);
+#else
+  process->privatized(false);
+#endif
   modelChecker_ = std::unique_ptr<ModelChecker>(
     new simgrid::mc::ModelChecker(std::move(process)));
   xbt_assert(mc_model_checker == nullptr);
index c417b91..016d3bf 100644 (file)
@@ -14,7 +14,9 @@
 #include "src/mc/mc_state.hpp"
 #include "src/mc/remote/Client.hpp"
 
+#if HAVE_SMPI
 #include "smpi_request.hpp"
+#endif
 
 #include <cstdint>
 
@@ -194,14 +196,17 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim
     pattern->src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(synchro->src_proc))->pid_;
     pattern->src_host = MC_smx_actor_get_host_name(issuer);
 
+#if HAVE_SMPI
     simgrid::smpi::Request mpi_request = mc_model_checker->process().read<simgrid::smpi::Request>(
         RemotePtr<simgrid::smpi::Request>((std::uint64_t)simcall_comm_isend__get__data(request)));
     pattern->tag = mpi_request.tag();
+#endif
 
     if (synchro->src_buff != nullptr) {
       pattern->data.resize(synchro->src_buff_size);
       mc_model_checker->process().read_bytes(pattern->data.data(), pattern->data.size(), remote(synchro->src_buff));
     }
+#if HAVE_SMPI
     if(mpi_request.detached()){
       if (not this->initial_communications_pattern_done) {
         /* Store comm pattern */
@@ -216,14 +221,17 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim
       }
       return;
     }
+#endif
   } else if (call_type == MC_CALL_TYPE_RECV) {
     pattern->type = simgrid::mc::PatternCommunicationType::receive;
     pattern->comm_addr = static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_irecv__getraw__result(request));
 
+#if HAVE_SMPI
     simgrid::smpi::Request mpi_request;
     mc_model_checker->process().read(&mpi_request,
                                      remote((simgrid::smpi::Request*)simcall_comm_irecv__get__data(request)));
     pattern->tag = mpi_request.tag();
+#endif
 
     simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
     mc_model_checker->process().read(temp_comm,
index 0d63b68..6024c70 100644 (file)
@@ -455,10 +455,10 @@ std::string RemoteClient::read_string(RemotePtr<char> address) const
 const void* RemoteClient::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, int process_index,
                                      ReadOptions options) const
 {
+#if HAVE_SMPI
   if (process_index != simgrid::mc::ProcessIndexDisabled) {
     std::shared_ptr<simgrid::mc::ObjectInformation> const& info = this->find_object_info_rw(address);
-// Segment overlap is not handled.
-#if HAVE_SMPI
+    // Segment overlap is not handled.
     if (info.get() && this->privatized(*info)) {
       if (process_index < 0)
         xbt_die("Missing process index");
@@ -477,8 +477,8 @@ const void* RemoteClient::read_bytes(void* buffer, std::size_t size, RemotePtr<v
       size_t offset = address.address() - (std::uint64_t)info->start_rw;
       address       = remote((char*)privatization_region.address + offset);
     }
-#endif
   }
+#endif
   if (pread_whole(this->memory_file, buffer, size, (size_t)address.address()) < 0)
     xbt_die("Read at %p from process %lli failed", (void*)address.address(), (long long)this->pid_);
   return buffer;
index dbcc5af..9879f92 100644 (file)
@@ -267,6 +267,7 @@ public:
   explicit Adagio(simgrid::s4u::Host* ptr)
       : Governor(ptr), rates(100, std::vector<double>(ptr->get_pstate_count(), 0.0))
   {
+#if HAVE_SMPI
     simgrid::smpi::plugin::ampi::on_iteration_in.connect([this](simgrid::s4u::ActorPtr actor) {
       // Every instance of this class subscribes to this event, so one per host
       // This means that for any actor, all 'hosts' are normally notified of these
@@ -282,6 +283,7 @@ public:
         task_id           = 0;
       }
     });
+#endif
     simgrid::kernel::activity::ExecImpl::on_creation.connect([this](simgrid::kernel::activity::ExecImplPtr activity) {
       if (activity->host_ == get_host())
         pre_task();