Source FE3 bashrc on Parallel Run
I've recently compiled foam-extend-3.0 from source and distributed to a cluster where we have different versions of OpenFOAM already installed from the Ubuntu repo. We've been able to run any version of OF with no issue by sourcing the appropriate version's bashrc on the host and the appropriate arguments are passed to load that version on the slave machines when mpirun is called.
However, this is not occuring in foam-extend. I have to manually source the /opt/foam-extend-3.0/etc/bashrc in the slave machines' $HOME/.bashrc on the first line; however, this prevents us from running other versions of OF since every mpirun call automatically sources foam-extend on the slaves (overwriting the mpirun-called version sourcing). 1. Is there a settings file I need to modify in foam-extend-3.0 to source the bashrc upon mpirun call? Or is there a way of passing the source command during the mpirun call? 2. On a semi related note, foamJob does not appear to work with foam-extend-3.0, with an error thrown: Code:
/opt/foam-extend-3.0/bin/foamExec: 398: /opt/foam-extend-3.0/etc/bashrc: [[: not found |
Further information:
I can run both single-core with icoFoam and in parallel on a local machine with Code:
mpirun -np 6 icoFoam -parallel Code:
mpirun --hostfile machines -np 6 icoFoam -parallel Code:
-------------------------------------------------------------------------- |
I've tried installing the pre-compiled foam-extend-3.0 binaries as well, but there is no change in the behaviour. I've tried passing environment variables through the -x argument in mpirun to no avail. I can't piece together the behaviour difference between our openfoam installations and the foam-extend installation to determine why the former run flawlessly and the latter won't run at all in parallel.
|
Revisiting this issue as it remains unsolved:
Checking the environment variables for OF221, it appears that SYSTEMOPENMPI is set for $WM_MPLIB while for FE3 OPENMPI is set. $MPI_ARCH_PATH points to the ThirdParty package implementation of MPI for FE3. Now, I'm fine with using the newer version of OpenMPI but why will the environment variables not properly source under this version? The file structure, paths, users, hardware -- everything is identical across nodes. The /usr/lib/openmpi implementation in OF211/221/230/etc. works fine... I cannot fathom me being the only person with this problem, though, and I would appreciate someone with a bit more knowledge helping me out. |
Quote:
I have the same problem like you !! OF2.3 is working fine with mpi,foamJob over Infinband. But 3.1 isn't. Br Christian |
I still haven't been able to get it working, unfortunately. Would be nice to get some input from someone with more expertise on OpenMPI or this particular issue. I'll let you know if I ever figure it out, Kojote.
|
Greetings to all!
I should be able to help, but I need more information, namely:
In addition to the above, try running with the following command: Code:
mpirun --hostfile machines -np 6 /opt/foam-extend-3.0/bin/foamExec icoFoam -parallel Bruno |
Hi Bruno,
Thank you for taking an interest in this issue. I have recently been trying to get foam-extend-3.1 to build using the instructions here; however, no more luck than with fe3. I still can't get parallel to work. I should note I've attempted to compile on multiple machines and multiple methods, including compiling in the local user directory and running from there, compiling in the local user directory and moving the files to /opt/ and changing permissions, and compiling as root in /opt/foam/ directly (all approaches using default ThirdParty OPENMPI settings). None of these methods differed in terms of correcting the mpi issues described above. If you have any ideas, please let me know. Anyways, I have compiled this morning under root in the /opt/ directory with the following prefs.sh settings (to use SYSTEMOPENMPI instead): Code:
FOAM_VERBOSE=1 Code:
foamJob -p -s icoFoam Code:
Parallel processing using SYSTEMOPENMPI with 6 processors Using mpirun as you suggest above yields similar results: Code:
mpirun --hostfile machines -np 6 /opt/foam/foam-extend-3.1/bin/foamExec icoFoam -parallel Code:
/opt/foam/foam-extend-3.1/bin/foamExec: 400: /opt/foam/foam-extend-3.1/etc/bashrc: [[: not found I tried running ./bin/foamInstallationTest and all was well except a warning regarding conflicting gcc versions, but I'm not sure this is relevant to the issue at hand since everything compiles and runs fine locally. Code:
Third party software |
Hi cdm,
OK, I've finally managed to look into this in detail, report the issue and push a fix and respective merge request:
OK, the "simplest" way is to rely on git, so please follow these steps: Code:
foam This is the quickest and will solve most of the problems. But there is one more fix that has to be manually fixed:
Both foamExec and foamJob should now work as intended. You won't even have to start a new terminal :D Best regards, Bruno |
Bruno,
I pulled the fix from your git and modified the file as outlined above, then distributed this copy to two machines. I'm still receiving the following error upon running foamJob or mpirun with a hostfile specified: Code:
Parallel processing using OPENMPI with 6 processors Code:
mpirun -np 6 icoFoam -parallel | tee log |
1 Attachment(s)
Hi cdm,
Quote:
Perhaps you only applied the last change from my repository/branch? There are 3 commits needed from there, not just the last one. If the commands had worked as intended, then running this command should give you the complete change list: Code:
git diff origin/master If you prefer to apply the attached changes, you can use this command (after unpacking): Code:
patch -p1 < changes.patch
Bruno |
All times are GMT -4. The time now is 08:11. |