Skip to content
Snippets Groups Projects
Commit f7357763 authored by 13518104 Kevin Austin Stefano's avatar 13518104 Kevin Austin Stefano
Browse files

make data structure mpi_edge_type

parent 6869bd98
No related merge requests found
......@@ -25,6 +25,29 @@ typedef struct
} Graph;
//Struct for OpenMPI
void makeStruct(MPI_Datatype *mpi_edge_type)
{
//Inisialisasi
MPI_Datatype types[3] = {MPI_INT, MPI_INT, MPI_INT};
MPI_Datatype mpi_edge_type;
MPI_Aint offset[3];
int block[3] = {1,1,1};
//Fill with our datatype
offset[0] = offsetof(Edge, src);
offset[1] = offsetof(Edge, dest);
offset[2] = offsetof(Edge, weight);
//Connect
MPI_Type_create_struct(3, block, offset, types, &(*mpi_edge_type));
MPI_Type_commit(&(*mpi_edge_type));
}
// Create new Graph based on V vertices and E edges
Graph *CreateGraph(int V, int E)
{
......
File deleted
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment