You are using the -prefix option. I guess this is due to the fact that You
cannot set the paths appropriately. Most likely You are using rsh for
starting remote processes.
This causes some trouble since the environment offered by rsh lacks many
things that a usual login environment offers (e.g. the path is hardcoded
and cannot be changed).
mpirun -np 2 -prefix /usr/local /bin/bash -c ulimit -l
may result in reporting plenty of memory (according to Your settings) but
this is not reliable since the new bash instance sets the limits
mpirun -np 2 -prefix /usr/local ulimit -l
does not work, since mpirun expects an executable. So the only way to
check is to run rsh directly like
rsh remotenode ulimit -l
(where remotenode has to be replaced by the name of the remote host). This
may give a different result (e.g. 32 which is way too small). In my case
this problem was solved by adding
session required pam_limits.so
at the end of the file "/etc/pam.d/rsh".
In case of ssh check the file "/etc/pam.d/ssh" for a line similar to the
one above and add it if it does not yet exist.
Hope that helps,