title: /usr/bin/modulecmd: No such file or directory
body: <p>I'm using sbatch to submit my job.<br>
  Command line <code>mpirun --version</code> gives:</p>
  
  <blockquote>
    <p>Intel(R) MPI library for Linux* OS, Version 5.0 Build 20140507<br>
    Copyright (C) 2003-2014, Intel Corporation. All rights reserved.  </p>
  </blockquote>
  
  <p>So I think I'm working with Intel mpi.<br>
  Following the <a href="https://www.glue.umd.edu/hpcc/help/examples-submission.html" rel="nofollow noreferrer">instructions: submitting an MPI job using Intel MPI</a>, I write my script like this:</p>
  
  <pre><code>#!/bin/bash
  #SBATCH --ntask=4
  #SBATCH -t 00:10:00
  
  . ~/.bash_profile
  
  module load intel
  mpirun mycc
  </code></pre>
  
  <p>mycc is the executable I get after compiling source files with mpicc.<br>
  Then I use command <code>sbatch -p partitionname -J myjob script.sh</code>, my job failed with exitcode 127:0. The slurm-jobid.out file says that(leave aside the set locale warning):  </p>
  
  <blockquote>
    <p>/usr/share/Modules/init/sh: line 2: /usr/bin/modulecmd: No such file or directory
    /tmp/slurmd/job252624/slurm_scirpt: line 10: mpirun: command not found</p>
  </blockquote>
  
  <p>But I have checked and /usr/bin/modulecmd file does exist.<br>
  Any suggestion is aprreciated.</p>
  
  <p><strong>Edit</strong><br>
  I also asked the question <a href="https://superuser.com/questions/1016692/usr-bin-modulecmd-no-such-file-or-directory">here</a>.</p>
  
  <p>I have removed the source statement and module load one.<br>
   I tried to load the module on the log in node before submitting my job. But there is something wrong. It says that:   </p>
  
  <blockquote>
    <p>moduleCmd_Lad.c(204): Error: 105: Unable to locate a modulefile for 'intel'  </p>
  </blockquote>
  
  <p>I use <code>module avail</code> command to see what modules are available:</p>
  
  <blockquote>
    <p>---------/usr/share/Modules/modulefiles-------------------</p>
    
    <p>dot         module-info    mpich2-x86_64 use.won</p>
    
    <p>module-cvs  modules        null</p>
    
    <p>---------/etc/modulefiles---------------------------------</p>
    
    <p>compat-openmpi-psm-x86_64 compat-openmpi-x86_64</p>
  </blockquote>
  
  <p>Forgive me for the messy formatting.</p>
  
  <p><strong>Solved</strong>  </p>
  
  <p>The problem is finally solved. My final script.sh is like this:  </p>
  
  <pre><code>#!/bin/bash
  srun -p partitionname -n 4 -t 00:10:00 mycc
  </code></pre>
  
  <p>Then use command <code>sbatch -p partitionname -J myjob script.sh</code> to submit the job.</p>