Hi Nathan

Could you tell us which version of the code you are using, and print out the
rc value that was returned by the "get" call? I see nothing obviously wrong
with the code, but much depends on what happened prior to this call too.

BTW: you might want to release the memory stored in the returned values - it
could represent a substantial memory leak.


On 7/5/06 9:28 AM, "Nathan DeBardeleben" <ndeb...@lanl.gov> wrote:

> I used to use this code to get the number of nodes in a cluster /
> machine / whatever:
>> int
>> get_num_nodes(void)
>> {
>>     int rc;
>>     size_t cnt;
>>     orte_gpr_value_t **values;
>>     rc = orte_gpr.get(ORTE_GPR_KEYS_OR|ORTE_GPR_TOKENS_OR,
>>                         ORTE_NODE_SEGMENT, NULL, NULL, &cnt, &values);
>>     if(rc != ORTE_SUCCESS) {
>>         return 0;
>>     }
>>     return cnt;
>> }
> This now returns '0' on my MAC when it used to return 1.  Is this not an
> acceptable way of doing this?  Is there a cleaner / better way these days?

Reply via email to