def MPI_Type_create_hindexed(context, args): count, sizes_ptr, displs_ptr, datatype, newtype_ptr = args sizes = context.controller.read_ints(sizes_ptr, count) check.check_sizes(context, sizes, 2) displs = context.controller.read_pointers(displs_ptr, count) newtype = types.IndexedType(datatype, count, sizes, displs, True) context.state.add_datatype(newtype) context.controller.write_int(newtype_ptr, newtype.type_id) return False
def MPI_Type_create_struct(context, args): count, sizes_ptr, displs_ptr, types_ptr, newtype_ptr = args sizes = context.controller.read_ints(sizes_ptr, count) check.check_sizes(context, sizes, 2) displs = context.controller.read_pointers(displs_ptr, count) type_ids = context.controller.read_ints(types_ptr, count) datatypes = check.check_datatypes(context, type_ids, 4, True) newtype = types.StructType(datatypes, sizes, displs) context.state.add_datatype(newtype) context.controller.write_int(newtype_ptr, newtype.type_id) return False