in reply to Re: How can I convert my script for submitting SLURM jobs from Bash to Perl?
in thread How can I convert my script for submitting SLURM jobs from Bash to Perl?

Thanks for your reply. Yes. I am talking about SLURM. I tried your first code (completely perl ones). It gives the following error: Can't exec "gaussian": No such file or directory at.... resp.com is only one job for run on cluster. I have about 1000 jobs. So I have to convert it to perl script.
  • Comment on Re^2: How can I convert my script for submitting SLURM jobs from Bash to Perl?

Replies are listed 'Best First'.
Re^3: How can I convert my script for submitting SLURM jobs from Bash to Perl?
by RonW (Parson) on Feb 19, 2015 at 20:17 UTC

    I think the first script needs to be:

    #!/usr/bin/perl #SBATCH -A 1234 #SBATCH -t 2-00:00 #SBATCH -n 24 use warnings; use strict; system("module add gromacs && srun resp.com")==0 or warn "Warning: command failed, code $?";

    module add gromacs is likely modifying the "local" runtime environment as MidLifeXis explained in his post, above.

Re^3: How can I convert my script for submitting SLURM jobs from Bash to Perl?
by Anonymous Monk on Feb 18, 2015 at 22:53 UTC

    Sorry, but I don't see how the script shown can produce that error message; perhaps you modified it, in that case you need to post the full code, or, the error message is actually coming from one of the two executed commands, in which case that needs to be debugged...

    I'm not sure how many monks here might already have experience with SLURM, gromacs, et al, but if it's only a few, the rest of us will need all the information you can provide so that we can help you best. To that effect, it would be good if you could read I know what I mean. Why don't you? and How do I post a question effectively?

      I run the following code:
      #!/usr/bin/perl #SBATCH -A 1234 #SBATCH -t 2-00:00 #SBATCH -n 24 use warnings; use strict; system("module add gaussian"); system("srun resp.com")
      It gave this error: Can't exec "gaussian": No such file or directory at...
        It gave this error: Can't exec "gaussian": No such file or directory at...

        Please give exact error messages, you've cut off the most important part: where the error occurs! That's the code you need to be debugging, and that's the code we need to see to be able to help you with it. Again, How do I post a question effectively?

        AFAIK the module command typically modifies the environment, which isn't shared between system calls. Try system("module add gaussian && srun resp.com");.