openshmem-org / specification

OpenSHMEM Application Programming Interface
http://www.openshmem.org
49 stars 32 forks source link

Understanding shmem_malloc_with_hints usage semantics #444

Open naveen-rn opened 4 years ago

naveen-rn commented 4 years ago

As per the 1.5 spec, it looks like the majority of the operations performed on the address buffer allocated with a particular in shmem_malloc_with_hints should follow the hints used. I understand that not using the buffer for any other type of operation is kind of breaking the contract initially created by the user application. But, how does the implementation react to this usage model?

Say, I create

void *ptr = shmem_malloc_with_hints(SIZE, SHMEM_MALLOC_ATOMICS_REMOTE);

for (i -> n)
   shmem_atomics_inc(ptr, ....);

// do something else

for (i -> n)
   shmem_int_put_signal(....., ptr);

How should the implement react to the signaling operation which uses the SDO created using the atomics hint? Fail? Process to success, but performance can vary?

jdinan commented 4 years ago

My understanding is that buffers returned by shmem_malloc_with_hints are valid for all OpenSHMEM operations (with the possible exception of shmem_ptr).

manjugv commented 4 years ago

@naveen-rn Yes, it would succeed, but performance might not be as expected.

manjugv commented 3 years ago

@naveen-rn Can I close this?