Dear list,

I have a conceptual trouble with atomics (admittedly principally related to
c++11),
however i would be curious on how this issues are solved within HPX.

let's imagine i have a vector

std::vector<double> a(100, 0,0)

which i specifically want to be of "doubles". I DO NOT want to make it

std::vector< std::atomic<double> >

i now wish to update atomically a value of the vector, to do something
equivalent to

#pragma omp atomic
a[50] += 1.0

as i understand c++11 does not allow me to do

reinterpret_cast<std::atomic<double> >(a[50]) += 1.0

or as a very minimum the standard does not ensure me that the code will
work portably.

how could i do this effectively using hpx?

regards
Riccardo
-- 


*Riccardo Rossi*

PhD, Civil Engineer


member of the Kratos Team: www.cimne.com/kratos

Tenure Track Lecturer at Universitat Politècnica de Catalunya,
BarcelonaTech (UPC)

Full Research Professor at International Center for Numerical Methods in
Engineering (CIMNE)


C/ Gran Capità, s/n, Campus Nord UPC, Ed. C1, Despatx C9

08034 – Barcelona – Spain – www.cimne.com  -

T.(+34) 93 401 56 96 skype: *rougered4*



<http://www.cimne.com/>

<https://www.facebook.com/cimne> <http://blog.cimne.com/>
<http://vimeo.com/cimne> <http://www.youtube.com/user/CIMNEvideos>
<http://www.linkedin.com/company/cimne> <https://twitter.com/cimne>

Les dades personals contingudes en aquest missatge són tractades amb la
finalitat de mantenir el contacte professional entre CIMNE i voste. Podra
exercir els drets d'accés, rectificació, cancel·lació i oposició,
dirigint-se a [email protected]. La utilització de la seva adreça de
correu electronic per part de CIMNE queda subjecte a les disposicions de la
Llei 34/2002, de Serveis de la Societat de la Informació i el Comerç
Electronic.

 Imprimiu aquest missatge, només si és estrictament necessari.
<http://www.cimne.com/>
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

Reply via email to