[gmx-users] disable ulimit

Gustavo Fioravanti gusfioravanti at yahoo.com.br
Wed Jul 1 21:21:16 CEST 2009

Thanks Ansgar
We'll try it.

Dr Gustavo Fioravanti Vieira 
Núcleo de Bioinformática do Laboratório de Imunogenética       
Bolsista PNPD do Programa de Pós-Graduação em Genética e Biologia Molecular

--- Em seg, 29/6/09, Ansgar Esztermann <aeszter at gwdg.de> escreveu:

De: Ansgar Esztermann <aeszter at gwdg.de>
Assunto: Re: [gmx-users] disable ulimit
Para: "Discussion list for GROMACS users" <gmx-users at gromacs.org>
Data: Segunda-feira, 29 de Junho de 2009, 12:58

Hi Gustavo,

On Jun 24, 2009, at 20:48 , Gustavo Fioravanti wrote:

> we are trying to run mdrun_mpi in a public cluster of our university. However, we got the following error:
> /etc/profile.d/limits.sh: line 1: ulimit: max locked memory: cannot modify limit: Operation not permitted

There are two kinds of ulimits, soft and hard. Hard limits cannot be increased, so maybe you try to exceed a hard limit here?

> /var/tmp/sge_local_spool/r01n19/job_scripts/3051: line 10: grompp_mpi: command not found
> The cluster has already settled to unlimited access to memory. However, grompp hasn't have permission to modify this file (limits.sh).

I do not think grompp tries to modify the file. The error message above seems to point at limits.sh not being allowed to raise the limit. Did you talk to your sysadmin? They should be able to raise the limit. BTW, note that the limit in question here is not memory per se, but locked memory.
> I would like to disable the ulimit function at source file from GROMACS. How can I do that?

Try to do it from a script (or by hand) before starting gromacs, like so:
ulimit -l unlimited

Modifying the limit from the program is also possible, but a little bit more involved (this code should work on Linux; on other systems, things might be a bit different):

#include <sys/resource.h>

struct rlimit unlim = {RLIM_INFINITY, RLIM_INFINITY};
int err = setrlimit(RLIMIT_MEMLOCK, &unlim);

/* error handling skeleton; based on the error message given above, you will probably get EPERM */
if (err)
  switch (errno)
    case EFAULT: /* limit points outside address range */

    case EINVAL: /* invalid resource, or soft > hard */

    case EPERM: /* unprivileged process tried to raise hard limit */


--Ansgar Esztermann
Max-Planck-Institut für biophysikalische Chemie, Abteilung 105

gmx-users mailing list    gmx-users at gromacs.org
Please search the archive at http://www.gromacs.org/search before posting!
Please don't post (un)subscribe requests to the list. Use the
www interface or send it to gmx-users-request at gromacs.org.
Can't post? Read http://www.gromacs.org/mailing_lists/users.php

Veja quais são os assuntos do momento no Yahoo! +Buscados
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20090701/c5eb2a6c/attachment.html>

More information about the gromacs.org_gmx-users mailing list