Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-13-2009, 08:20 AM
|
#1
|
|
LQ Newbie
Registered: Oct 2009
Posts: 4
Rep:
|
script executing-problem ("module: command not found")
Hello everyone.
I'm trying to execute a script on a cluster (connected via ssh), because I have to load gcc and mpich2 to all the machines before I execute my parallel program on them (it is shared memory), so, to cut the long story short, my script looks like:
#!/bin/bash
module load gcc
module unload mpi.parastation
module load mpi.mpich2/1.0.5
however, on the execution it prints the message:
module: command not found
If I try to execute something "stupid" in the same script, like:
echo "blah blah",
it does print blah blah indeed!
Does anyone have a clue what the problem might be? Some prefixes to module-command? Thanks in advance.
|
|
|
|
10-13-2009, 11:03 AM
|
#2
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,367
|
Is the module command installed on the remote system? If so then it is not in the directories listed in $PATH and you can either modify $PATH to include the directory containing the module executable or you can give the full path to the module executable instead of its name alone.
|
|
|
|
10-13-2009, 11:04 AM
|
#3
|
|
Senior Member
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,115
Rep: 
|
I think this will help (from https://subtrac.sara.nl/userdoc/wiki/shared/modules):
Quote:
Modules and shells
The module command is shell-independent, but the implementation is shell-dependent:
* bash: module is an exported shell function
* csh/tcsh: module is an alias
* ksh: module is a shell function
Th system-wide initialization scripts take care that the module environment is properly initiated at the start of a job or interactive session, using the method for your login shell. Problems arise when:
* the shell that is used in a job is not the login shell
* a subshell is created to the same shell (only for non-bash shells)
* a subshell is created to another shell
In these cases, it is necessary to define the modules environment :
* bash:
. /usr/share/modules/init/bash
* csh/tcsh:
source /usr/share/modules/init/csh
* ksh:
. /usr/share/modules/init/ksh
We recommend to use bash as login shell and as shell in jobs.
|
Dobrodosla na linuxquestions.org forume 
|
|
|
|
10-14-2009, 03:22 AM
|
#4
|
|
LQ Newbie
Registered: Oct 2009
Posts: 4
Original Poster
Rep:
|
Thanks both of you!
@catkin:
The thing is that when I run these "module load" commands from the console, it works, so yes, it should be installed on the machines.
When I type:
whereis -b module, it prints just
module:
Isn't this strange? How can I now the path to the module executable? am I doing something wrong? :)
@DrLove73:
(Hvala, hvala :))
"In these cases, it is necessary to define the modules environment :
* bash:
. /usr/share/modules/init/bash
* csh/tcsh:
source /usr/share/modules/init/csh
* ksh:
. /usr/share/modules/init/ksh"
What does this exactly mean? I'm not very selfconfident at the moment :)
|
|
|
|
10-14-2009, 04:29 AM
|
#5
|
|
Senior Member
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,115
Rep: 
|
I never needed modules so my knowledge is very very limited  I just used intelligent google searching for above.
I also found this tutorial : http://modules.sourceforge.net/docs/...tney_paper.pdf
and http://www-theor.ch.cam.ac.uk/IT/software/modules.html
but this should be more helpful: http://www.uni-koeln.de/rrzk/server/...n/modules.html :
Quote:
Modules in Batch-Scripts
Before loading modules in batch scripts, the module-environment has to be set up by sourcing files that include the module-environment into the shell. These files are:
* /etc/profile.d/modules.sh
for the shells bash and sh and similar ones and
* /etc/profile.d/modules.csh
for csh and tcsh .
For running software available as module, the module has to be loaded in the batch-script. For running software compiled with library-modules in batch scripts, again first load the compiler module that was used on compilation, then load the library.
|
|
|
|
|
10-14-2009, 08:25 AM
|
#6
|
|
LQ Newbie
Registered: Oct 2009
Posts: 4
Original Poster
Rep:
|
Yeap, thanks a lot!!! :)
Sourcing /etc/profile.d/modules.sh in the script solved the problem
"module : command not found"
So it seems to load gcc & mpich on "my" machines.
However, I don't see that I have achieved anything with this, since it gives Segmentation fault immediately and I don't think it was due to my code, but this is another subject. :)
Thanks again!
|
|
|
|
10-14-2009, 12:47 PM
|
#7
|
|
Senior Member
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,115
Rep: 
|
Any time. I have my contact info in my profile, if something get's urgent.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:14 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|