Hello,

I am looking at the Chapel tasking-runtime source code.

Each tasking model typedefs “chpl_taskID_t” to its own ID type and  
chpl_task_getId() has a return type of chpl_taskID_t
The introduction of chpl_taskID_t might be to support multiple low-level 
runtimes.

But in runtime/include/qio/qio.h:212 , Inside struct qio_lock_t , task owner’s 
ID is of type int64_t 
Later in runtime/src/qio/qio.c , inside functions qio_lock() and qio_unlock(), 
task IDs are stored int64_t variables.
and also compared using binary operators (== , !=) in  
runtime/src/qio/qio.c:103 and 122.

This causes type conversion errors if the underlying tasking model is using 
some ID type that is not compatible with integer.
The qio files should also use chpl_taskID_t instead if int64_t.
Also binary operators are not applicable to all types and therefore it will be 
better if each tasking model provides an isEqual() api for its ID type.

We tried this change and noticed that the runtime/src/chpl-visual-debug.c 
type-casts chpl_taskID_t to some integer type while doing printf(). 
Again this causes problem for types not compatible with integers.  
So either a custom format specifier for ID should be made or easier option is 
to provide a chpl_taskID_t_to_integer() by each tasking model.
Just for testing, the address of  chpl_taskID_t can be type casted to an 
integer pointer and then dereferenced, but this will cause loss of information.

Thank you
Sriraj


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to