LAPI_Setcntr_wstatus Subroutine

Purpose

Used to set a counter to a specified value and to set the associated destination list array and destination status array to the counter.

Library

Availability Library (liblapi_r.a)

C Syntax

#include <lapi.h>
 
int LAPI_Setcntr_wstatus(hndl, cntr, num_dest, dest_list, dest_status)
 
lapi_handle_t  hndl;
lapi_cntr_t   *cntr;
int            num_dest;
uint          *dest_list;
int           *dest_status;

FORTRAN Syntax

include 'lapif.h'
 
LAPI_SETCNTR_WSTATUS(hndl, cntr, num_dest, dest_list, dest_status, ierror)
INTEGER hndl
TYPE (LAPI_CNTR_T) :: cntr
INTEGER num_dest
INTEGER dest_list(*)
INTEGER dest_status
INTEGER ierror

Description

Type of call: recovery

This subroutine sets cntr to 0. Use LAPI_Setcntr_wstatus to set the associated destination list array (dest_list) and destination status array (dest_status) to the counter. Use a corresponding LAPI_Nopoll_wait call to access these arrays. These arrays record the status of a task from where the thread calling LAPI_Nopoll_wait() is waiting for a response.

The return values for dest_status are:
LAPI_MSG_INITIAL
The task is purged or is not received.
LAPI_MSG_RECVD
The task is received.
LAPI_MSG_PURGED
The task is purged, but not received.
LAPI_MSG_PURGED_RCVD
The task is received and then purged.
LAPI_MSG_INVALID
Not valid; the task is already purged.

Note: To use this subroutine, the lib_vers field in the lapi_info_t structure must be set to L2_LIB or LAST_LIB.

Parameters

INPUT
hndl
Specifies the LAPI handle.
num_dest
Specifies the number of tasks in the destination list.
dest_list
Specifies an array of destinations waiting for this counter update. If the value of this parameter is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN), no status is returned to the user.
INPUT/OUTPUT
cntr
Specifies the address of the counter to be set (in C) or the counter structure (in FORTRAN). The value of this parameter cannot be NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
OUTPUT
dest_status
Specifies an array of status that corresponds to dest_list. The value of this parameter can be NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
ierror
Specifies a FORTRAN return code. This is always the last parameter.

Restrictions

Use of this subroutine is not recommmended on a system that is running Parallel Environment (PE).

Return Values

LAPI_SUCCESS
Indicates that the function call completed successfully.
LAPI_ERR_CNTR_NULL
Indicates that the cntr value passed in is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
LAPI_ERR_HNDL_INVALID
Indicates that the hndl passed in is not valid (not initialized or in terminated state).
LAPI_ERR_RET_PTR_NULL
Indicates that the value of dest_status is NULL in C (or LAPI_ADDR_NULL in FORTRAN), but the value of dest_list is not NULL in C (or LAPI_ADDR_NULL in FORTRAN).

Location

/usr/lib/liblapi_r.a