
                   Finding users of particular modules
                   -----------------------------------
                              R. T. McLay

                      v1.2 (modified 6 Jun 2013)

Here are the steps required to produce the list of users that have
used particular modules.

1. Login as root to the machine of interest.

2. Remember that root has no modules loaded by default (in fact root will
   not even recognize the module command).  Remedy this by executing...

      $ . ~/sourceme

   ...or the equivalent (note the need to source this file).

3. You need access to the lower level lmod utilities.  Do:

      $ module load lmod

   if this doesn't work then do:

      $ export PATH=/opt/apps/lmod/lmod/libexec:$PATH


4. On Stampede go to /home1/moduleData/moduleUsage.
   On Lonestar go to /home1/tacc_admin/moduleUsage.
   On Maverick go to /home/moduleData/moduleUsage.

5. To generate a new list of modules do

      $ spider -o list $LMOD_DEFAULT_MODULEPATH > modules.list

         NOTE: you run "spider" here, not "module spider"

6. Run grep on modules.list to get the absolute path of the modules
   you are interested in.  As an example suppose you want to find the
   list of users still using petsc 2.3.3 as well as slepc 2.3.3 etc.

      $ grep 2.3.3 modules.list > petsc_2.3.3.list


7. Run "reportUsers" to find out what modules are being used.

      $ reportUsers -f petsc_2.3.3.list --m2u=petsc.m2u --u2m=petsc.u2m *.csv

   This command will take several minutes.  When it is done there will
   be two files: petsc.m2u which lists the particular module and the
   users of that module; and petsc.u2m which lists users and the
   particular modules they used.

8. If you just wish to know the number of loads of particular modules and not
   which users, execute the following:

      $ processModuleUsage -f modules.list *.csv > ModulesUsed.txt



-------------------------------------------------------

Revision History
****************

19 Sep 2012 -- miscellaneous corrections based on djames' experience with the tool

6 Jun 2013 -- minor updates reflecting tests on Stampede


