Hi,

I get a deadlock when using the shmem_collect32() routine and any of the non-root PEs pass 0 as the number of elements. It looks like the algorithm in _algorithm_central_collector() does use 0 as a special value, and thus does not break out of the loop. This is observable with 1.8 and current trunk r31639. A small testcase is attached.

Btw, I'm pretty confident, that this Open SHMEM implementation does not recognize global or static variables in shared libraries as symmetric objects. It is probably wise to note this somewhere to the users.

Kind regards,
Bert Wesarg

#include <shmem.h>

int
main(int ac, char *av[])
{
    int *src, *dest;
    long *psync;

    start_pes(0);
    int pes = _num_pes();
    int me = _my_pe();

    src = shmalloc(pes * sizeof(*src));
    for (int pe = 0; pe < pes; ++pe)
        src[pe] = me;
    dest = shmalloc(pes * sizeof(*dest));
    psync = shmalloc(_SHMEM_COLLECT_SYNC_SIZE * sizeof(*psync));
    for (int i = 0; i < _SHMEM_COLLECT_SYNC_SIZE; ++i)
        psync[i] = _SHMEM_SYNC_VALUE;
    shmem_barrier_all();

    shmem_collect32(dest,
                    src,
                    me == 0 ? 1 : 0,
                    0, 0, pes,
                    psync);

    shfree(src);
    shfree(dest);
    shfree(psync);

    return 0;
}

--
Dipl.-Inf. Bert Wesarg
wiss. Mitarbeiter

Technische Universität Dresden
Zentrum für Informationsdienste und Hochleistungsrechnen (ZIH)
01062 Dresden
Tel.: +49 (351) 463-42451
Fax: +49 (351) 463-37773
E-Mail: bert.wes...@tu-dresden.de

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to