Hi,
by default PMI does not allow duplicate keys, if duplicate key is
found its value is overwritten, so the default behaviour of the code is
correct. The variable name needs to change to SLURM_PMI_KVS_ALLOW_DUP_KEYS.
On 02/11/2014 10:37 PM, Artem Polyakov wrote:
Hello, all.
I have a question about SLURM's libpmi. I am currently adopting DMTCP
project (checkpointer) to support SLURM. Currently I am working on PMI
support. And looking into _kvs_put function I have the following question:
for (i=0; i<kvs_rec_cnt; i++) {
if (strncmp(kvs_recs[i].kvs_name, kvsname, PMI_MAX_KVSNAME_LEN))
continue;
*if (pmi_kvs_no_dup_keys) { // Shouldn't we chenge it to **if
(!pmi_kvs_no_dup_keys) *
j = kvs_recs[i].kvs_cnt;
goto no_dup;
}
/* search for duplicate key */
for (j=0; j<kvs_recs[i].kvs_cnt; j++) {
if (strncmp(kvs_recs[i].kvs_keys[j], key,
PMI_MAX_KEY_LEN))
continue;
...
goto fini;
}
no_dup:
/* create new key */
kvs_recs[i].kvs_cnt++;
kvs_recs[i].kvs_key_states = realloc(kvs_recs[i].kvs_key_states,
...
goto fini;
}
In current logic (if I understand everything correctly) if
pmi_kvs_no_dup_keys is enabled we go to no_dup and create new key and do
not check this key existence. Otherwise it will search for a duplicated
key and rewrite it.
Sorry if this is my misunderstanding of the code.
--
С Уважением, Поляков Артем Юрьевич
Best regards, Artem Y. Polyakov
--
Thanks,
/David/Bigagli
www.schedmd.com