Change all f2c() functions to use the safe
ompi_pointer_array_get_item() function instead of accessing the array directly. This is because accessing the array directly in multi-threaded situations is unsafe (someone else may be writing to the array, the array may get moved out from under you via realloc(), etc.). This commit was SVN r2634.
Этот коммит содержится в:
родитель
a14ee7eb48
Коммит
8e14d725ad
@ -37,5 +37,5 @@ MPI_Comm MPI_Comm_f2c(MPI_Fint comm)
|
||||
return MPI_COMM_NULL;
|
||||
}
|
||||
|
||||
return ompi_mpi_communicators.addr[o_index];
|
||||
return ompi_pointer_array_get_item(&ompi_mpi_communicators, o_index);
|
||||
}
|
||||
|
@ -39,5 +39,6 @@ MPI_Errhandler MPI_Errhandler_f2c(MPI_Fint errhandler_f)
|
||||
return MPI_ERRHANDLER_NULL;
|
||||
}
|
||||
|
||||
return ompi_errhandler_f_to_c_table->addr[eh_index];
|
||||
return ompi_pointer_array_get_item(ompi_errhandler_f_to_c_table,
|
||||
eh_index);
|
||||
}
|
||||
|
@ -38,5 +38,5 @@ MPI_File MPI_File_f2c(MPI_Fint file_f)
|
||||
return MPI_FILE_NULL;
|
||||
}
|
||||
|
||||
return ompi_file_f_to_c_table.addr[file_index];
|
||||
return ompi_pointer_array_get_item(&ompi_file_f_to_c_table, file_index);
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ static const char FUNC_NAME[] = "MPI_Group_f2c";
|
||||
MPI_Group MPI_Group_f2c(MPI_Fint group_f)
|
||||
{
|
||||
/* local variables */
|
||||
ompi_group_t *group_c;
|
||||
size_t group_index;
|
||||
|
||||
group_index = (size_t) group_f;
|
||||
@ -41,6 +40,5 @@ MPI_Group MPI_Group_f2c(MPI_Fint group_f)
|
||||
return MPI_GROUP_NULL;
|
||||
}
|
||||
|
||||
group_c = ompi_group_f_to_c_table->addr[group_index];
|
||||
return (MPI_Group) group_c;
|
||||
return ompi_pointer_array_get_item(ompi_group_f_to_c_table, group_index);
|
||||
}
|
||||
|
@ -47,5 +47,5 @@ MPI_Info MPI_Info_f2c(MPI_Fint info)
|
||||
return MPI_INFO_NULL;
|
||||
}
|
||||
|
||||
return ompi_info_f_to_c_table.addr[info_index];
|
||||
return ompi_pointer_array_get_item(&ompi_info_f_to_c_table, info_index);
|
||||
}
|
||||
|
@ -40,5 +40,5 @@ MPI_Op MPI_Op_f2c(MPI_Fint op_f)
|
||||
return MPI_OP_NULL;
|
||||
}
|
||||
|
||||
return ompi_op_f_to_c_table->addr[op_index];
|
||||
return ompi_pointer_array_get_item(ompi_op_f_to_c_table, op_index);
|
||||
}
|
||||
|
@ -40,5 +40,5 @@ MPI_Request MPI_Request_f2c(MPI_Fint request)
|
||||
return MPI_REQUEST_NULL;
|
||||
}
|
||||
|
||||
return ompi_req_f_to_c_table->addr[request_index];
|
||||
return ompi_pointer_array_get_item(ompi_req_f_to_c_table, request_index);
|
||||
}
|
||||
|
@ -38,6 +38,6 @@ MPI_Datatype MPI_Type_f2c(MPI_Fint datatype)
|
||||
return MPI_DATATYPE_NULL;
|
||||
}
|
||||
|
||||
return ompi_datatype_f_to_c_table->addr[datatype];
|
||||
return ompi_pointer_array_get_item(ompi_datatype_f_to_c_table, datatype);
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user