Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use standard __func__ instead of __FUNCTION__.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 28 Mar 2018 17:27:00 +0000 (19:27 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 28 Mar 2018 17:27:00 +0000 (19:27 +0200)
16 files changed:
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_events.cpp
src/instr/instr_paje_trace.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_values.cpp
src/smpi/bindings/smpi_mpi.cpp
src/smpi/bindings/smpi_pmpi.cpp
src/smpi/bindings/smpi_pmpi_coll.cpp
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/bindings/smpi_pmpi_win.cpp
src/smpi/internals/instr_smpi.cpp
src/smpi/internals/smpi_replay.cpp
src/xbt/log.c
teshsuite/smpi/mpich3-test/util/mtest_datatype.c
teshsuite/smpi/mpich3-test/util/mtest_datatype_gen.c
teshsuite/smpi/mpich3-test/util/mtest_datatype_gen_manual.c

index 1778a48..2f7a00f 100644 (file)
@@ -148,7 +148,7 @@ void Container::logCreation()
   double timestamp = SIMIX_get_clock();
   std::stringstream stream;
 
-  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, PAJE_CreateContainer, timestamp);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, PAJE_CreateContainer, timestamp);
 
   if (instr_fmt_type == instr_fmt_paje) {
     stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_CreateContainer << " ";
@@ -192,7 +192,7 @@ void Container::logDestruction()
   std::stringstream stream;
   double timestamp = SIMIX_get_clock();
 
-  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, PAJE_DestroyContainer, timestamp);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, PAJE_DestroyContainer, timestamp);
 
   if (instr_fmt_type == instr_fmt_paje) {
     stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DestroyContainer << " ";
index 4037df7..c44aa81 100644 (file)
@@ -17,7 +17,7 @@ namespace instr {
 NewEvent::NewEvent(double timestamp, container_t container, Type* type, EntityValue* val)
     : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_NewEvent), val(val)
 {
-  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, eventType_, timestamp_);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, eventType_, timestamp_);
   insertIntoBuffer();
 }
 
@@ -35,14 +35,14 @@ LinkEvent::LinkEvent(container_t container, Type* type, e_event_type event_type,
     , key_(key)
     , size_(size)
 {
-  XBT_DEBUG("%s: event_type=%u, timestamp=%f, value:%s", __FUNCTION__, eventType_, timestamp_, value_.c_str());
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f, value:%s", __func__, eventType_, timestamp_, value_.c_str());
   insertIntoBuffer();
 }
 
 VariableEvent::VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value)
     : PajeEvent::PajeEvent(container, type, timestamp, event_type), value(value)
 {
-  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, eventType_, timestamp_);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, eventType_, timestamp_);
   insertIntoBuffer();
 }
 
@@ -65,7 +65,7 @@ StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type
   linenumber = -1;
 #endif
 
-  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, eventType_, timestamp_);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, eventType_, timestamp_);
   insertIntoBuffer();
 };
 
@@ -73,7 +73,7 @@ void NewEvent::print()
 {
   std::stringstream stream;
   stream << std::fixed << std::setprecision(TRACE_precision());
-  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
   if (instr_fmt_type != instr_fmt_paje)
     return;
 
@@ -90,7 +90,7 @@ void LinkEvent::print()
 {
   std::stringstream stream;
   stream << std::fixed << std::setprecision(TRACE_precision());
-  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
   if (instr_fmt_type != instr_fmt_paje)
     return;
   if (timestamp_ < 1e-12)
@@ -111,7 +111,7 @@ void VariableEvent::print()
 {
   std::stringstream stream;
   stream << std::fixed << std::setprecision(TRACE_precision());
-  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
   if (instr_fmt_type != instr_fmt_paje)
     return;
 
@@ -128,7 +128,7 @@ void StateEvent::print()
 {
   std::stringstream stream;
   stream << std::fixed << std::setprecision(TRACE_precision());
-  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
   if (instr_fmt_type == instr_fmt_paje) {
     if (timestamp_ < 1e-12)
       stream << eventType_ << " " << 0 << " " << getType()->getId() << " " << getContainer()->getId();
index c736811..a811e79 100644 (file)
@@ -52,7 +52,7 @@ void TRACE_paje_dump_buffer(bool force)
 {
   if (not TRACE_is_enabled())
     return;
-  XBT_DEBUG("%s: dump until %f. starts", __FUNCTION__, TRACE_last_timestamp_to_dump);
+  XBT_DEBUG("%s: dump until %f. starts", __func__, TRACE_last_timestamp_to_dump);
   if (force){
     for (auto const& event : buffer) {
       event->print();
@@ -71,7 +71,7 @@ void TRACE_paje_dump_buffer(bool force)
     }
     buffer.erase(buffer.begin(), i);
   }
-  XBT_DEBUG("%s: ends", __FUNCTION__);
+  XBT_DEBUG("%s: ends", __func__);
 }
 
 void buffer_debug(std::vector<simgrid::instr::PajeEvent*>* buf)
@@ -98,8 +98,7 @@ void simgrid::instr::PajeEvent::insertIntoBuffer()
   }
   buffer_debug(&buffer);
 
-  XBT_DEBUG("%s: insert event_type=%u, timestamp=%f, buffersize=%zu)", __FUNCTION__, eventType_, timestamp_,
-            buffer.size());
+  XBT_DEBUG("%s: insert event_type=%u, timestamp=%f, buffersize=%zu)", __func__, eventType_, timestamp_, buffer.size());
   std::vector<simgrid::instr::PajeEvent*>::reverse_iterator i;
   for (i = buffer.rbegin(); i != buffer.rend(); ++i) {
     simgrid::instr::PajeEvent* e1 = *i;
@@ -108,11 +107,11 @@ void simgrid::instr::PajeEvent::insertIntoBuffer()
       break;
   }
   if (i == buffer.rend())
-    XBT_DEBUG("%s: inserted at beginning", __FUNCTION__);
+    XBT_DEBUG("%s: inserted at beginning", __func__);
   else if (i == buffer.rbegin())
-    XBT_DEBUG("%s: inserted at end", __FUNCTION__);
+    XBT_DEBUG("%s: inserted at end", __func__);
   else
-    XBT_DEBUG("%s: inserted at pos= %zd from its end", __FUNCTION__, std::distance(buffer.rbegin(), i));
+    XBT_DEBUG("%s: inserted at pos= %zd from its end", __func__, std::distance(buffer.rbegin(), i));
   buffer.insert(i.base(), this);
 
   buffer_debug(&buffer);
index 3f87707..c0fa372 100644 (file)
@@ -129,7 +129,7 @@ void Type::logDefinition(e_event_type event_type)
   if (instr_fmt_type != instr_fmt_paje)
     return;
   std::stringstream stream;
-  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, event_type, TRACE_precision(), 0.);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, event_type, TRACE_precision(), 0.);
   stream << std::fixed << std::setprecision(TRACE_precision()) << event_type << " " << getId();
   stream << " " << father_->getId() << " " << getName();
   if (isColored())
@@ -144,7 +144,7 @@ void Type::logDefinition(simgrid::instr::Type* source, simgrid::instr::Type* des
   if (instr_fmt_type != instr_fmt_paje)
     return;
   std::stringstream stream;
-  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, PAJE_DefineLinkType, TRACE_precision(), 0.);
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, PAJE_DefineLinkType, TRACE_precision(), 0.);
   stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineLinkType << " " << getId();
   stream << " " << father_->getId() << " " << source->getId() << " " << dest->getId() << " " << getName();
   XBT_DEBUG("Dump %s", stream.str().c_str());
index d0bdb9d..2a06dc2 100644 (file)
@@ -20,7 +20,7 @@ void EntityValue::print()
   if (instr_fmt_type != instr_fmt_paje)
     return;
   std::stringstream stream;
-  XBT_DEBUG("%s: event_type=%u", __FUNCTION__, PAJE_DefineEntityValue);
+  XBT_DEBUG("%s: event_type=%u", __func__, PAJE_DefineEntityValue);
   stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineEntityValue;
   stream << " " << id_ << " " << father_->getId() << " " << name_;
   if (not color_.empty())
index b388f68..ddf92bd 100644 (file)
@@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi)
 
 #define NOT_YET_IMPLEMENTED                                                                                            \
   {                                                                                                                    \
-    xbt_die("Not yet implemented: %s. Please contact the SimGrid team if support is needed", __FUNCTION__);            \
+    xbt_die("Not yet implemented: %s. Please contact the SimGrid team if support is needed", __func__);                \
     return MPI_SUCCESS;                                                                                                \
   }
 
@@ -21,18 +21,19 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi)
       XBT_WARN("Not yet implemented: %s. "                                                                             \
                "Please contact the SimGrid team if support is needed. "                                                \
                "Run with --log=smpi_mpi.thresh:error to hide",                                                         \
-               __FUNCTION__);                                                                                          \
+               __func__);                                                                                              \
     warning_todo = false;                                                                                              \
     return MPI_SUCCESS;                                                                                                \
   }
 
-#define WRAPPED_PMPI_CALL(type,name,args,args2) \
-type name args { \
-  XBT_VERB("SMPI - Entering %s", __FUNCTION__);\
-  type ret = P##name args2 ; \
-  XBT_VERB("SMPI - Leaving %s", __FUNCTION__);\
-  return ret;\
-}\
+#define WRAPPED_PMPI_CALL(type, name, args, args2)                                                                     \
+  type name args                                                                                                       \
+  {                                                                                                                    \
+    XBT_VERB("SMPI - Entering %s", __func__);                                                                          \
+    type ret = P##name args2;                                                                                          \
+    XBT_VERB("SMPI - Leaving %s", __func__);                                                                           \
+    return ret;                                                                                                        \
+  }
 
 #define UNIMPLEMENTED_WRAPPED_PMPI_CALL(type,name,args,args2) \
 type P##name args { \
index 7954c14..3a85c23 100644 (file)
@@ -38,7 +38,7 @@ int PMPI_Init(int *argc, char ***argv)
     smpi_process()->mark_as_initialized();
     int rank = simgrid::s4u::Actor::self()->getPid();
     TRACE_smpi_init(rank);
-    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("init"));
+    TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData("init"));
     TRACE_smpi_comm_out(rank);
     TRACE_smpi_computing_init(rank);
     smpi_bench_begin();
@@ -53,7 +53,7 @@ int PMPI_Finalize()
 {
   smpi_bench_end();
   int rank = simgrid::s4u::Actor::self()->getPid();
-  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("finalize"));
+  TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData("finalize"));
 
   smpi_process()->finalize();
 
index 69421bd..b97688f 100644 (file)
@@ -26,7 +26,7 @@ int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm c
     retval = MPI_ERR_ARG;
   } else {
     int rank = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
+    TRACE_smpi_comm_in(rank, __func__,
                        new simgrid::instr::CollTIData("bcast", root, -1.0,
                                                       datatype->is_replayable() ? count : count * datatype->size(), -1,
                                                       simgrid::smpi::Datatype::encode(datatype), ""));
@@ -50,7 +50,7 @@ int PMPI_Barrier(MPI_Comm comm)
     retval = MPI_ERR_COMM;
   } else {
     int rank = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("barrier"));
+    TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData("barrier"));
 
     simgrid::smpi::Colls::barrier(comm);
 
@@ -92,7 +92,7 @@ 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__,
+        rank, __func__,
         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(),
@@ -142,7 +142,7 @@ int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recv
         trace_recvcounts->push_back(recvcounts[i] * dt_size_recv);
     }
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
+    TRACE_smpi_comm_in(rank, __func__,
                        new simgrid::instr::VarCollTIData(
                            "gatherV", root,
                            sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(), nullptr,
@@ -180,7 +180,7 @@ int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
     }
     int rank = simgrid::s4u::Actor::self()->getPid();
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
+    TRACE_smpi_comm_in(rank, __func__,
                        new simgrid::instr::CollTIData(
                            "allGather", -1, -1.0, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
                            recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
@@ -222,7 +222,7 @@ int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
     for (int i = 0; i < comm->size(); i++) // copy data to avoid bad free
       trace_recvcounts->push_back(recvcounts[i] * dt_size_recv);
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
+    TRACE_smpi_comm_in(rank, __func__,
                        new simgrid::instr::VarCollTIData(
                            "allGatherV", -1, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
                            nullptr, dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
@@ -261,7 +261,7 @@ int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
     int rank = simgrid::s4u::Actor::self()->getPid();
 
     TRACE_smpi_comm_in(
-        rank, __FUNCTION__,
+        rank, __func__,
         new simgrid::instr::CollTIData(
             "scatter", root, -1.0,
             (comm->rank() != root || sendtype->is_replayable()) ? sendcount : sendcount * sendtype->size(),
@@ -305,7 +305,7 @@ int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
         trace_sendcounts->push_back(sendcounts[i] * dt_size_send);
     }
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
+    TRACE_smpi_comm_in(rank, __func__,
                        new simgrid::instr::VarCollTIData(
                            "scatterV", root, dt_size_send, trace_sendcounts,
                            recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(), nullptr,
@@ -333,7 +333,7 @@ int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
   } else {
     int rank = simgrid::s4u::Actor::self()->getPid();
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
+    TRACE_smpi_comm_in(rank, __func__,
                        new simgrid::instr::CollTIData("reduce", root, 0,
                                                       datatype->is_replayable() ? count : count * datatype->size(), -1,
                                                       simgrid::smpi::Datatype::encode(datatype), ""));
@@ -383,7 +383,7 @@ int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
     }
     int rank = simgrid::s4u::Actor::self()->getPid();
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
+    TRACE_smpi_comm_in(rank, __func__,
                        new simgrid::instr::CollTIData("allReduce", -1, 0,
                                                       datatype->is_replayable() ? count : count * datatype->size(), -1,
                                                       simgrid::smpi::Datatype::encode(datatype), ""));
@@ -416,9 +416,9 @@ int PMPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MP
   } else {
     int rank = simgrid::s4u::Actor::self()->getPid();
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData(
-                                               "scan", -1, datatype->is_replayable() ? count : count * datatype->size(),
-                                               simgrid::smpi::Datatype::encode(datatype)));
+    TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::Pt2PtTIData(
+                                           "scan", -1, datatype->is_replayable() ? count : count * datatype->size(),
+                                           simgrid::smpi::Datatype::encode(datatype)));
 
     retval = simgrid::smpi::Colls::scan(sendbuf, recvbuf, count, datatype, op, comm);
 
@@ -448,10 +448,9 @@ 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(),
-                                                       simgrid::smpi::Datatype::encode(datatype)));
+    TRACE_smpi_comm_in(rank, __func__, 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);
 
@@ -494,9 +493,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,
-                                               simgrid::smpi::Datatype::encode(datatype), ""));
+    TRACE_smpi_comm_in(rank, __func__, 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;
@@ -537,7 +536,7 @@ int PMPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount,
       memcpy(sendtmpbuf, recvbuf, recvcount * count * datatype->size());
     }
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
+    TRACE_smpi_comm_in(rank, __func__,
                        new simgrid::instr::VarCollTIData("reduceScatter", -1, 0, nullptr, -1, trace_recvcounts,
                                                          simgrid::smpi::Datatype::encode(datatype), ""));
 
@@ -580,7 +579,7 @@ int PMPI_Alltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* rec
       sendtmptype  = recvtype;
     }
 
-    TRACE_smpi_comm_in(rank, __FUNCTION__,
+    TRACE_smpi_comm_in(rank, __func__,
                        new simgrid::instr::CollTIData(
                            "allToAll", -1, -1.0,
                            sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
@@ -651,7 +650,7 @@ 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__,
+    TRACE_smpi_comm_in(rank, __func__,
                        new simgrid::instr::VarCollTIData("allToAllV", -1, send_size, trace_sendcounts, recv_size,
                                                          trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
                                                          simgrid::smpi::Datatype::encode(recvtype)));
index e258432..6ec5f7a 100644 (file)
@@ -165,7 +165,7 @@ int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MP
 
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
 
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData("Irecv", src,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
                                                        simgrid::smpi::Datatype::encode(datatype)));
@@ -206,7 +206,7 @@ int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MP
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
     int trace_dst = getPid(comm, dst);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData("Isend", dst,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
                                                        simgrid::smpi::Datatype::encode(datatype)));
@@ -248,7 +248,7 @@ int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, M
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
     int trace_dst = getPid(comm, dst);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData("ISsend", dst,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
                                                        simgrid::smpi::Datatype::encode(datatype)));
@@ -287,7 +287,7 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI
     retval = MPI_ERR_TAG;
   } else {
     int my_proc_id         = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData("recv", src,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
                                                        simgrid::smpi::Datatype::encode(datatype)));
@@ -330,7 +330,7 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI
   } else {
     int my_proc_id         = simgrid::s4u::Actor::self()->getPid();
     int dst_traced         = getPid(comm, dst);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData("send", dst,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
                                                        simgrid::smpi::Datatype::encode(datatype)));
@@ -368,7 +368,7 @@ int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MP
   } else {
     int my_proc_id         = simgrid::s4u::Actor::self()->getPid();
     int dst_traced         = getPid(comm, dst);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData("Ssend", dst,
                                                        datatype->is_replayable() ? count : count * datatype->size(),
                                                        simgrid::smpi::Datatype::encode(datatype)));
@@ -424,7 +424,7 @@ int PMPI_Sendrecv(void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst,
     std::vector<int>* src_hack = new std::vector<int>;
     dst_hack->push_back(dst_traced);
     src_hack->push_back(src_traced);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::VarCollTIData(
                            "sendRecv", -1, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
                            dst_hack, recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(), src_hack,
@@ -594,7 +594,7 @@ int PMPI_Wait(MPI_Request * request, MPI_Status * status)
                          ? simgrid::s4u::Actor::self()->getPid()
                          : -1; // TODO: cheinrich: Check if this correct or if it should be MPI_UNDEFINED
 
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("wait"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("wait"));
 
     simgrid::smpi::Request::wait(request, status);
     retval = MPI_SUCCESS;
@@ -619,7 +619,7 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
   smpi_bench_end();
 
   int rank_traced = simgrid::s4u::Actor::self()->getPid(); // FIXME: In PMPI_Wait, we check if the comm is null?
-  TRACE_smpi_comm_in(rank_traced, __FUNCTION__, new simgrid::instr::CpuTIData("waitAny", static_cast<double>(count)));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitAny", static_cast<double>(count)));
 
   *index = simgrid::smpi::Request::waitany(count, requests, status);
 
@@ -637,7 +637,7 @@ int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
   smpi_bench_end();
 
   int rank_traced = simgrid::s4u::Actor::self()->getPid(); // FIXME: In PMPI_Wait, we check if the comm is null?
-  TRACE_smpi_comm_in(rank_traced, __FUNCTION__, new simgrid::instr::CpuTIData("waitAll", static_cast<double>(count)));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitAll", static_cast<double>(count)));
 
   int retval = simgrid::smpi::Request::waitall(count, requests, status);
 
index 903371e..13f510d 100644 (file)
@@ -166,7 +166,7 @@ int PMPI_Win_fence( int assert,  MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_fence"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_fence"));
     retval = win->fence(assert);
     TRACE_smpi_comm_out(my_proc_id);
   }
@@ -197,7 +197,7 @@ int PMPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
     MPI_Group group;
     win->get_group(&group);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData("Get", target_rank, origin_datatype->is_replayable()
                                                                                ? origin_count
                                                                                : origin_count * origin_datatype->size(),
@@ -238,7 +238,7 @@ int PMPI_Rget( void *origin_addr, int origin_count, MPI_Datatype origin_datatype
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
     MPI_Group group;
     win->get_group(&group);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData(
                            "Rget", target_rank,
                            origin_datatype->is_replayable() ? origin_count : origin_count * origin_datatype->size(),
@@ -277,7 +277,7 @@ int PMPI_Put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
     MPI_Group group;
     win->get_group(&group);
     int dst_traced = group->actor(target_rank)->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData("Put", target_rank, origin_datatype->is_replayable()
                                                                                ? origin_count
                                                                                : origin_count * origin_datatype->size(),
@@ -320,7 +320,7 @@ int PMPI_Rput( void *origin_addr, int origin_count, MPI_Datatype origin_datatype
     MPI_Group group;
     win->get_group(&group);
     int dst_traced = group->actor(target_rank)->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData(
                            "Rput", target_rank,
                            origin_datatype->is_replayable() ? origin_count : origin_count * origin_datatype->size(),
@@ -361,7 +361,7 @@ int PMPI_Accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_da
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
     MPI_Group group;
     win->get_group(&group);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData(
                            "Accumulate", target_rank,
                            origin_datatype->is_replayable() ? origin_count : origin_count * origin_datatype->size(),
@@ -403,7 +403,7 @@ int PMPI_Raccumulate( void *origin_addr, int origin_count, MPI_Datatype origin_d
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
     MPI_Group group;
     win->get_group(&group);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData(
                            "Raccumulate", target_rank,
                            origin_datatype->is_replayable() ? origin_count : origin_count * origin_datatype->size(),
@@ -445,7 +445,7 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win){
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
     MPI_Group group;
     win->get_group(&group);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData(
                            "Get_accumulate", target_rank,
                            target_datatype->is_replayable() ? target_count : target_count * target_datatype->size(),
@@ -492,7 +492,7 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request* request){
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
     MPI_Group group;
     win->get_group(&group);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData(
                            "Rget_accumulate", target_rank,
                            target_datatype->is_replayable() ? target_count : target_count * target_datatype->size(),
@@ -534,7 +534,7 @@ int PMPI_Compare_and_swap(void* origin_addr, void* compare_addr, void* result_ad
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
     MPI_Group group;
     win->get_group(&group);
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
+    TRACE_smpi_comm_in(my_proc_id, __func__,
                        new simgrid::instr::Pt2PtTIData("Compare_and_swap", target_rank,
                                                        datatype->is_replayable() ? 1 : datatype->size(),
                                                        simgrid::smpi::Datatype::encode(datatype)));
@@ -556,7 +556,7 @@ int PMPI_Win_post(MPI_Group group, int assert, MPI_Win win){
     retval = MPI_ERR_GROUP;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_post"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_post"));
     retval = win->post(group,assert);
     TRACE_smpi_comm_out(my_proc_id);
   }
@@ -573,7 +573,7 @@ int PMPI_Win_start(MPI_Group group, int assert, MPI_Win win){
     retval = MPI_ERR_GROUP;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_start"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_start"));
     retval = win->start(group,assert);
     TRACE_smpi_comm_out(my_proc_id);
   }
@@ -588,7 +588,7 @@ int PMPI_Win_complete(MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_complete"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_complete"));
 
     retval = win->complete();
 
@@ -605,7 +605,7 @@ int PMPI_Win_wait(MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_wait"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_wait"));
 
     retval = win->wait();
 
@@ -644,7 +644,7 @@ int PMPI_Win_unlock(int rank, MPI_Win win){
     retval = MPI_SUCCESS;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_unlock"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_unlock"));
     retval = win->unlock(rank);
     TRACE_smpi_comm_out(my_proc_id);
   }
@@ -659,7 +659,7 @@ int PMPI_Win_lock_all(int assert, MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_lock_all"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_lock_all"));
     retval = win->lock_all(assert);
     TRACE_smpi_comm_out(my_proc_id);
   }
@@ -674,7 +674,7 @@ int PMPI_Win_unlock_all(MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_unlock_all"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_unlock_all"));
     retval = win->unlock_all();
     TRACE_smpi_comm_out(my_proc_id);
   }
@@ -691,7 +691,7 @@ int PMPI_Win_flush(int rank, MPI_Win win){
     retval = MPI_SUCCESS;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_flush"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_flush"));
     retval = win->flush(rank);
     TRACE_smpi_comm_out(my_proc_id);
   }
@@ -708,7 +708,7 @@ int PMPI_Win_flush_local(int rank, MPI_Win win){
     retval = MPI_SUCCESS;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_flush_local"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_flush_local"));
     retval = win->flush_local(rank);
     TRACE_smpi_comm_out(my_proc_id);
   }
@@ -723,7 +723,7 @@ int PMPI_Win_flush_all(MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_flush_all"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_flush_all"));
     retval = win->flush_all();
     TRACE_smpi_comm_out(my_proc_id);
   }
@@ -738,7 +738,7 @@ int PMPI_Win_flush_local_all(MPI_Win win){
     retval = MPI_ERR_WIN;
   } else {
     int my_proc_id = simgrid::s4u::Actor::self()->getPid();
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("Win_flush_local_all"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Win_flush_local_all"));
     retval = win->flush_local_all();
     TRACE_smpi_comm_out(my_proc_id);
   }
index 1ce8ac6..2e3876e 100644 (file)
@@ -155,7 +155,7 @@ void TRACE_smpi_init(int rank)
   }else{
     father = simgrid::instr::Container::getRoot();
   }
-  xbt_assert(father != nullptr, "Could not find a parent for mpi rank %s at function %s", str.c_str(), __FUNCTION__);
+  xbt_assert(father != nullptr, "Could not find a parent for mpi rank %s at function %s", str.c_str(), __func__);
   father->createChild(str, "MPI");
 #if HAVE_PAPI
   container_t container   = simgrid::instr::Container::byName(str);
index 8b5a76c..ae1ad78 100644 (file)
@@ -34,8 +34,7 @@ static MPI_Datatype MPI_DEFAULT_TYPE;
                            "%zu items were given on the line. First two should be process_id and action.  "            \
                            "This action needs after them %lu mandatory arguments, and accepts %lu optional ones. \n"   \
                            "Please contact the Simgrid team if support is needed",                                     \
-             __FUNCTION__, action.size(), static_cast<unsigned long>(mandatory),                                       \
-             static_cast<unsigned long>(optional));                                                                    \
+             __func__, action.size(), static_cast<unsigned long>(mandatory), static_cast<unsigned long>(optional));    \
   }
 
 static void log_timed_action(simgrid::xbt::ReplayAction& action, double clock)
@@ -444,7 +443,7 @@ public:
     int dst                  = request->comm()->group()->rank(request->dst());
     bool is_wait_for_receive = (request->flags() & RECV);
     // TODO: Here we take the rank while we normally take the process id (look for my_proc_id)
-    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("wait"));
+    TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData("wait"));
 
     MPI_Status status;
     Request::wait(&request, &status);
@@ -463,8 +462,8 @@ public:
   {
     int dst_traced = MPI_COMM_WORLD->group()->actor(args.partner)->getPid();
 
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::Pt2PtTIData(name, args.partner, args.size,
-                                                                                 Datatype::encode(args.datatype1)));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::Pt2PtTIData(name, args.partner, args.size,
+                                                                             Datatype::encode(args.datatype1)));
     if (not TRACE_smpi_view_internals())
       TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, 0, args.size * args.datatype1->size());
 
@@ -489,8 +488,8 @@ public:
   {
     int src_traced = MPI_COMM_WORLD->group()->actor(args.partner)->getPid();
 
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::Pt2PtTIData(name, args.partner, args.size,
-                                                                                 Datatype::encode(args.datatype1)));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::Pt2PtTIData(name, args.partner, args.size,
+                                                                             Datatype::encode(args.datatype1)));
 
     MPI_Status status;
     // unknown size from the receiver point of view
@@ -583,8 +582,7 @@ public:
     const unsigned int count_requests = get_reqq_self()->size();
 
     if (count_requests > 0) {
-      TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
-                         new simgrid::instr::Pt2PtTIData("waitAll", -1, count_requests, ""));
+      TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::Pt2PtTIData("waitAll", -1, count_requests, ""));
       std::vector<std::pair</*sender*/int,/*recv*/int>> sender_receiver;
       for (const auto& req : (*get_reqq_self())) {
         if (req && (req->flags() & RECV)) {
@@ -607,7 +605,7 @@ public:
   BarrierAction() : ReplayAction("barrier") {}
   void kernel(simgrid::xbt::ReplayAction& action) override
   {
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::NoOpTIData("barrier"));
+    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("barrier"));
     Colls::barrier(MPI_COMM_WORLD);
     TRACE_smpi_comm_out(my_proc_id);
   }
@@ -785,10 +783,10 @@ public:
   AllToAllVAction() : ReplayAction("allToAllV") {}
   void kernel(simgrid::xbt::ReplayAction& action) override
   {
-    TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
-        new simgrid::instr::VarCollTIData("allToAllV", -1, args.send_size_sum, args.sendcounts, args.recv_size_sum, args.recvcounts,
-          Datatype::encode(args.datatype1),
-          Datatype::encode(args.datatype2)));
+    TRACE_smpi_comm_in(my_proc_id, __func__,
+                       new simgrid::instr::VarCollTIData(
+                           "allToAllV", -1, args.send_size_sum, args.sendcounts, args.recv_size_sum, args.recvcounts,
+                           Datatype::encode(args.datatype1), Datatype::encode(args.datatype2)));
 
     Colls::alltoallv(send_buffer(args.send_buf_size * args.datatype1->size()), args.sendcounts->data(), args.senddisps.data(), args.datatype1,
                      recv_buffer(args.recv_buf_size * args.datatype2->size()), args.recvcounts->data(), args.recvdisps.data(), args.datatype2, MPI_COMM_WORLD);
index 3073e99..7365993 100644 (file)
@@ -662,7 +662,7 @@ static void xbt_log_help(void)
          "in 'l'etter)\n"
          "         -> %%L: line number where the log event was raised (LOG4J compatible)\n"
          "         -> %%M: function name (LOG4J compatible -- called method name here of course).\n"
-         "                 Defined only when using gcc because there is no __FUNCTION__ elsewhere.\n"
+         "                 Defined only when using gcc because there is no __func__ elsewhere.\n"
          "\n"
          "         -> %%b: full backtrace (Called %%throwable in LOG4J). Defined only under windows or when using the "
          "GNU libc because\n"
index af18147..eb661f5 100644 (file)
@@ -113,7 +113,7 @@ static void *MTestTypeContigInit(MTestDatatype * mtype)
         p = (unsigned char *) (mtype->buf);
         if (!p) {
             char errmsg[128] = { 0 };
-            sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+            sprintf(errmsg, "Out of memory in %s", __func__);
             MTestError(errmsg);
         }
         for (i = 0; i < totsize; i++) {
@@ -191,7 +191,7 @@ static void *MTestTypeVectorInit(MTestDatatype * mtype)
         p = (unsigned char *) (mtype->buf);
         if (!p) {
             char errmsg[128] = { 0 };
-            sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+            sprintf(errmsg, "Out of memory in %s", __func__);
             MTestError(errmsg);
         }
 
@@ -301,7 +301,7 @@ static void *MTestTypeIndexedInit(MTestDatatype * mtype)
         p = (unsigned char *) (mtype->buf);
         if (!p) {
             char errmsg[128] = { 0 };
-            sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+            sprintf(errmsg, "Out of memory in %s", __func__);
             MTestError(errmsg);
         }
 
@@ -419,7 +419,7 @@ static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype)
         p = (unsigned char *) (mtype->buf);
         if (!p) {
             char errmsg[128] = { 0 };
-            sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+            sprintf(errmsg, "Out of memory in %s", __func__);
             MTestError(errmsg);
         }
 
@@ -530,7 +530,7 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype)
         p = (unsigned char *) (mtype->buf);
         if (!p) {
             char errmsg[128] = { 0 };
-            sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+            sprintf(errmsg, "Out of memory in %s", __func__);
             MTestError(errmsg);
         }
 
@@ -630,7 +630,7 @@ static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype)
         }
     }
     if (err)
-        printf("%s error\n", __FUNCTION__);
+      printf("%s error\n", __func__);
     return err;
 }
 
@@ -813,7 +813,7 @@ static int MTestTypeIndexedCreate(MPI_Aint nblock, MPI_Aint blocklen, MPI_Aint s
     mtype->index = (int *) malloc(nblock * sizeof(int));
     if (!mtype->displs || !mtype->displ_in_bytes || !mtype->index) {
         char errmsg[128] = { 0 };
-        sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+        sprintf(errmsg, "Out of memory in %s", __func__);
         MTestError(errmsg);
     }
 
@@ -875,7 +875,7 @@ static inline int MTestTypeHindexedCreate(MPI_Aint nblock, MPI_Aint blocklen, MP
     mtype->displ_in_bytes = (MPI_Aint *) malloc(nblock * sizeof(MPI_Aint));
     if (!mtype->displ_in_bytes || !mtype->index) {
         char errmsg[128] = { 0 };
-        sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+        sprintf(errmsg, "Out of memory in %s", __func__);
         MTestError(errmsg);
     }
 
@@ -939,7 +939,7 @@ static int MTestTypeIndexedBlockCreate(MPI_Aint nblock, MPI_Aint blocklen, MPI_A
     mtype->displ_in_bytes = (MPI_Aint *) malloc(nblock * sizeof(MPI_Aint));
     if (!mtype->displs || !mtype->displ_in_bytes) {
         char errmsg[128] = { 0 };
-        sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+        sprintf(errmsg, "Out of memory in %s", __func__);
         MTestError(errmsg);
     }
 
@@ -1001,7 +1001,7 @@ static int MTestTypeHindexedBlockCreate(MPI_Aint nblock, MPI_Aint blocklen, MPI_
     mtype->displ_in_bytes = (MPI_Aint *) malloc(nblock * sizeof(MPI_Aint));
     if (!mtype->displ_in_bytes) {
         char errmsg[128] = { 0 };
-        sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+        sprintf(errmsg, "Out of memory in %s", __func__);
         MTestError(errmsg);
     }
 
@@ -1065,7 +1065,7 @@ static int MTestTypeStructCreate(MPI_Aint nblock, MPI_Aint blocklen, MPI_Aint st
     mtype->index = (int *) malloc(nblock * sizeof(int));
     if (!mtype->displ_in_bytes || !mtype->old_datatypes) {
         char errmsg[128] = { 0 };
-        sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+        sprintf(errmsg, "Out of memory in %s", __func__);
         MTestError(errmsg);
     }
 
@@ -1303,7 +1303,7 @@ void *MTestTypeInitRecv(MTestDatatype * mtype)
         p = (signed char *) (mtype->buf);
         if (!p) {
             char errmsg[128] = { 0 };
-            sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+            sprintf(errmsg, "Out of memory in %s", __func__);
             MTestError(errmsg);
         }
         for (i = 0; i < totsize; i++) {
index 11eb0de..76dd032 100644 (file)
@@ -335,9 +335,9 @@ static inline int MTestGetBasicDatatypes(MTestDatatype * sendtype,
     int merr = 0;
     int bdt_index = datatype_index - MTEST_BDT_START_IDX;
     if (bdt_index >= MTEST_BDT_MAX) {
-        printf("Wrong index:  global %d, bst %d in %s\n", datatype_index, bdt_index, __FUNCTION__);
-        merr++;
-        return merr;
+      printf("Wrong index:  global %d, bst %d in %s\n", datatype_index, bdt_index, __func__);
+      merr++;
+      return merr;
     }
 
     switch (bdt_index) {
@@ -400,20 +400,20 @@ static inline int MTestGetSendDerivedDatatypes(MTestDatatype * sendtype,
     ddt_datatype_index = datatype_index - MTEST_SEND_DDT_START_IDX;
     ddt_c_dt = ddt_datatype_index / MTEST_DDT_NUM_SUBTESTS;
     if (ddt_c_dt >= MTEST_DDT_MAX || !mtestDdtCreators[ddt_c_dt]) {
-        printf("Wrong index:  global %d, send %d send-ddt %d, or undefined creator in %s\n",
-               datatype_index, ddt_datatype_index, ddt_c_dt, __FUNCTION__);
-        merr++;
-        return merr;
+      printf("Wrong index:  global %d, send %d send-ddt %d, or undefined creator in %s\n", datatype_index,
+             ddt_datatype_index, ddt_c_dt, __func__);
+      merr++;
+      return merr;
     }
 
     /* Set datatype structure */
     merr = MTestDdtStructDefine(ddt_datatype_index, tot_count, &count, &blen,
                                 &stride, &align_tot_count, &lb);
     if (merr) {
-        printf("Wrong index:  global %d, send %d send-ddt %d, or undefined ddt structure in %s\n",
-               datatype_index, ddt_datatype_index, ddt_c_dt, __FUNCTION__);
-        merr++;
-        return merr;
+      printf("Wrong index:  global %d, send %d send-ddt %d, or undefined ddt structure in %s\n", datatype_index,
+             ddt_datatype_index, ddt_c_dt, __func__);
+      merr++;
+      return merr;
     }
 
     /* Create send datatype */
@@ -445,19 +445,19 @@ static inline int MTestGetRecvDerivedDatatypes(MTestDatatype * sendtype,
     ddt_datatype_index = datatype_index - MTEST_RECV_DDT_START_IDX;
     ddt_c_dt = ddt_datatype_index / MTEST_DDT_NUM_SUBTESTS;
     if (ddt_c_dt >= MTEST_DDT_MAX || !mtestDdtCreators[ddt_c_dt]) {
-        printf("Wrong index:  global %d, recv %d recv-ddt %d, or undefined creator in %s\n",
-               datatype_index, ddt_datatype_index, ddt_c_dt, __FUNCTION__);
-        merr++;
-        return merr;
+      printf("Wrong index:  global %d, recv %d recv-ddt %d, or undefined creator in %s\n", datatype_index,
+             ddt_datatype_index, ddt_c_dt, __func__);
+      merr++;
+      return merr;
     }
 
     /* Set datatype structure */
     merr = MTestDdtStructDefine(ddt_datatype_index, tot_count, &count, &blen,
                                 &stride, &align_tot_count, &lb);
     if (merr) {
-        printf("Wrong index:  global %d, recv %d recv-ddt %d, or undefined ddt structure in %s\n",
-               datatype_index, ddt_datatype_index, ddt_c_dt, __FUNCTION__);
-        return merr;
+      printf("Wrong index:  global %d, recv %d recv-ddt %d, or undefined ddt structure in %s\n", datatype_index,
+             ddt_datatype_index, ddt_c_dt, __func__);
+      return merr;
     }
 
     /* Create receive datatype */
index 8076351..7e271d1 100644 (file)
@@ -341,9 +341,9 @@ static inline int MTestGetBasicDatatypes(MTestDatatype * sendtype,
     int merr = 0;
     int bdt_index = SMPI_VARGET_GLOBAL(datatype_index) - SMPI_VARGET_GLOBAL(MTEST_BDT_START_IDX);
     if (bdt_index >= MTEST_BDT_MAX) {
-        printf("Wrong index:  global %d, bst %d in %s\n", SMPI_VARGET_GLOBAL(datatype_index), bdt_index, __FUNCTION__);
-        merr++;
-        return merr;
+      printf("Wrong index:  global %d, bst %d in %s\n", SMPI_VARGET_GLOBAL(datatype_index), bdt_index, __func__);
+      merr++;
+      return merr;
     }
 
     switch (bdt_index) {
@@ -406,20 +406,20 @@ static inline int MTestGetSendDerivedDatatypes(MTestDatatype * sendtype,
     ddt_datatype_index = SMPI_VARGET_GLOBAL(datatype_index) - SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_START_IDX);
     ddt_c_dt = ddt_datatype_index / MTEST_DDT_NUM_SUBTESTS;
     if (ddt_c_dt >= MTEST_DDT_MAX || !SMPI_VARGET_GLOBAL(mtestDdtCreators)[ddt_c_dt]) {
-        printf("Wrong index:  global %d, send %d send-ddt %d, or undefined creator in %s\n",
-               SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __FUNCTION__);
-        merr++;
-        return merr;
+      printf("Wrong index:  global %d, send %d send-ddt %d, or undefined creator in %s\n",
+             SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __func__);
+      merr++;
+      return merr;
     }
 
     /* Set datatype structure */
     merr = MTestDdtStructDefine(ddt_datatype_index, tot_count, &count, &blen,
                                 &stride, &align_tot_count, &lb);
     if (merr) {
-        printf("Wrong index:  global %d, send %d send-ddt %d, or undefined ddt structure in %s\n",
-               SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __FUNCTION__);
-        merr++;
-        return merr;
+      printf("Wrong index:  global %d, send %d send-ddt %d, or undefined ddt structure in %s\n",
+             SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __func__);
+      merr++;
+      return merr;
     }
 
     /* Create send datatype */
@@ -451,19 +451,19 @@ static inline int MTestGetRecvDerivedDatatypes(MTestDatatype * sendtype,
     ddt_datatype_index = SMPI_VARGET_GLOBAL(datatype_index) - SMPI_VARGET_GLOBAL(MTEST_RECV_DDT_START_IDX);
     ddt_c_dt = ddt_datatype_index / MTEST_DDT_NUM_SUBTESTS;
     if (ddt_c_dt >= MTEST_DDT_MAX || !SMPI_VARGET_GLOBAL(mtestDdtCreators)[ddt_c_dt]) {
-        printf("Wrong index:  global %d, recv %d recv-ddt %d, or undefined creator in %s\n",
-               SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __FUNCTION__);
-        merr++;
-        return merr;
+      printf("Wrong index:  global %d, recv %d recv-ddt %d, or undefined creator in %s\n",
+             SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __func__);
+      merr++;
+      return merr;
     }
 
     /* Set datatype structure */
     merr = MTestDdtStructDefine(ddt_datatype_index, tot_count, &count, &blen,
                                 &stride, &align_tot_count, &lb);
     if (merr) {
-        printf("Wrong index:  global %d, recv %d recv-ddt %d, or undefined ddt structure in %s\n",
-               SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __FUNCTION__);
-        return merr;
+      printf("Wrong index:  global %d, recv %d recv-ddt %d, or undefined ddt structure in %s\n",
+             SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __func__);
+      return merr;
     }
 
     /* Create receive datatype */