• Skip to Main Content
  • Go to the Website's Home
  • Go to Website News
  • Go to About this site
  • Skip to Audience Navigation Menu
  • About
    • Welcome to the College
    • Facts and Figures
    • Message from the Dean
    • Visit Us
    • College Administration
    • News Center
  • Research
    • Research Home
    • Departments
    • Centers & Labs
    • Faculty Directory
    • Opportunities for Undergraduates
  • Admissions
    • Undergraduate Admissions
    • Undergraduate Recruiting
    • Graduate Admissions
  • Academics
    • Departments
    • Undergraduate Programs and Degrees
    • Graduate Programs and Degrees
    • Course Guide/Bulletin
    • Teaching
    • Support Services
  • Departments
    • Aerospace Engineering
    • Atmospheric, Oceanic and Space Sciences
    • Biomedical Engineering
    • Chemical Engineering
    • Civil and Environmental Engineering
    • Electrical Engineering and Computer Science
    • Industrial and Operations Engineering
    • Interdisciplinary Professional Programs
    • Materials Science and Engineering
    • Mechanical Engineering
    • Naval Architecture and Marine Engineering
    • Nuclear Engineering and Radiological Sciences
  • Support the College
    • Giving
    • Involve Yourself
    • Corporate Relationships
  •   

College of Engineering

Center for Advanced Computing

  • Welcome
  • About
  • Getting Started
    • Getting Started
    • Learning About HPC
    • CAC Training Courses
  • Resources
    • Resources
    • Systems
    • Software
    • Storage
    • Networking
    • Visualization
    • Teragrid
  • Academics
  • Contact Us
  • Frequently Asked Questions
Follow Us On Twitter

Contact Information

[Contact] Center for Advanced Computing
College of Engineering
cac-support@umich.edu Link

Center for Advanced Computing  /  Resources  /  Software  /  Private Module Example

Private Module Example

The modules package allows you to pick which software packages and version you wish to use. It has the advanatages in easily handling PATH, MANPATH and other important variables for you as well as making rolling out new version a much simplier process. 

Users can make their own module files, privatemodules must go in
/home/username/privatemodules/

There is a structure to the layout of the privatemodules folder. Normally a software package, is given a folder inside privatemodules and the individual modulefiles are given versions as names.

Example privatemodules Folder

In this case a folder openmpi/ has two files, 1.2.5-intel 1.3.2-gcc representing two versions of the same module.

openmpi/1.2.5-intel
openmpi/1.3.2-gcc

Example module file

Read each line of the example carefully, the first line (#%Module1.0) is required to work, 

#%Module1.0#####################################################################
##
## modules modulefile
##
#this is a comment, white space is allowed
#output on module help modulefile
proc ModulesHelp { } {
global version modroot

    puts stderr "\tOpenMPI- loads the MPI compiler environment"
    puts stderr "\tThe MPI environment is OpenMPI"
    puts stderr "\n\tThis adds $modroot/* to several of the"
    puts stderr "\tenvironment variables."
    puts stderr "\n\tVersion $version\n"
}

#outputs on module whatis
module-whatis "loads the OpenMPI/INTEL compiler environment"
module-whatis "Vendor Website: http://www.open-mpi.org/"


# for module file internal use only refer to value in script with $varname
set modroot /home/software/rhel5/openmpi-1.2.3/intel-5.1

#environment variables to set/add to.
#sets MPI_HOME to value $modroot
setenv MPI_HOME $modroot

#appends to PATH
append-path PATH $modroot/bin
append-path LD_LIBRARY_PATH $modroot/lib
append-path LD_LIBRARY_PATH $modroot/lib/openmpi

#modules that can not be loaded conflict openmpi lam mpich

#prereq for modules that must be loaded before this module
prereq nag/7

#when module loaded
if { [ module-info mode load ] } {
    #messages to users on load
    #puts stderr "message to users on load\n"
}
CSS 2.1 Valid
University of Michigan
  • Home
  • Contact Us
  • Site Map
  • Site Feedback
  • Accessibility
  • Emergency Procedures
  • Jump to top of the page
© 2009 College of Engineering, University of Michigan