Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpix: gpu stream aware extensions #5905

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
api: add frame for MPI_Send_enqueue and MPI_Recv_enqueue
hzhou committed Mar 31, 2022
commit b134d9c674d95a344a8e3757fd8a681002aca364
2 changes: 2 additions & 0 deletions maint/local_python/binding_common.py
Original file line number Diff line number Diff line change
@@ -187,6 +187,8 @@ def is_pointer_type(param):
return 1
elif RE.match(r'(ATTRIBUTE_VAL\w*|(C_)?BUFFER\d?|EXTRA_STATE\d*|TOOL_MPI_OBJ|(POLY)?FUNCTION\w*)$', param['kind']):
return 1
elif RE.match(r'(GPU_STREAM)$', param['kind']):
return 1
elif param['param_direction'] != 'in':
return 1
elif param['length']:
2 changes: 2 additions & 0 deletions maint/local_python/binding_f77.py
Original file line number Diff line number Diff line change
@@ -1120,6 +1120,8 @@ def check_func_directives(func):
func['_skip_fortran'] = 1
elif RE.match(r'mpix_grequest_', func['name'], re.IGNORECASE):
func['_skip_fortran'] = 1
elif RE.match(r'mpix_(Send|Recv)_enqueue', func['name'], re.IGNORECASE):
func['_skip_fortran'] = 1
elif RE.match(r'mpi_\w+_(f|f08|c)2(f|f08|c)$', func['name'], re.IGNORECASE):
# implemented in mpi_f08_types.f90
func['_skip_fortran'] = 1
21 changes: 21 additions & 0 deletions src/binding/c/pt2pt_api.txt
Original file line number Diff line number Diff line change
@@ -548,3 +548,24 @@ MPI_Isendrecv:

MPI_Isendrecv_replace:
.desc: Starts a nonblocking send and receive with a single buffer

MPIX_Send_enqueue:
.desc: Enqueue a send operation on a gpu stream
buf: BUFFER, constant=True, [initial address of send buffer]
count: POLYXFER_NUM_ELEM_NNI, [number of elements in send buffer]
datatype: DATATYPE, [datatype of each send buffer element]
dest: RANK, [rank of destination]
tag: TAG, [message tag]
comm: COMMUNICATOR
stream: GPU_STREAM, [gpu stream to enqueue on]

MPIX_Recv_enqueue:
.desc: Enqueue a send operation on a gpu stream
buf: BUFFER, direction=out, [initial address of receive buffer]
count: POLYXFER_NUM_ELEM_NNI, [number of elements in receive buffer]
datatype: DATATYPE, [datatype of each receive buffer element]
source: RANK, [rank of source or MPI_ANY_SOURCE]
tag: TAG, [message tag or MPI_ANY_TAG]
comm: COMMUNICATOR
status: STATUS, direction=out
stream: GPU_STREAM, [gpu stream to enqueue on]
7 changes: 7 additions & 0 deletions src/binding/custom_mapping.txt
Original file line number Diff line number Diff line change
@@ -3,28 +3,35 @@

LIS_KIND_MAP:
GPU_TYPE: integer
GPU_STREAM: integer(kind=cuda_stream_kind)
GREQUEST_CLASS: None

SMALL_F90_KIND_MAP:
GPU_TYPE: INTEGER
GPU_STREAM: integer(kind=cuda_stream_kind)
GREQUEST_CLASS: INTEGER

BIG_F90_KIND_MAP:
GPU_TYPE: INTEGER
GPU_STREAM: integer(kind=cuda_stream_kind)
GREQUEST_CLASS: INTEGER

SMALL_F08_KIND_MAP:
GPU_TYPE: INTEGER
GPU_STREAM: integer(kind=cuda_stream_kind)
GREQUEST_CLASS: INTEGER

BIG_F08_KIND_MAP:
GPU_TYPE: INTEGER
GPU_STREAM: integer(kind=cuda_stream_kind)
GREQUEST_CLASS: INTEGER

SMALL_C_KIND_MAP:
GPU_TYPE: int
GPU_STREAM: void
GREQUEST_CLASS: MPIX_Grequest_class

BIG_C_KIND_MAP:
GPU_TYPE: int
GPU_STREAM: void
GREQUEST_CLASS: MPIX_Grequest_class
1 change: 1 addition & 0 deletions src/mpi/pt2pt/Makefile.mk
Original file line number Diff line number Diff line change
@@ -5,4 +5,5 @@

mpi_core_sources += \
src/mpi/pt2pt/sendrecv.c \
src/mpi/pt2pt/stream.c \
src/mpi/pt2pt/bsendutil.c
21 changes: 21 additions & 0 deletions src/mpi/pt2pt/stream.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) by Argonne National Laboratory
* See COPYRIGHT in top-level directory
*/

#include "mpiimpl.h"

int MPIR_Send_stream_impl(const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPIR_Comm * comm_ptr, void *stream)
{
int mpi_errno = MPI_SUCCESS;
return mpi_errno;
}

int MPIR_Recv_stream_impl(void *buf, MPI_Aint count, MPI_Datatype datatype,
int source, int tag, MPIR_Comm * comm_ptr, MPI_Status * status,
void *stream)
{
int mpi_errno = MPI_SUCCESS;
return mpi_errno;
}