Openmp Atomic Assignment Satisfaction

Interference aware channel assignment for structured wireless sensor networks

Authors: E. JamhourUniversity of Parana, Curitiba, Brazil
M. E. PellenzUniversity of Parana, Curitiba, Brazil
M. C. PennaUniversity of Parana, Curitiba, Brazil
R. D. SouzaUniversity of Parana, Curitiba, Brazil
G. BranteUniversity of Parana, Curitiba, Brazil
2015 Article
· Citation Count: 0
· Downloads (cumulative): 38
· Downloads (12 Months): 11
· Downloads (6 Weeks): 1

Published in:

· Proceeding
SAC '15 Proceedings of the 30th Annual ACM Symposium on Applied Computing
Pages 716-719

Salamanca, Spain — April 13 - 17, 2015
ACMNew York, NY, USA ©2015
table of contents ISBN: 978-1-4503-3196-8 doi>10.1145/2695664.2695977

dependable and fault-tolerant systems and networksdesignexperimentationmeasurementmobile networksnetwork performance evaluationperformanceperformancesignal processing systemswireless access networks

Powered by

The ACM Digital Library is published by the Association for Computing Machinery. Copyright © 2018 ACM, Inc.
Terms of Usage   Privacy Policy   Code of Ethics   Contact Us

Use OpenMP atomic operations to allow multiple threads to safely update a shared numeric variable, such as on hardware platforms that support atomic operation use. An atomic operation applies only to the single assignment statement that immediately follows it, so atomic operations are useful for code that requires fine-grain synchronization.

Before the statement to be protected, use:

  • for C/C++.

  • for Fortran.

For example, consider this annotated C/C++ serial code:

int count; void Tick() { ANNOTATE_LOCK_ACQUIRE(0); count = count+1; ANNOTATE_LOCK_RELEASE(0); } . . .

The parallel C/C++ code after adding and :

#include <omp.h> //prevents a load-time problem with a .dll not being found int count; void Tick() { // Replace lock annotations #pragma omp atomic count = count+1; } . . .

Consider this annotated Fortran serial code:

program ABC integer(kind=4) :: count = 0 . . . contains subroutine Tick call annotate_lock_acquire(0) count = count + 1 call annotate_lock_release(0) end subroutine Tick . . . end program ABC

The parallel Fortran code after adding and the directive:

program ABC use omp_lib integer(kind=4) :: count = 0 . . . contains subroutine Tick !$omp atomic count = count + 1 end subroutine Tick . . . end program ABC

The Intel Advisor Fortran sample nqueens.f90 demonstrates the use of an atomic operation.

This topic introduces basic OpenMP atomic operations. For advanced atomic operations that use clauses after the construct, see Advanced OpenMP Atomic Operations.

0 Thoughts to “Openmp Atomic Assignment Satisfaction

Leave a comment

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *