Exemple #1
0
VT_MPI_INT VTUnify_MPI_Abort( VTUnify_MPI_Comm ucomm, VT_MPI_INT errorcode )
{
   VT_MPI_INT error;
   MPI_Comm comm = get_mpi_comm( ucomm );

   error = CALL_MPI( MPI_Abort( comm, errorcode ) );

   return (error == MPI_SUCCESS) ? 1 : 0;
}
Exemple #2
0
VT_MPI_INT VTUnify_MPI_Comm_rank( VTUnify_MPI_Comm ucomm, VT_MPI_INT * rank )
{
   VT_MPI_INT error;
   MPI_Comm comm = get_mpi_comm( ucomm );

   error = CALL_MPI( MPI_Comm_rank( comm, rank ) );

   return (error == MPI_SUCCESS) ? 1 : 0;
}
Exemple #3
0
VT_MPI_INT VTUnify_MPI_Comm_size( VTUnify_MPI_Comm ucomm, VT_MPI_INT * size )
{
   VT_MPI_INT error;
   MPI_Comm comm = get_mpi_comm( ucomm );

   error = CALL_MPI( MPI_Comm_size( comm, size ) );

   return (error == MPI_SUCCESS) ? 1 : 0;
}
Exemple #4
0
VT_MPI_INT VTUnify_MPI_Barrier( VTUnify_MPI_Comm ucomm )
{
  VT_MPI_INT error;
  MPI_Comm comm = get_mpi_comm( ucomm );

  error = CALL_MPI( MPI_Barrier( comm ) );

  return (error == MPI_SUCCESS) ? 1 : 0;
}
Exemple #5
0
VT_MPI_INT VTUnify_MPI_Send( void * buf, VT_MPI_INT count,
                             VTUnify_MPI_Datatype utype, VT_MPI_INT dest,
                             VT_MPI_INT tag, VTUnify_MPI_Comm ucomm )
{
   VT_MPI_INT error;
   MPI_Datatype type = get_mpi_type( utype );
   MPI_Comm comm = get_mpi_comm( ucomm );

   error = CALL_MPI( MPI_Send( buf, count, type, dest, tag, comm ) );

   return (error == MPI_SUCCESS) ? 1 : 0;
}
Exemple #6
0
VT_MPI_INT VTUnify_MPI_Pack_size( VT_MPI_INT incount,
                                  VTUnify_MPI_Datatype utype,
                                  VTUnify_MPI_Comm ucomm, VT_MPI_INT * size )
{
   VT_MPI_INT error;
   MPI_Datatype type = get_mpi_type( utype );
   MPI_Comm comm = get_mpi_comm( ucomm );

   error = CALL_MPI( MPI_Pack_size( incount, type, comm, size ) );

   return (error == MPI_SUCCESS) ? 1 : 0;
}
VT_MPI_INT VTUnify_MPI_Pack( void * inbuf, VT_MPI_INT incount,
                             VTUnify_MPI_Datatype utype, void * outbuf,
                             VT_MPI_INT outsize, VT_MPI_INT * position,
                             VTUnify_MPI_Comm ucomm )
{
   VT_MPI_INT error;
   MPI_Datatype type = get_mpi_type( utype );
   MPI_Comm comm = get_mpi_comm( ucomm );

   error = MPI_Pack( inbuf, incount, type, outbuf, outsize, position, comm );

   return (error == MPI_SUCCESS) ? 1 : 0;
}
Exemple #8
0
VT_MPI_INT VTUnify_MPI_Bcast( void * buffer, VT_MPI_INT count,
                              VTUnify_MPI_Datatype utype, VT_MPI_INT root,
                              VTUnify_MPI_Comm ucomm )
{
   VT_MPI_INT error;
   MPI_Datatype type = get_mpi_type( utype );
   MPI_Comm comm = get_mpi_comm( ucomm );

   error = CALL_MPI( MPI_Bcast( (buffer == VTUnify_MPI_BOTTOM) ?
                                MPI_BOTTOM : buffer,
                                count, type, root, comm ) );

   return (error == MPI_SUCCESS) ? 1 : 0;
}
Exemple #9
0
VT_MPI_INT VTUnify_MPI_Allreduce( void * sendbuf, void * recvbuf, int count,
                                  VTUnify_MPI_Datatype utype,
                                  VTUnify_MPI_Op uop, VTUnify_MPI_Comm ucomm )
{
   VT_MPI_INT error;
   MPI_Datatype type = get_mpi_type( utype );
   MPI_Op op = get_mpi_op( uop );
   MPI_Comm comm = get_mpi_comm( ucomm );

   error = CALL_MPI( MPI_Allreduce( (sendbuf == VTUnify_MPI_BOTTOM) ?
                                    MPI_BOTTOM : sendbuf,
                                    (recvbuf == VTUnify_MPI_BOTTOM) ?
                                    MPI_BOTTOM : recvbuf,
                                    count, type, op, comm ) );

   return (error == MPI_SUCCESS) ? 1 : 0;
}
Exemple #10
0
VT_MPI_INT VTUnify_MPI_Recv( void * buf, VT_MPI_INT count,
                             VTUnify_MPI_Datatype utype, VT_MPI_INT source,
                             VT_MPI_INT tag, VTUnify_MPI_Comm ucomm,
                             VTUnify_MPI_Status * ustatus )
{
   VT_MPI_INT error;
   MPI_Datatype type = get_mpi_type( utype );
   MPI_Comm comm = get_mpi_comm( ucomm );
   MPI_Status status;

   error = CALL_MPI( MPI_Recv( buf, count, type, source, tag, comm, &status ) );

   if( ustatus != VTUnify_MPI_STATUS_IGNORE )
   {
      ustatus->source = status.MPI_SOURCE;
      ustatus->tag = status.MPI_TAG;
   }

   return (error == MPI_SUCCESS) ? 1 : 0;
}
Exemple #11
0
VT_MPI_INT VTUnify_MPI_Gather( void * sendbuf, VT_MPI_INT sendcount,
                               VTUnify_MPI_Datatype usendtype,
                               void * recvbuf, VT_MPI_INT recvcount,
                               VTUnify_MPI_Datatype urecvtype,
                               VT_MPI_INT root, VTUnify_MPI_Comm ucomm )
{
   VT_MPI_INT error;
   MPI_Datatype sendtype = get_mpi_type( usendtype );
   MPI_Datatype recvtype = get_mpi_type( urecvtype );
   MPI_Comm comm = get_mpi_comm( ucomm );

   error = CALL_MPI( MPI_Gather( (sendbuf == VTUnify_MPI_BOTTOM) ? 
                                 MPI_BOTTOM : sendbuf,
                                 sendcount, sendtype,
                                 (recvbuf == VTUnify_MPI_BOTTOM) ?
                                 MPI_BOTTOM : recvbuf,
                                 recvcount, recvtype, root, comm ) );

   return (error == MPI_SUCCESS) ? 1 : 0;
}