Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Yet another dlopen merge
[simgrid.git] / src / smpi / smpi_datatype.cpp
index db186c3..4ce4985 100644 (file)
@@ -1,5 +1,5 @@
 /* smpi_datatype.cpp -- MPI primitives to handle datatypes                      */
-/* Copyright (c) 2009-2015. The SimGrid Team.
+/* Copyright (c) 2009-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -270,7 +270,14 @@ int Datatype::unpack(void* inbuf, int insize, int* position, void* outbuf, int o
 int Datatype::copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                        void *recvbuf, int recvcount, MPI_Datatype recvtype){
   int count;
-  if(smpi_privatize_global_variables){
+
+  if(smpi_is_shared(sendbuf)){
+    XBT_DEBUG("Copy input buf %p is shared. Let's ignore it.", sendbuf);
+  }else if(smpi_is_shared(recvbuf)){
+    XBT_DEBUG("Copy output buf %p is shared. Let's ignore it.", recvbuf);
+  }
+
+  if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){
     smpi_switch_data_segment(smpi_process()->index());
   }
   /* First check if we really have something to do */