/* smpi_datatype.cpp -- MPI primitives to handle datatypes */
-/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-2022. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
} else if (elem.copy_fn.type_copy_fn != MPI_NULL_COPY_FN) {
ret = elem.copy_fn.type_copy_fn(datatype, it.first, elem.extra_state, it.second, &value_out, &flag);
}
+ if (ret != MPI_SUCCESS)
+ return ret;
+
if (elem.copy_fn.type_copy_fn_fort != MPI_NULL_COPY_FN) {
value_out = xbt_new(int, 1);
if (*(int*)*elem.copy_fn.type_copy_fn_fort == 1) { // MPI_TYPE_DUP_FN
} else { // not null, nor dup
elem.copy_fn.type_copy_fn_fort(datatype, it.first, elem.extra_state, it.second, value_out, &flag, &ret);
}
- if (ret != MPI_SUCCESS)
+ if (ret != MPI_SUCCESS) {
xbt_free(value_out);
+ return ret;
+ }
}
- if (ret != MPI_SUCCESS)
- return ret;
if (flag) {
elem.refcount++;
attributes().emplace(it.first, value_out);
return (flags_ & DT_FLAG_BASIC);
}
-bool Datatype::is_replayable() const
-{
- return (simgrid::instr::trace_format == simgrid::instr::TraceFormat::Ti) &&
- ((this == MPI_BYTE) || (this == MPI_DOUBLE) || (this == MPI_INT) || (this == MPI_CHAR) ||
- (this == MPI_SHORT) || (this == MPI_LONG) || (this == MPI_FLOAT));
-}
-
MPI_Datatype Datatype::decode(const std::string& datatype_id)
{
return id2type_lookup.find(datatype_id)->second;