Problem mpirun from bash script, when it run as crontab

Introduction to the forum

Problem mpirun from bash script, when it run as crontab

Postby shahadat » Thu Feb 11, 2016 6:33 am

Hello,

I'm having problems on calling "mpirun" from inside a bash script when it run in crontab at time schedule. But when i write simply "./scriptName" in terminal then mpirun run smoothly ....

Code: Select all
    #!/bin/bash
    cd /root/Build_WRF/WRFV3/run
    rm -rf met_em.d01.2016*
    ln -s /root/Build_WRF/WPS/met_em.d01.2016* .
    mpirun -np 8 ./real.exe
    mpirun -np 8 ./wrf.exe


other command work perfectly but problem in mpirun and crontab give mail in this locaton "/var/spool/mail/root"
and it is /usr/bin/wrf182: line 5: mpirun: command not found

what will i do now...

Shahadat, Bangldesh
Last edited by shahadat on Sun Feb 14, 2016 12:19 am, edited 1 time in total.
shahadat
 
Posts: 9
Joined: Mon Feb 04, 2013 6:00 am

Re: Problem mpirun from bash script, when it run as crontab

Postby Phillip » Fri Feb 12, 2016 11:35 am

Have you tried using the full path of the executable? You can get it using
Code: Select all
which mpirun
Phillip
 
Posts: 46
Joined: Thu Jul 19, 2012 3:29 am

Re: Problem mpirun from bash script, when it run as crontab

Postby shahadat » Sun Feb 14, 2016 12:18 am

hi, Phillip

Thanks a lot.... i have done it as following your guideline...

Shahadat
shahadat
 
Posts: 9
Joined: Mon Feb 04, 2013 6:00 am

Re: Problem mpirun from bash script, when it run as crontab

Postby alainaketh » Wed Aug 02, 2017 1:28 pm

Hi,

The command which only gives you the path to the specified command, so if mpirun is not installed, the output of "which mpirun" is something like "/usr/bin/which: no mpirun in (/home//NCL/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)".

To solve the problem, you need to load the correspondent module.

Type

Code: Select all
module avail


to see a list of modules that you can load. In my case I see something like

-------------------------------- /etc/modulefiles --------------------------------
mpi/compat-openmpi16-x86_64 mpi/mvapich2-2.2-psm-x86_64
mpi/mpich-3.0-x86_64 mpi/mvapich2-2.2-x86_64
mpi/mpich-3.2-x86_64 mpi/mvapich2-psm-x86_64
mpi/mpich-x86_64 mpi/mvapich2-x86_64
mpi/mvapich2-2.0-psm-x86_64 mpi/openmpi-x86_64
mpi/mvapich2-2.0-x86_64

The needed module is openmpi_x86-64 so type

Code: Select all
module load mpi/openmpi_x86-64


And that should do.
"
Hydrology Researcher, University of Bristol
alainaketh
 
Posts: 34
Joined: Fri Jun 26, 2015 12:30 pm


Return to Welcome to the WRF User's Forum

Who is online

Users browsing this forum: No registered users and 4 guests