|
8 | 8 | * University of Stuttgart. All rights reserved. |
9 | 9 | * Copyright (c) 2004-2005 The Regents of the University of California. |
10 | 10 | * All rights reserved. |
11 | | - * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights |
| 11 | + * Copyright (c) 2007-2016 Los Alamos National Security, LLC. All rights |
12 | 12 | * reserved. |
13 | 13 | * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. |
14 | 14 | * Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved. |
@@ -149,19 +149,20 @@ struct ompi_osc_pt2pt_module_t { |
149 | 149 | uint32_t *epoch_outgoing_frag_count; |
150 | 150 |
|
151 | 151 | /** cyclic counter for a unique tage for long messages. */ |
152 | | - unsigned int tag_counter; |
| 152 | + uint32_t tag_counter; |
| 153 | + uint32_t rtag_counter; |
153 | 154 |
|
154 | 155 | /* Number of outgoing fragments that have completed since the |
155 | 156 | begining of time */ |
156 | | - uint32_t outgoing_frag_count; |
| 157 | + volatile uint32_t outgoing_frag_count; |
157 | 158 | /* Next outgoing fragment count at which we want a signal on cond */ |
158 | | - uint32_t outgoing_frag_signal_count; |
| 159 | + volatile uint32_t outgoing_frag_signal_count; |
159 | 160 |
|
160 | 161 | /* Number of incoming fragments that have completed since the |
161 | 162 | begining of time */ |
162 | | - uint32_t active_incoming_frag_count; |
| 163 | + volatile uint32_t active_incoming_frag_count; |
163 | 164 | /* Next incoming buffer count at which we want a signal on cond */ |
164 | | - uint32_t active_incoming_frag_signal_count; |
| 165 | + volatile uint32_t active_incoming_frag_signal_count; |
165 | 166 |
|
166 | 167 | /** Number of targets locked/being locked */ |
167 | 168 | unsigned int passive_target_access_epoch; |
@@ -408,14 +409,6 @@ int ompi_osc_pt2pt_component_irecv(ompi_osc_pt2pt_module_t *module, |
408 | 409 | int tag, |
409 | 410 | struct ompi_communicator_t *comm); |
410 | 411 |
|
411 | | -int ompi_osc_pt2pt_component_isend(ompi_osc_pt2pt_module_t *module, |
412 | | - const void *buf, |
413 | | - size_t count, |
414 | | - struct ompi_datatype_t *datatype, |
415 | | - int dest, |
416 | | - int tag, |
417 | | - struct ompi_communicator_t *comm); |
418 | | - |
419 | 412 | /** |
420 | 413 | * ompi_osc_pt2pt_progress_pending_acc: |
421 | 414 | * |
@@ -657,13 +650,18 @@ static inline int get_tag(ompi_osc_pt2pt_module_t *module) |
657 | 650 | /* the LSB of the tag is used be the receiver to determine if the |
658 | 651 | message is a passive or active target (ie, where to mark |
659 | 652 | completion). */ |
660 | | - int tmp = module->tag_counter + !!(module->passive_target_access_epoch); |
661 | | - |
662 | | - module->tag_counter = (module->tag_counter + 2) & OSC_PT2PT_FRAG_MASK; |
663 | | - |
664 | | - return tmp; |
| 653 | + int32_t tmp = OPAL_THREAD_ADD32((volatile int32_t *) &module->tag_counter, 4); |
| 654 | + return (tmp & OSC_PT2PT_FRAG_MASK) | !!(module->passive_target_access_epoch); |
665 | 655 | } |
666 | 656 |
|
| 657 | +static inline int get_rtag(ompi_osc_pt2pt_module_t *module) |
| 658 | +{ |
| 659 | + /* the LSB of the tag is used be the receiver to determine if the |
| 660 | + message is a passive or active target (ie, where to mark |
| 661 | + completion). */ |
| 662 | + int32_t tmp = OPAL_THREAD_ADD32((volatile int32_t *) &module->rtag_counter, 4); |
| 663 | + return (tmp & OSC_PT2PT_FRAG_MASK) | !!(module->passive_target_access_epoch); |
| 664 | +} |
667 | 665 | /** |
668 | 666 | * ompi_osc_pt2pt_accumulate_lock: |
669 | 667 | * |
|
0 commit comments