Skip to content

Commit 76320a8

Browse files
committed
opal: rename opal_atomic_init to opal_atomic_lock_init
This function is used to initalize and opal atomic lock. The old name was confusing. Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 9921237 commit 76320a8

File tree

16 files changed

+34
-34
lines changed

16 files changed

+34
-34
lines changed

ompi/mca/osc/sm/osc_sm_component.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
322322

323323
*base = module->bases[ompi_comm_rank(module->comm)];
324324

325-
opal_atomic_init(&module->my_node_state->accumulate_lock, OPAL_ATOMIC_UNLOCKED);
325+
opal_atomic_lock_init(&module->my_node_state->accumulate_lock, OPAL_ATOMIC_LOCK_UNLOCKED);
326326

327327
/* share everyone's displacement units. */
328328
module->disp_units = malloc(sizeof(int) * comm_size);

opal/class/opal_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int opal_class_init_epoch = 1;
5555
/*
5656
* Local variables
5757
*/
58-
static opal_atomic_lock_t class_lock = { { OPAL_ATOMIC_UNLOCKED } };
58+
static opal_atomic_lock_t class_lock = { { OPAL_ATOMIC_LOCK_UNLOCKED } };
5959
static void** classes = NULL;
6060
static int num_classes = 0;
6161
static int max_classes = 0;

opal/include/opal/sys/atomic.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ typedef struct opal_atomic_lock_t opal_atomic_lock_t;
129129
* Enumeration of lock states
130130
*/
131131
enum {
132-
OPAL_ATOMIC_UNLOCKED = 0,
133-
OPAL_ATOMIC_LOCKED = 1
132+
OPAL_ATOMIC_LOCK_UNLOCKED = 0,
133+
OPAL_ATOMIC_LOCK_LOCKED = 1
134134
};
135135

136136
/**********************************************************************
@@ -277,7 +277,7 @@ void opal_atomic_wmb(void);
277277
#if OPAL_HAVE_ATOMIC_SPINLOCKS == 0
278278
static inline
279279
#endif
280-
void opal_atomic_init(opal_atomic_lock_t* lock, int32_t value);
280+
void opal_atomic_lock_init(opal_atomic_lock_t* lock, int32_t value);
281281

282282

283283
/**

opal/include/opal/sys/atomic_impl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static inline int32_t opal_atomic_sub_ptr( volatile void* addr,
401401
* Lock initialization function. It set the lock to UNLOCKED.
402402
*/
403403
static inline void
404-
opal_atomic_init( opal_atomic_lock_t* lock, int32_t value )
404+
opal_atomic_lock_init( opal_atomic_lock_t* lock, int32_t value )
405405
{
406406
lock->u.lock = value;
407407
}
@@ -411,7 +411,7 @@ static inline int
411411
opal_atomic_trylock(opal_atomic_lock_t *lock)
412412
{
413413
int ret = opal_atomic_cmpset_acq_32( &(lock->u.lock),
414-
OPAL_ATOMIC_UNLOCKED, OPAL_ATOMIC_LOCKED);
414+
OPAL_ATOMIC_LOCK_UNLOCKED, OPAL_ATOMIC_LOCK_LOCKED);
415415
return (ret == 0) ? 1 : 0;
416416
}
417417

@@ -420,8 +420,8 @@ static inline void
420420
opal_atomic_lock(opal_atomic_lock_t *lock)
421421
{
422422
while( !opal_atomic_cmpset_acq_32( &(lock->u.lock),
423-
OPAL_ATOMIC_UNLOCKED, OPAL_ATOMIC_LOCKED) ) {
424-
while (lock->u.lock == OPAL_ATOMIC_LOCKED) {
423+
OPAL_ATOMIC_LOCK_UNLOCKED, OPAL_ATOMIC_LOCK_LOCKED) ) {
424+
while (lock->u.lock == OPAL_ATOMIC_LOCK_LOCKED) {
425425
/* spin */ ;
426426
}
427427
}
@@ -432,7 +432,7 @@ static inline void
432432
opal_atomic_unlock(opal_atomic_lock_t *lock)
433433
{
434434
opal_atomic_wmb();
435-
lock->u.lock=OPAL_ATOMIC_UNLOCKED;
435+
lock->u.lock=OPAL_ATOMIC_LOCK_UNLOCKED;
436436
}
437437

438438
#endif /* OPAL_HAVE_ATOMIC_SPINLOCKS */

opal/include/opal/sys/gcc_builtin/atomic.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,16 @@ static inline int opal_atomic_cmpset_128 (volatile opal_int128_t *addr,
186186

187187
#define OPAL_HAVE_ATOMIC_SPINLOCKS 1
188188

189-
static inline void opal_atomic_init (opal_atomic_lock_t* lock, int32_t value)
189+
static inline void opal_atomic_lock_init (opal_atomic_lock_t* lock, int32_t value)
190190
{
191191
lock->u.lock = value;
192192
}
193193

194194
static inline int opal_atomic_trylock(opal_atomic_lock_t *lock)
195195
{
196-
int ret = __atomic_exchange_n (&lock->u.lock, OPAL_ATOMIC_LOCKED,
196+
int ret = __atomic_exchange_n (&lock->u.lock, OPAL_ATOMIC_LOCK_LOCKED,
197197
__ATOMIC_ACQUIRE | __ATOMIC_HLE_ACQUIRE);
198-
if (OPAL_ATOMIC_LOCKED == ret) {
198+
if (OPAL_ATOMIC_LOCK_LOCKED == ret) {
199199
/* abort the transaction */
200200
_mm_pause ();
201201
return 1;
@@ -206,7 +206,7 @@ static inline int opal_atomic_trylock(opal_atomic_lock_t *lock)
206206

207207
static inline void opal_atomic_lock (opal_atomic_lock_t *lock)
208208
{
209-
while (OPAL_ATOMIC_LOCKED == __atomic_exchange_n (&lock->u.lock, OPAL_ATOMIC_LOCKED,
209+
while (OPAL_ATOMIC_LOCK_LOCKED == __atomic_exchange_n (&lock->u.lock, OPAL_ATOMIC_LOCK_LOCKED,
210210
__ATOMIC_ACQUIRE | __ATOMIC_HLE_ACQUIRE)) {
211211
/* abort the transaction */
212212
_mm_pause ();
@@ -215,7 +215,7 @@ static inline void opal_atomic_lock (opal_atomic_lock_t *lock)
215215

216216
static inline void opal_atomic_unlock (opal_atomic_lock_t *lock)
217217
{
218-
__atomic_store_n (&lock->u.lock, OPAL_ATOMIC_UNLOCKED,
218+
__atomic_store_n (&lock->u.lock, OPAL_ATOMIC_LOCK_UNLOCKED,
219219
__ATOMIC_RELEASE | __ATOMIC_HLE_RELEASE);
220220
}
221221

opal/mca/btl/smcuda/btl_smcuda.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ static inline int sm_fifo_init(int fifo_size, mca_mpool_base_module_t *mpool,
269269
fifo->queue = (volatile void **) VIRTUAL2RELATIVE(fifo->queue_recv);
270270

271271
/* initialize the locks */
272-
opal_atomic_init(&(fifo->head_lock), OPAL_ATOMIC_UNLOCKED);
273-
opal_atomic_init(&(fifo->tail_lock), OPAL_ATOMIC_UNLOCKED);
272+
opal_atomic_lock_init(&(fifo->head_lock), OPAL_ATOMIC_LOCK_UNLOCKED);
273+
opal_atomic_lock_init(&(fifo->tail_lock), OPAL_ATOMIC_LOCK_UNLOCKED);
274274
opal_atomic_unlock(&(fifo->head_lock)); /* should be unnecessary */
275275
opal_atomic_unlock(&(fifo->tail_lock)); /* should be unnecessary */
276276

opal/mca/common/sm/common_sm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ attach_and_init(opal_shmem_ds_t *shmem_bufp,
122122
/* initialize some segment information */
123123
size_t mem_offset = map->module_data_addr -
124124
(unsigned char *)map->module_seg;
125-
opal_atomic_init(&map->module_seg->seg_lock, OPAL_ATOMIC_UNLOCKED);
125+
opal_atomic_lock_init(&map->module_seg->seg_lock, OPAL_ATOMIC_LOCK_UNLOCKED);
126126
map->module_seg->seg_inited = 0;
127127
map->module_seg->seg_num_procs_inited = 0;
128128
map->module_seg->seg_offset = mem_offset;

opal/mca/shmem/mmap/shmem_mmap_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
427427
opal_atomic_rmb();
428428

429429
/* init segment lock */
430-
opal_atomic_init(&seg_hdrp->lock, OPAL_ATOMIC_UNLOCKED);
430+
opal_atomic_lock_init(&seg_hdrp->lock, OPAL_ATOMIC_LOCK_UNLOCKED);
431431
/* i was the creator of this segment, so note that fact */
432432
seg_hdrp->cpid = my_pid;
433433

opal/mca/shmem/posix/shmem_posix_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
227227
opal_atomic_rmb();
228228

229229
/* init segment lock */
230-
opal_atomic_init(&seg_hdrp->lock, OPAL_ATOMIC_UNLOCKED);
230+
opal_atomic_lock_init(&seg_hdrp->lock, OPAL_ATOMIC_LOCK_UNLOCKED);
231231
/* i was the creator of this segment, so note that fact */
232232
seg_hdrp->cpid = my_pid;
233233

opal/mca/shmem/sysv/shmem_sysv_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
232232
opal_atomic_rmb();
233233

234234
/* init segment lock */
235-
opal_atomic_init(&seg_hdrp->lock, OPAL_ATOMIC_UNLOCKED);
235+
opal_atomic_lock_init(&seg_hdrp->lock, OPAL_ATOMIC_LOCK_UNLOCKED);
236236
/* i was the creator of this segment, so note that fact */
237237
seg_hdrp->cpid = my_pid;
238238

0 commit comments

Comments
 (0)