Ok. That is clear now. Thank you, Hongjia.
2014-02-19 15:11 GMT+07:00 Hongjia Cao <[email protected]>: > > I introduced SLURM_PMI_KVS_NO_DUP_KEYS to improve performance of the > SLURM PMI implementation. As a "key", the key in KVS is unique, which > means if duplicate key is found the value will be replaced. The default > implementation checks for duplicate keys and replace the value. If no > duplicate key exists, the key/value will be appended. > > In MPI implementations, there will be no duplicate keys put into the KVS > usually. Hence the checking for duplicate keys can be skipped. That's > the motivation of the environment SLURM_PMI_KVS_NO_DUP_KEYS: for MPI to > tell PMI that there will be no duplicate keys at all. > > 在 2014-02-14五的 11:14 -0800,David Bigagli写道: > > 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 > > > > -- С Уважением, Поляков Артем Юрьевич Best regards, Artem Y. Polyakov
