-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MPIX_Continue: the basic implementation
- Loading branch information
Showing
20 changed files
with
712 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# vim: set ft=c: | ||
|
||
MPIX_Continue_cb_function: | ||
.return: NOTHING | ||
error_code: ERROR_CODE | ||
user_data: BUFFER | ||
|
||
MPIX_Continue_init: | ||
.desc: Creates a new continuation request | ||
flags: ARRAY_LENGTH [flags] | ||
max_poll: ARRAY_LENGTH_NNI [maximum number of continuations to execute when | ||
testing, or 0 for no limit] | ||
info: INFO, [info argument] | ||
cont_req: REQUEST, direction=out, [continuation request created] | ||
|
||
MPIX_Continue: | ||
.desc: Attach a continuation to the operation represented by the request | ||
op_request and register it with the continuation request cont_request | ||
op_request: REQUEST, direction=inout, [the request associated with the active operation] | ||
cb: FUNCTION, func_type=MPIX_Continue_cb_function, [callback to be invoked once the operation is complete] | ||
cb_data: BUFFER, [pointer to a user-controlled buffer] | ||
flags: ARRAY_LENGTH, [flags controlling aspects of the continuation] | ||
status: STATUS, direction=inout, [status object] | ||
cont_request: REQUEST, [continuation request] | ||
|
||
MPIX_Continueall: | ||
.desc: Attach a continuation callback to a set of operation requests | ||
count: ARRAY_LENGTH_NNI, [lists length] | ||
array_of_op_requests: REQUEST, direction=inout, length=count, [array of requests] | ||
cb: FUNCTION, func_type=MPIX_Continue_cb_function, [the continuation callback function] | ||
cb_data: BUFFER, [the argument passed to the callback] | ||
flags: ARRAY_LENGTH, [flags controlling aspects of the continuation] | ||
array_of_statuses: STATUS, direction=inout, length=*, pointer=False, [array of status objects] | ||
cont_request: REQUEST, [the continuation request] | ||
{ | ||
mpi_errno = MPIR_Continueall_impl(count, request_ptrs, cb, cb_data, flags, array_of_statuses, | ||
cont_request_ptr); | ||
if (mpi_errno) { | ||
goto fn_fail; | ||
} | ||
if (!(flags & MPIX_CONT_REQBUF_VOLATILE)) { | ||
for (int i = 0; i < count; ++i) { | ||
array_of_op_requests[i] = MPI_REQUEST_NULL; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (C) by Argonne National Laboratory | ||
* See COPYRIGHT in top-level directory | ||
*/ | ||
|
||
#ifndef MPIR_ATOMIC_FLAG_H_INCLUDED | ||
#define MPIR_ATOMIC_FLAG_H_INCLUDED | ||
|
||
#include "mpi.h" | ||
#include "mpichconf.h" | ||
|
||
#if MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE && \ | ||
MPICH_THREAD_GRANULARITY == MPICH_THREAD_GRANULARITY__VCI | ||
|
||
typedef MPL_atomic_int_t MPIR_atomic_flag_t; | ||
|
||
static inline void MPIR_atomic_flag_set(MPIR_atomic_flag_t * flag_ptr, int val) | ||
{ | ||
MPL_atomic_relaxed_store_int(flag_ptr, val); | ||
} | ||
|
||
static inline int MPIR_atomic_flag_get(MPIR_atomic_flag_t * flag_ptr) | ||
{ | ||
return MPL_atomic_relaxed_load_int(flag_ptr); | ||
} | ||
|
||
static inline int MPIR_atomic_flag_swap(MPIR_atomic_flag_t * flag_ptr, int val) | ||
{ | ||
return MPL_atomic_swap_int(flag_ptr, val); | ||
} | ||
|
||
static inline int MPIR_atomic_flag_cas(MPIR_atomic_flag_t * flag_ptr, int old_val, int new_val) | ||
{ | ||
return MPL_atomic_cas_int(flag_ptr, old_val, new_val); | ||
} | ||
|
||
#else | ||
|
||
typedef int MPIR_atomic_flag_t; | ||
|
||
static inline void MPIR_atomic_flag_set(MPIR_atomic_flag_t * flag_ptr, int val) | ||
{ | ||
*flag_ptr = val; | ||
} | ||
|
||
static inline int MPIR_atomic_flag_get(MPIR_atomic_flag_t * flag_ptr) | ||
{ | ||
return *flag_ptr; | ||
} | ||
|
||
static inline int MPIR_atomic_flag_swap(MPIR_atomic_flag_t * flag_ptr, int val) | ||
{ | ||
int ret = *flag_ptr; | ||
*flag_ptr = val; | ||
return ret; | ||
} | ||
|
||
static inline int MPIR_atomic_flag_cas(MPIR_atomic_flag_t * flag_ptr, int old_val, int new_val) | ||
{ | ||
int ret = *flag_ptr; | ||
if (*flag_ptr == old_val) { | ||
*flag_ptr = new_val; | ||
} | ||
return ret; | ||
} | ||
|
||
#endif | ||
|
||
#endif /* MPIR_ATOMIC_FLAG_H_INCLUDED */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.