Q: Error compiling 'ssm' channel in MPICH2 w/ PGI 6.0?

Hi Mat,

I’ll cross-post this to the MPICH2 people, but chances are I’m just missing something simple - I’m trying to compile MPICH2-1.0.2 with PGI 6.0-4, and everything works fine when I use the ‘shm’ [shared memory] channel. However, switching to ‘ssm’ for shared memory on dual processor nodes, the compiler dies very early and leaves me the following message:

PGC-F-0249-#error – *** No atomic memory operation specified to implement busy locks *** (./mpidu_process_locks.h: 234)
PGC/x86-64 Linux/x86-64 6.0-4: compilation aborted

This error comes up due to some code in the file mentioned in the error above - basically, it has some assembler code which is compiled when a #define is true for having GCC. This assembler code is as follows:

static inline char
attribute ((unused))
compare_and_swap (volatile long int *p, long int oldval, long int newval)
char ret;
long int readval;

asm volatile (“lock; cmpxchgq %3, %1; sete %0”
: “=q” (ret), “=m” (*p), “=a” (readval)
: “r” (newval), “m” (*p), “a” (oldval) : “memory”);
return ret;

I don’t know much about how PGI handles in-line assembler, but I briefly tried compiling this section with pgcc -c -Masmkeyword, and it failed, so I deleted the double-underscores surrounding ‘asm’ and ‘volatile’ and tried again, but still no luck:

“Recovery attempted by replacing asm by keyword gasm”

Any ideas how I can compile this while keeping it in a .c source file?

Thanks very much,

  • Brian

Hi Brian,

Unfortunately, pgcc doesn’t yet support extended asm statements. The good news is that we are working on adding this. We don’t have a firm timeline when this work will be completed but expect it sometime in the next few releases. In the meantime, you’ll need to compile this file with gcc.