Skip to content

Commit d09927f

Browse files
author
rhc54
committed
Merge pull request open-mpi#564 from rhc54/qos
Consolidate all the QOS changes into one clean commit
2 parents 3af8dfd + 9cb2fcf commit d09927f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+4062
-515
lines changed

opal/class/opal_hotel.h

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
* Copyright (c) 2012-2013 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved
4+
* Copyright (c) 2015 Intel, Inc. All rights reserved.
45
* $COPYRIGHT$
5-
*
6+
*
67
* Additional copyrights may follow
7-
*
8+
*
89
* $HEADER$
910
*/
1011

@@ -23,7 +24,7 @@
2324
*
2425
* One use case for this class is for ACK-based network retransmission
2526
* schemes (NACK-based retransmission schemes probably can use
26-
* opal_ring_buffer).
27+
* opal_ring_buffer).
2728
*
2829
* For ACK-based retransmission schemes, a hotel might be used
2930
* something like this:
@@ -61,7 +62,7 @@ BEGIN_C_DECLS
6162
struct opal_hotel_t;
6263

6364
/* User-supplied function to be invoked when an occupant is evicted. */
64-
typedef void (*opal_hotel_eviction_callback_fn_t)(struct opal_hotel_t *hotel,
65+
typedef void (*opal_hotel_eviction_callback_fn_t)(struct opal_hotel_t *hotel,
6566
int room_num,
6667
void *occupant);
6768

@@ -248,6 +249,55 @@ static inline void opal_hotel_checkout(opal_hotel_t *hotel, int room_num)
248249
assume the upper layer knows what it's doing. */
249250
}
250251

252+
/**
253+
* Check the specified occupant out of the hotel and return the occupant.
254+
*
255+
* @param hotel Pointer to hotel (IN)
256+
* @param room Room number to checkout (IN)
257+
* @param void * occupant (OUT)
258+
* If there is an occupant in the room, their timer is canceled and
259+
* they are checked out.
260+
*
261+
* Use this checkout and when caller needs the occupant
262+
*/
263+
static inline void opal_hotel_checkout_and_return_occupant(opal_hotel_t *hotel, int room_num, void **occupant)
264+
{
265+
opal_hotel_room_t *room;
266+
267+
/* Bozo check */
268+
assert(room_num < hotel->num_rooms);
269+
270+
/* If there's an occupant in the room, check them out */
271+
room = &(hotel->rooms[room_num]);
272+
if (OPAL_LIKELY(NULL != room->occupant)) {
273+
opal_output (10, "checking out occupant %p from room num %d", room->occupant, room_num);
274+
*occupant = room->occupant;
275+
room->occupant = NULL;
276+
opal_event_del(&(room->eviction_timer_event));
277+
hotel->last_unoccupied_room++;
278+
assert(hotel->last_unoccupied_room < hotel->num_rooms);
279+
hotel->unoccupied_rooms[hotel->last_unoccupied_room] = room_num;
280+
}
281+
else {
282+
opal_output( 0, " OOPS there is no occupant in room_num %d", room_num);
283+
}
284+
285+
}
286+
287+
/**
288+
* Returns true if the hotel is empty (no occupant)
289+
* @param hotel Pointer to hotel (IN)
290+
* @return bool true if empty false if there is a occupant(s)
291+
*
292+
*/
293+
static inline bool opal_hotel_is_empty (opal_hotel_t *hotel)
294+
{
295+
if (hotel->last_unoccupied_room == hotel->num_rooms - 1)
296+
return true;
297+
else
298+
return false;
299+
}
300+
251301
/**
252302
* Destroy a hotel.
253303
*

opal/class/opal_object.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
* Copyright (c) 2004-2007 The University of Tennessee and The University
66
* of Tennessee Research Foundation. All rights
77
* reserved.
8-
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
8+
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved.
1313
* $COPYRIGHT$
14-
*
1514
* Additional copyrights may follow
16-
*
1715
* $HEADER$
1816
*/
1917

@@ -46,13 +44,13 @@
4644
* OBJ_CLASS_DECLARATION(sally_t);
4745
* @endcode
4846
* All classes must have a parent which is also class.
49-
*
47+
*
5048
* In an implementation (.c) file, instantiate a class descriptor for
5149
* the class like this:
5250
* @code
5351
* OBJ_CLASS_INSTANCE(sally_t, parent_t, sally_construct, sally_destruct);
5452
* @endcode
55-
* This macro actually expands to
53+
* This macro actually expands to
5654
* @code
5755
* opal_class_t sally_t_class = {
5856
* "sally_t",
@@ -240,7 +238,7 @@ struct opal_object_t {
240238
* constructor.
241239
*
242240
* @param type Type (class) of the object
243-
* @return Pointer to the object
241+
* @return Pointer to the object
244242
*/
245243
static inline opal_object_t *opal_obj_new(opal_class_t * cls);
246244
#if OPAL_ENABLE_DEBUG
@@ -304,12 +302,14 @@ static inline opal_object_t *opal_obj_new_debug(opal_class_t* type, const char*
304302
* to NULL.
305303
*
306304
* @param object Pointer to the object
305+
*
306+
*
307307
*/
308308
#if OPAL_ENABLE_DEBUG
309309
#define OBJ_RELEASE(object) \
310310
do { \
311-
assert(NULL != ((opal_object_t *) (object))->obj_class); \
312311
assert(OPAL_OBJ_MAGIC_ID == ((opal_object_t *) (object))->obj_magic_id); \
312+
assert(NULL != ((opal_object_t *) (object))->obj_class); \
313313
if (0 == opal_obj_update((opal_object_t *) (object), -1)) { \
314314
OBJ_SET_MAGIC_ID((object), 0); \
315315
opal_obj_run_destructors((opal_object_t *) (object)); \
@@ -457,7 +457,7 @@ static inline void opal_obj_run_destructors(opal_object_t * object)
457457
*
458458
* @param size Size of the object
459459
* @param cls Pointer to the class descriptor of this object
460-
* @return Pointer to the object
460+
* @return Pointer to the object
461461
*/
462462
static inline opal_object_t *opal_obj_new(opal_class_t * cls)
463463
{

opal/util/timings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static get_ts_t _init_timestamping(opal_timer_type_t type)
201201
}
202202
}
203203

204-
opal_timing_event_t *opal_timing_event_alloc(opal_timing_t *t)
204+
static opal_timing_event_t *opal_timing_event_alloc(opal_timing_t *t)
205205
{
206206
if( t->buffer_offset >= t->buffer_size ){
207207
// notch timings overhead

orte/include/orte/constants.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* All rights reserved.
1212
* Copyright (c) 2014 Research Organization for Information Science
1313
* and Technology (RIST). All rights reserved.
14+
* Copyright (c) 2015 Intel, Inc. All rights reserved.
1415
* $COPYRIGHT$
1516
*
1617
* Additional copyrights may follow
@@ -62,7 +63,7 @@ enum {
6263
ORTE_ERR_UNPACK_INADEQUATE_SPACE = OPAL_ERR_UNPACK_INADEQUATE_SPACE,
6364
ORTE_ERR_UNPACK_READ_PAST_END_OF_BUFFER = OPAL_ERR_UNPACK_READ_PAST_END_OF_BUFFER,
6465
ORTE_ERR_TYPE_MISMATCH = OPAL_ERR_TYPE_MISMATCH,
65-
ORTE_ERR_OPERATION_UNSUPPORTED = OPAL_ERR_OPERATION_UNSUPPORTED,
66+
ORTE_ERR_OPERATION_UNSUPPORTED = OPAL_ERR_OPERATION_UNSUPPORTED,
6667
ORTE_ERR_UNKNOWN_DATA_TYPE = OPAL_ERR_UNKNOWN_DATA_TYPE,
6768
ORTE_ERR_BUFFER = OPAL_ERR_BUFFER,
6869
ORTE_ERR_DATA_TYPE_REDEF = OPAL_ERR_DATA_TYPE_REDEF,
@@ -85,7 +86,7 @@ enum {
8586
ORTE_ERR_CONNECTION_FAILED = OPAL_ERR_CONNECTION_FAILED,
8687
ORTE_ERR_AUTHENTICATION_FAILED = OPAL_ERR_AUTHENTICATION_FAILED,
8788
ORTE_ERR_COMM_FAILURE = OPAL_ERR_COMM_FAILURE,
88-
89+
8990
/* error codes specific to ORTE - don't forget to update
9091
orte/util/error_strings.c when adding new error codes!!
9192
Otherwise, the error reporting system will potentially crash,
@@ -133,7 +134,18 @@ enum {
133134
ORTE_ERR_SENSOR_LIMIT_EXCEEDED = (ORTE_ERR_BASE - 42),
134135
ORTE_ERR_ALLOCATION_PENDING = (ORTE_ERR_BASE - 43),
135136
ORTE_ERR_NO_PATH_TO_TARGET = (ORTE_ERR_BASE - 44),
136-
ORTE_ERR_OP_IN_PROGRESS = (ORTE_ERR_BASE - 45)
137+
ORTE_ERR_OP_IN_PROGRESS = (ORTE_ERR_BASE - 45),
138+
ORTE_ERR_OPEN_CHANNEL_PEER_FAIL = (ORTE_ERR_BASE - 46),
139+
ORTE_ERR_OPEN_CHANNEL_PEER_REJECT = (ORTE_ERR_BASE - 47),
140+
ORTE_ERR_QOS_TYPE_UNSUPPORTED = (ORTE_ERR_BASE - 48),
141+
ORTE_ERR_QOS_ACK_WINDOW_FULL = (ORTE_ERR_BASE - 49),
142+
ORTE_ERR_ACK_TIMEOUT_SENDER = (ORTE_ERR_BASE - 50),
143+
ORTE_ERR_ACK_TIMEOUT_RECEIVER = (ORTE_ERR_BASE - 51),
144+
ORTE_ERR_LOST_MSG_IN_WINDOW = (ORTE_ERR_BASE - 52),
145+
ORTE_ERR_CHANNEL_BUSY = (ORTE_ERR_BASE - 53),
146+
ORTE_ERR_DUPLICATE_MSG = (ORTE_ERR_BASE - 54),
147+
ORTE_ERR_OUT_OF_ORDER_MSG = (ORTE_ERR_BASE - 55),
148+
ORTE_ERR_OPEN_CHANNEL_DUPLICATE = (ORTE_ERR_BASE - 56),
137149
};
138150

139151
#define ORTE_ERR_MAX (ORTE_ERR_BASE - 100)

0 commit comments

Comments
 (0)