Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Datatype: Remove all encode_datatype calls
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 21 Mar 2018 14:53:05 +0000 (15:53 +0100)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 28 Mar 2018 15:33:51 +0000 (17:33 +0200)
We now use simgrid::smpi::Datatype(dt) instead.

sed -i -r -e 's@encode_datatype\((\w+)\)@simgrid::smpi::Datatype::encode(\1)@' src/smpi/**/*.cpp

src/instr/instr_smpi.hpp
src/smpi/bindings/smpi_pmpi_coll.cpp
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/bindings/smpi_pmpi_win.cpp
src/smpi/internals/smpi_replay.cpp

index 69e79bb..8346160 100644 (file)
@@ -32,8 +32,6 @@ XBT_PRIVATE void TRACE_smpi_recv(int src, int dst, int tag);
 XBT_PRIVATE void TRACE_smpi_init(int rank);
 XBT_PRIVATE void TRACE_smpi_finalize(int rank);
 
-XBT_PRIVATE const char* encode_datatype(MPI_Datatype datatype);
-
 class smpi_trace_call_location_t {
 public:
   std::string filename;
index 745d9d9..69421bd 100644 (file)
@@ -29,7 +29,7 @@ int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm c
     TRACE_smpi_comm_in(rank, __FUNCTION__,
                        new simgrid::instr::CollTIData("bcast", root, -1.0,
                                                       datatype->is_replayable() ? count : count * datatype->size(), -1,
-                                                      encode_datatype(datatype), ""));
+                                                      simgrid::smpi::Datatype::encode(datatype), ""));
     if (comm->size() > 1)
       simgrid::smpi::Colls::bcast(buf, count, datatype, root, comm);
     retval = MPI_SUCCESS;
@@ -91,12 +91,12 @@ int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbu
     }
     int rank = simgrid::s4u::Actor::self()->getPid();
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
-                       new simgrid::instr::CollTIData(
-                           "gather", root, -1.0,
-                           sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
-                           (comm->rank() != root || recvtype->is_replayable()) ? recvcount : recvcount * recvtype->size(),
-                           encode_datatype(sendtmptype), encode_datatype(recvtype)));
+    TRACE_smpi_comm_in(
+        rank, __FUNCTION__,
+        new simgrid::instr::CollTIData(
+            "gather", root, -1.0, sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
+            (comm->rank() != root || recvtype->is_replayable()) ? recvcount : recvcount * recvtype->size(),
+            simgrid::smpi::Datatype::encode(sendtmptype), simgrid::smpi::Datatype::encode(recvtype)));
 
     simgrid::smpi::Colls::gather(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, root, comm);
 
@@ -146,7 +146,8 @@ int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recv
                        new simgrid::instr::VarCollTIData(
                            "gatherV", root,
                            sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(), nullptr,
-                           dt_size_recv, trace_recvcounts, encode_datatype(sendtmptype), encode_datatype(recvtype)));
+                           dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtmptype),
+                           simgrid::smpi::Datatype::encode(recvtype)));
 
     retval = simgrid::smpi::Colls::gatherv(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcounts, displs, recvtype, root, comm);
     TRACE_smpi_comm_out(rank);
@@ -180,10 +181,10 @@ int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
     int rank = simgrid::s4u::Actor::self()->getPid();
 
     TRACE_smpi_comm_in(rank, __FUNCTION__,
-                       new simgrid::instr::CollTIData("allGather", -1, -1.0,
-                                                      sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
-                                                      recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
-                                                      encode_datatype(sendtype), encode_datatype(recvtype)));
+                       new simgrid::instr::CollTIData(
+                           "allGather", -1, -1.0, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
+                           recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
+                           simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
 
     simgrid::smpi::Colls::allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
     TRACE_smpi_comm_out(rank);
@@ -223,8 +224,9 @@ int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
     TRACE_smpi_comm_in(rank, __FUNCTION__,
                        new simgrid::instr::VarCollTIData(
-                           "allGatherV", -1, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(), nullptr,
-                           dt_size_recv, trace_recvcounts, encode_datatype(sendtype), encode_datatype(recvtype)));
+                           "allGatherV", -1, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
+                           nullptr, dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
+                           simgrid::smpi::Datatype::encode(recvtype)));
 
     simgrid::smpi::Colls::allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
     retval = MPI_SUCCESS;
@@ -258,12 +260,13 @@ int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
     }
     int rank = simgrid::s4u::Actor::self()->getPid();
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
-                       new simgrid::instr::CollTIData(
-                           "scatter", root, -1.0,
-                           (comm->rank() != root || sendtype->is_replayable()) ? sendcount : sendcount * sendtype->size(),
-                           recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(), encode_datatype(sendtype),
-                           encode_datatype(recvtype)));
+    TRACE_smpi_comm_in(
+        rank, __FUNCTION__,
+        new simgrid::instr::CollTIData(
+            "scatter", root, -1.0,
+            (comm->rank() != root || sendtype->is_replayable()) ? sendcount : sendcount * sendtype->size(),
+            recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
+            simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
 
     simgrid::smpi::Colls::scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
     retval = MPI_SUCCESS;
@@ -302,10 +305,11 @@ int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
         trace_sendcounts->push_back(sendcounts[i] * dt_size_send);
     }
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::VarCollTIData(
-                                               "scatterV", root, dt_size_send, trace_sendcounts,
-                                               recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(), nullptr,
-                                               encode_datatype(sendtype), encode_datatype(recvtype)));
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::VarCollTIData(
+                           "scatterV", root, dt_size_send, trace_sendcounts,
+                           recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(), nullptr,
+                           simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
 
     retval = simgrid::smpi::Colls::scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm);
 
@@ -332,7 +336,7 @@ int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
     TRACE_smpi_comm_in(rank, __FUNCTION__,
                        new simgrid::instr::CollTIData("reduce", root, 0,
                                                       datatype->is_replayable() ? count : count * datatype->size(), -1,
-                                                      encode_datatype(datatype), ""));
+                                                      simgrid::smpi::Datatype::encode(datatype), ""));
 
     simgrid::smpi::Colls::reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
 
@@ -382,7 +386,7 @@ int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
     TRACE_smpi_comm_in(rank, __FUNCTION__,
                        new simgrid::instr::CollTIData("allReduce", -1, 0,
                                                       datatype->is_replayable() ? count : count * datatype->size(), -1,
-                                                      encode_datatype(datatype), ""));
+                                                      simgrid::smpi::Datatype::encode(datatype), ""));
 
     simgrid::smpi::Colls::allreduce(sendtmpbuf, recvbuf, count, datatype, op, comm);
 
@@ -414,7 +418,7 @@ int PMPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MP
 
     TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData(
                                                "scan", -1, datatype->is_replayable() ? count : count * datatype->size(),
-                                               encode_datatype(datatype)));
+                                               simgrid::smpi::Datatype::encode(datatype)));
 
     retval = simgrid::smpi::Colls::scan(sendbuf, recvbuf, count, datatype, op, comm);
 
@@ -444,9 +448,10 @@ int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
       memcpy(sendtmpbuf, recvbuf, count * datatype->size());
     }
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData(
-                                               "exscan", -1, datatype->is_replayable() ? count : count * datatype->size(),
-                                               encode_datatype(datatype)));
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::Pt2PtTIData("exscan", -1,
+                                                       datatype->is_replayable() ? count : count * datatype->size(),
+                                                       simgrid::smpi::Datatype::encode(datatype)));
 
     retval = simgrid::smpi::Colls::exscan(sendtmpbuf, recvbuf, count, datatype, op, comm);
 
@@ -489,9 +494,9 @@ int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datat
       memcpy(sendtmpbuf, recvbuf, totalcount * datatype->size());
     }
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
-                       new simgrid::instr::VarCollTIData("reduceScatter", -1, dt_send_size, nullptr, -1,
-                                                         trace_recvcounts, encode_datatype(datatype), ""));
+    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::VarCollTIData(
+                                               "reduceScatter", -1, dt_send_size, nullptr, -1, trace_recvcounts,
+                                               simgrid::smpi::Datatype::encode(datatype), ""));
 
     simgrid::smpi::Colls::reduce_scatter(sendtmpbuf, recvbuf, recvcounts, datatype, op, comm);
     retval = MPI_SUCCESS;
@@ -534,7 +539,7 @@ int PMPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount,
 
     TRACE_smpi_comm_in(rank, __FUNCTION__,
                        new simgrid::instr::VarCollTIData("reduceScatter", -1, 0, nullptr, -1, trace_recvcounts,
-                                                         encode_datatype(datatype), ""));
+                                                         simgrid::smpi::Datatype::encode(datatype), ""));
 
     int* recvcounts = new int[count];
     for (int i      = 0; i < count; i++)
@@ -575,12 +580,12 @@ int PMPI_Alltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* rec
       sendtmptype  = recvtype;
     }
 
-    TRACE_smpi_comm_in(
-        rank, __FUNCTION__,
-        new simgrid::instr::CollTIData("allToAll", -1, -1.0,
-                                       sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
-                                       recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
-                                       encode_datatype(sendtmptype), encode_datatype(recvtype)));
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::CollTIData(
+                           "allToAll", -1, -1.0,
+                           sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
+                           recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
+                           simgrid::smpi::Datatype::encode(sendtmptype), simgrid::smpi::Datatype::encode(recvtype)));
 
     retval = simgrid::smpi::Colls::alltoall(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, comm);
 
@@ -646,9 +651,10 @@ int PMPI_Alltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype
       trace_sendcounts->push_back(sendtmpcounts[i] * dt_size_send);
     }
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::VarCollTIData(
-                                               "allToAllV", -1, send_size, trace_sendcounts, recv_size,
-                                               trace_recvcounts, encode_datatype(sendtype), encode_datatype(recvtype)));
+    TRACE_smpi_comm_in(rank, __FUNCTION__,
+                       new simgrid::instr::VarCollTIData("allToAllV", -1, send_size, trace_sendcounts, recv_size,
+                                                         trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
+                                                         simgrid::smpi::Datatype::encode(recvtype)));
 
     retval = simgrid::smpi::Colls::alltoallv(sendtmpbuf, sendtmpcounts, sendtmpdisps, sendtmptype, recvbuf, recvcounts,
                                     recvdisps, recvtype, comm);
index 9f0d334..e258432 100644 (file)
@@ -168,7 +168,7 @@ int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MP
     TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
                        new simgrid::instr::Pt2PtTIData("Irecv", src,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
-                                                       encode_datatype(datatype)));
+                                                       simgrid::smpi::Datatype::encode(datatype)));
 
     *request = simgrid::smpi::Request::irecv(buf, count, datatype, src, tag, comm);
     retval = MPI_SUCCESS;
@@ -209,7 +209,7 @@ int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MP
     TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
                        new simgrid::instr::Pt2PtTIData("Isend", dst,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
-                                                       encode_datatype(datatype)));
+                                                       simgrid::smpi::Datatype::encode(datatype)));
 
     TRACE_smpi_send(my_proc_id, my_proc_id, trace_dst, tag, count * datatype->size());
 
@@ -251,7 +251,7 @@ int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, M
     TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
                        new simgrid::instr::Pt2PtTIData("ISsend", dst,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
-                                                       encode_datatype(datatype)));
+                                                       simgrid::smpi::Datatype::encode(datatype)));
     TRACE_smpi_send(my_proc_id, my_proc_id, trace_dst, tag, count * datatype->size());
 
     *request = simgrid::smpi::Request::issend(buf, count, datatype, dst, tag, comm);
@@ -290,7 +290,7 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI
     TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
                        new simgrid::instr::Pt2PtTIData("recv", src,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
-                                                       encode_datatype(datatype)));
+                                                       simgrid::smpi::Datatype::encode(datatype)));
 
     simgrid::smpi::Request::recv(buf, count, datatype, src, tag, comm, status);
     retval = MPI_SUCCESS;
@@ -333,7 +333,7 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI
     TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
                        new simgrid::instr::Pt2PtTIData("send", dst,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
-                                                       encode_datatype(datatype)));
+                                                       simgrid::smpi::Datatype::encode(datatype)));
     if (not TRACE_smpi_view_internals()) {
       TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, tag, count * datatype->size());
     }
@@ -371,7 +371,7 @@ int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MP
     TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
                        new simgrid::instr::Pt2PtTIData("Ssend", dst,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
-                                                       encode_datatype(datatype)));
+                                                       simgrid::smpi::Datatype::encode(datatype)));
     TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, tag, count * datatype->size());
 
     simgrid::smpi::Request::ssend(buf, count, datatype, dst, tag, comm);
@@ -428,7 +428,7 @@ int PMPI_Sendrecv(void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst,
                        new simgrid::instr::VarCollTIData(
                            "sendRecv", -1, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
                            dst_hack, recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(), src_hack,
-                           encode_datatype(sendtype), encode_datatype(recvtype)));
+                           simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
 
     TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, sendtag, sendcount * sendtype->size());
 
index 2176dd4..903371e 100644 (file)
@@ -201,7 +201,7 @@ int PMPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
                        new simgrid::instr::Pt2PtTIData("Get", target_rank, origin_datatype->is_replayable()
                                                                                ? origin_count
                                                                                : origin_count * origin_datatype->size(),
-                                                       encode_datatype(origin_datatype)));
+                                                       simgrid::smpi::Datatype::encode(origin_datatype)));
 
     retval = win->get( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
                            target_datatype);
@@ -242,7 +242,7 @@ int PMPI_Rget( void *origin_addr, int origin_count, MPI_Datatype origin_datatype
                        new simgrid::instr::Pt2PtTIData(
                            "Rget", target_rank,
                            origin_datatype->is_replayable() ? origin_count : origin_count * origin_datatype->size(),
-                           encode_datatype(origin_datatype)));
+                           simgrid::smpi::Datatype::encode(origin_datatype)));
 
     retval = win->get( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
                            target_datatype, request);
@@ -281,7 +281,7 @@ int PMPI_Put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
                        new simgrid::instr::Pt2PtTIData("Put", target_rank, origin_datatype->is_replayable()
                                                                                ? origin_count
                                                                                : origin_count * origin_datatype->size(),
-                                                       encode_datatype(origin_datatype)));
+                                                       simgrid::smpi::Datatype::encode(origin_datatype)));
     TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, SMPI_RMA_TAG, origin_count * origin_datatype->size());
 
     retval = win->put( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
@@ -324,7 +324,7 @@ int PMPI_Rput( void *origin_addr, int origin_count, MPI_Datatype origin_datatype
                        new simgrid::instr::Pt2PtTIData(
                            "Rput", target_rank,
                            origin_datatype->is_replayable() ? origin_count : origin_count * origin_datatype->size(),
-                           encode_datatype(origin_datatype)));
+                           simgrid::smpi::Datatype::encode(origin_datatype)));
     TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, SMPI_RMA_TAG, origin_count * origin_datatype->size());
 
     retval = win->put( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
@@ -365,7 +365,7 @@ int PMPI_Accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_da
                        new simgrid::instr::Pt2PtTIData(
                            "Accumulate", target_rank,
                            origin_datatype->is_replayable() ? origin_count : origin_count * origin_datatype->size(),
-                           encode_datatype(origin_datatype)));
+                           simgrid::smpi::Datatype::encode(origin_datatype)));
     retval = win->accumulate( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
                                   target_datatype, op);
 
@@ -407,7 +407,7 @@ int PMPI_Raccumulate( void *origin_addr, int origin_count, MPI_Datatype origin_d
                        new simgrid::instr::Pt2PtTIData(
                            "Raccumulate", target_rank,
                            origin_datatype->is_replayable() ? origin_count : origin_count * origin_datatype->size(),
-                           encode_datatype(origin_datatype)));
+                           simgrid::smpi::Datatype::encode(origin_datatype)));
 
     retval = win->accumulate( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count,
                                   target_datatype, op, request);
@@ -449,7 +449,7 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win){
                        new simgrid::instr::Pt2PtTIData(
                            "Get_accumulate", target_rank,
                            target_datatype->is_replayable() ? target_count : target_count * target_datatype->size(),
-                           encode_datatype(target_datatype)));
+                           simgrid::smpi::Datatype::encode(target_datatype)));
 
     retval = win->get_accumulate( origin_addr, origin_count, origin_datatype, result_addr,
                                   result_count, result_datatype, target_rank, target_disp,
@@ -496,7 +496,7 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request* request){
                        new simgrid::instr::Pt2PtTIData(
                            "Rget_accumulate", target_rank,
                            target_datatype->is_replayable() ? target_count : target_count * target_datatype->size(),
-                           encode_datatype(target_datatype)));
+                           simgrid::smpi::Datatype::encode(target_datatype)));
 
     retval = win->get_accumulate( origin_addr, origin_count, origin_datatype, result_addr,
                                   result_count, result_datatype, target_rank, target_disp,
@@ -537,7 +537,7 @@ int PMPI_Compare_and_swap(void* origin_addr, void* compare_addr, void* result_ad
     TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
                        new simgrid::instr::Pt2PtTIData("Compare_and_swap", target_rank,
                                                        datatype->is_replayable() ? 1 : datatype->size(),
-                                                       encode_datatype(datatype)));
+                                                       simgrid::smpi::Datatype::encode(datatype)));
 
     retval = win->compare_and_swap(origin_addr, compare_addr, result_addr, datatype, target_rank, target_disp);
 
index 3277f93..fbaf4b1 100644 (file)
@@ -68,13 +68,6 @@ static MPI_Datatype decode_datatype(std::string action)
   return simgrid::smpi::Datatype::decode(const_cast<const char* const>(action.c_str()));
 }
 
-const char* encode_datatype(MPI_Datatype datatype)
-{
-  if (datatype == MPI_DATATYPE_NULL)
-    return "-1";
-  return simgrid::smpi::Datatype::encode(datatype);
-}
-
 namespace simgrid {
 namespace smpi {