Shared memory programming on distributed memory systems