Skip to content

Commit

Permalink
Merge branch jedwards4b/jpe_add_mpi_type_create_hvector (PR #2)
Browse files Browse the repository at this point in the history
add mpi_type_create_hvector
  • Loading branch information
rljacob authored Apr 25, 2017
2 parents 6d736e2 + 0a44baa commit 99df320
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mpi.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#ifndef _MPI_H_
#define _MPI_H_

Expand Down Expand Up @@ -411,6 +410,9 @@ extern int MPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old
extern int MPI_Type_hvector(int count, int blocklen, MPI_Aint stride,
MPI_Datatype oldtype, MPI_Datatype *newtype);

extern int MPI_Type_create_hvector(int count, int blocklen, MPI_Aint stride,
MPI_Datatype oldtype, MPI_Datatype *newtype);

extern int MPI_Type_indexed(int count, int *blocklens, int *displacements,
MPI_Datatype oldtype, MPI_Datatype *newtype);

Expand Down
17 changes: 17 additions & 0 deletions type.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,23 @@ int MPI_Type_hvector(int count, int blocklen, MPI_Aint stride,
return Type_hvector(count, blocklen, stride, old_ptr, new_ptr);
}

FC_FUNC( mpi_type_create_hvector, MPI_TYPE_CREATE_HVECTOR )
(int * count, long * blocklen, long * stride,
int * oldtype, int * newtype, int * ierr)
{
*ierr = MPI_Type_create_hvector(*count, *blocklen, *stride, *oldtype, newtype);
}

int MPI_Type_create_hvector(int count, int blocklen, MPI_Aint stride,
MPI_Datatype oldtype, MPI_Datatype * newtype)
{
Datatype old_ptr = *(Datatype*) mpi_handle_to_datatype(oldtype);
Datatype * new_ptr;

mpi_alloc_handle(newtype, (void**) &new_ptr);
return Type_hvector(count, blocklen, stride, old_ptr, new_ptr);
}


int Type_hvector(int count, int blocklen, MPI_Aint stride,
Datatype oldtype, Datatype *newtype)
Expand Down

0 comments on commit 99df320

Please sign in to comment.