Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 183169 - sci-chemistry/gromacs-3.3.1-r1.ebuild ignores the mpi USE
Summary: sci-chemistry/gromacs-3.3.1-r1.ebuild ignores the mpi USE
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Chemistry-Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-25 16:26 UTC by Joseph Spadavecchia
Modified: 2007-06-25 20:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
gromacs-3.3.1-r1.ebuild (mpi default when mpi USE flag set) (gromacs-3.3.1-r1.ebuild,5.75 KB, text/plain)
2007-06-25 19:02 UTC, Joseph Spadavecchia
Details
gromacs-3.3.1-r1.ebuild.patch (mpi default with mpi USE flag) (gromacs-3.3.1-r1.ebuild.patch,7.22 KB, patch)
2007-06-25 19:03 UTC, Joseph Spadavecchia
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Spadavecchia 2007-06-25 16:26:28 UTC
The gromacs-3.3.1-r1.ebuild ignores the mpi USE variable.  Actually, this ebuild is a complete mess.

Reproducible: Always

Steps to Reproduce:
1. set mpi USE variable
2. emerge gromacs (3.3.1-r1)

Actual Results:  
configures gromacs without --enable-mpi
builds without mpi support.

Expected Results:  
should configure gromacs with the --enable-mpi option
gromacs should be built with mpi support.
Comment 1 Joseph Spadavecchia 2007-06-25 16:30:19 UTC
quick fix is to place

if use mpi ; then
    myconf="$myconf --enable-mpi"
fi

before

econf ${myconf} --enable-float || die "configure single-precision failed"
Comment 2 Marijn Schouten (RETIRED) gentoo-dev 2007-06-25 16:39:03 UTC
look further, mpi is not ignored:

if use mpi ; then
        cd "${WORKDIR}"/${P}-single-mpi
        econf ${myconf} --enable-float --enable-mpi --program-suffix=_mpi \
                || die "failed to configure single-mpi mdrun"
        emake mdrun || die "failed to make single-precision mpi mdrun" ;
fi
Comment 3 Joseph Spadavecchia 2007-06-25 16:47:15 UTC
You're right to assert that they ebuild does, in fact, do something with the mpi USE flag.  The problem is that it does not do the right thing with it.

Gromacs is built, but without mpi support.  Give it a try and see for yourself.

The --enable-mpi needs to be part of the first call to econf.
Comment 4 Jeffrey Gardner (RETIRED) gentoo-dev 2007-06-25 16:52:18 UTC
> Actually, this ebuild is a complete mess.
I'm glad you approve...and thanks for your support.

Checking mpi right now...
Comment 5 Jeffrey Gardner (RETIRED) gentoo-dev 2007-06-25 17:23:34 UTC
Okay I'm using lam_mpi and it works fine here.


~/methanol $ mpirun -c 2 /usr/bin/mdrun -v
               NODE (s)   Real (s)      (%)
       Time:     19.250     20.000     96.2
               (Mnbf/s)   (MFlops)   (ns/day)  (hour/ns)
Performance:     23.305    866.122     84.165      0.285



AND


mdrun_mpi -V
               NODE (s)   Real (s)      (%)
       Time:     19.080     20.000     95.4
               (Mnbf/s)   (MFlops)   (ns/day)  (hour/ns)
Performance:     25.070    931.741     90.566      0.265



Either one uses multiple CPU's.
What MPI implementation are you using?
Comment 6 Joseph Spadavecchia 2007-06-25 17:32:45 UTC
You're right.  That was probably an overstatement.  It's only a bit messy. ;-) Thank you for checking.

I'm using mpich2 on amd64.

The sanfu is that with mpi enabled it puts mpi support in a separate executable (mdrun_mpi)...  This can be problematic when you have programs and scripts depending on 'mdrun' supporting mpi.
Comment 7 Jeffrey Gardner (RETIRED) gentoo-dev 2007-06-25 17:35:26 UTC
I think in that case you should modify your scripts...other than that, patches are welcome :)
Comment 8 Joseph Spadavecchia 2007-06-25 18:15:11 UTC
Thank you very much.  I'll modify my scripts for now.

It seems like an extra [potentially unexpected?] feature to keep the serial code around even when the mpi USE flag is set.  Maybe it would be better to flip it around, i.e., have mdrun (mpi version) and mdrun-serial (serial version)? 

I guess if there are other users with a similar dependency then it might make sense for a patch.

I've noticed that unexperienced cluster users often distribute complicated scripts for launching their jobs, processing results etc.  Renaming mdrun can be really problematic in these cases.  For example, the users don't know tricks like: perl -pi -e 's/mdrun/mdrun_mpi/g' ...  In such cases, it ultimately becomes more work for the Gentoo admin.
Comment 9 Jeffrey Gardner (RETIRED) gentoo-dev 2007-06-25 18:25:40 UTC
I hear ya....
I think most people like it the way it is...but you could easily create a local overlay and use an ebuild that works the way you want it to.
Comment 10 Joseph Spadavecchia 2007-06-25 19:02:13 UTC
Created attachment 123064 [details]
gromacs-3.3.1-r1.ebuild (mpi default when mpi USE flag set)
Comment 11 Joseph Spadavecchia 2007-06-25 19:03:04 UTC
Created attachment 123065 [details, diff]
gromacs-3.3.1-r1.ebuild.patch (mpi default with mpi USE flag)
Comment 12 Joseph Spadavecchia 2007-06-25 19:11:08 UTC
Thanks man.  Fair enough. :-)

Just in case it could be helpful to someone else...

I've posted gromacs-3.3.1-r1.ebuild, an ebuild setting the mpi-enabled gromacs as the default when the mpi USE flag is set.  The serial gromacs is called mdrun_serial.

Also I've posted gromacs-3.3.1-r1.ebuild.patch: a patch that neatens things up a drop, but also has mpi-enabled gromacs as default.  The serial gromacs has the _serial suffix.
Comment 13 Jeffrey Gardner (RETIRED) gentoo-dev 2007-06-25 19:16:57 UTC
Cool, thanks!
Comment 14 Donnie Berkholz (RETIRED) gentoo-dev 2007-06-25 19:17:47 UTC
I kinda like the idea of switching around which binaries get tagged. If you build with USE=mpi, you presumably have intent to cluster it, and clustering is arguably  your primary application (unless you're just testing, in which case you can recompile).
Comment 15 Donnie Berkholz (RETIRED) gentoo-dev 2007-06-25 19:36:24 UTC
(In reply to comment #9)
> I hear ya....
> I think most people like it the way it is...but you could easily create a local
> overlay and use an ebuild that works the way you want it to.

We talked a bit on IRC. It's more than just "most people like it." It's that this is pretty standard for building with MPI support, not just in Gentoo. Google for:

gromacs _mpi

and watch how much stuff pops up.
Comment 16 Joseph Spadavecchia 2007-06-25 20:01:02 UTC
> We talked a bit on IRC. It's more than just "most people like it." It's that
> this is pretty standard for building with MPI support, not just in Gentoo.

Then it sounds like you have made a very reasonable decision... Thanks.  :-)