I successfully used the following shell function in bashrc to pass the hostfile to mpirun by default. Thanks to everyone for help on this.
# mpirun shell function to pass hostfile by default
mpirun() {
array="${@}"
/usr/lib64/openmpi3/bin/mpirun --hostfile /usr/local/bin/hostfile ${array}
}
export -f mpirun
________________________________________
From: Collaborative Computational Project in Electron cryo-Microscopy <[log in to unmask]> on behalf of Jason Key <[log in to unmask]>
Sent: Wednesday, July 3, 2019 10:01 AM
To: [log in to unmask]
Subject: [EXTERNAL] Re: [ccpem] problem running MPI on all threads
Hi Joel,
Next, I set mpirun to have a new alias in my bashrc, so it would always default to running with the hostfile. Note, I confirmed that this alias works with the above Python example.
alias mpirun='mpirun --hostfile ~/hostfile'
However, when I try to run Relion it throws the same error about not enough slots being available. Is it possible that Relion is somehow calling mpirun through some other means, so does not see the alias I'm using?
Keep in mind that aliases are not expanded in non-interactive shells.
Generally speaking, you won't be able to run aliases from your .bashrc in your shell scripts or shells created within other programs.
So in this case, your alias isn't getting to RELION.
If you prefer to run mpirun this way you can write a wrapper script for mpirun and stick it in your $PATH.
But you have to be careful - wrappers for mpirun can cause MPI trouble with some schedulers.
If you're not using a scheduler, it should work.
Cheers,
Jason
--
Jason Key, PhD
Structural Biology Grid - SBGrid.org<https://urldefense.proofpoint.com/v2/url?u=http-3A__sbgrid.org_&d=DwMFaQ&c=lb62iw4YL4RFalcE2hQUQealT9-RXrryqt9KZX2qu2s&r=JnYzuUa3E5p4u7qrfPzeZV8LIgMpwauz4WIvX7NJIi8&m=_8HzoqvGnhvEyouNfuQABSsZfGGSVddxJ_OwiSU1DpA&s=hTsz_0tbnLcKmwD0fOYXDroPdBTNBSM6woQSeaEzyh8&e=>
Harvard Medical School - hms.harvard.edu<https://urldefense.proofpoint.com/v2/url?u=http-3A__hms.harvard.edu&d=DwMFaQ&c=lb62iw4YL4RFalcE2hQUQealT9-RXrryqt9KZX2qu2s&r=JnYzuUa3E5p4u7qrfPzeZV8LIgMpwauz4WIvX7NJIi8&m=_8HzoqvGnhvEyouNfuQABSsZfGGSVddxJ_OwiSU1DpA&s=iwa1LtIMOwwm6EP9qxY3LJYou93O8fr4Jv0RkFLwgDI&e=>
________________________________
To unsubscribe from the CCPEM list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=CCPEM&A=1<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.jiscmail.ac.uk_cgi-2Dbin_webadmin-3FSUBED1-3DCCPEM-26A-3D1&d=DwMFaQ&c=lb62iw4YL4RFalcE2hQUQealT9-RXrryqt9KZX2qu2s&r=JnYzuUa3E5p4u7qrfPzeZV8LIgMpwauz4WIvX7NJIi8&m=_8HzoqvGnhvEyouNfuQABSsZfGGSVddxJ_OwiSU1DpA&s=k8TqSPqBkTqdWGDTWtd7EpCGEyi_ywNu8G_82l9VxWQ&e=>
########################################################################
To unsubscribe from the CCPEM list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=CCPEM&A=1
|