forked from Azure-Samples/azure-batch-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Linux MPI sample (Azure-Samples#254)
* Update Linux MPI sample * Update based on feedback. * fix travis-ci own issue
- Loading branch information
Showing
13 changed files
with
125 additions
and
999 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
* text=auto | ||
# Set the default behavior of Linux shell scripts to lf | ||
*.sh text eol=lf | ||
Python/Batch/article_samples/mpi/data/* text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Azure Batch Python Article Samples | ||
|
||
### Configuring the samples | ||
In order to run the Python samples, they must be updated with Azure Batch | ||
and Azure Storage credentials. | ||
|
||
### Setting up the Python environment | ||
In order to run the samples, you will need a Python interpreter compatible | ||
with version 2.7 or 3.3+. You will also need to install the | ||
[Azure Batch](https://pypi.python.org/pypi/azure-batch) and | ||
[Azure Storage](https://pypi.python.org/pypi/azure-storage) python packages. | ||
Installation can be performed using the [requirements.txt](./requirements.txt) | ||
file via the command `pip install -r requirements.txt` | ||
|
||
### MPI sample | ||
The MPI sample is an introduction to running an MPI command in Azure Batch in a | ||
Linux environment. It creates a pool with RDMA enabled virtual machines (You can | ||
use STANDARD_A8 to replace the virtual machine size if you don't have enough | ||
core quota). It submits a job to the pool, and then submits a task which | ||
performs a simple MPI pingpong command. The files required by the task are | ||
automatically uploaded to Azure Storage and then downloaded onto the nodes via | ||
Batch resource files. When the task is done, the console output of the MPI | ||
pingpong command is uploaded back to Azure Storage. | ||
|
||
For more details on MPI/RDMA, visit [here](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/rdma-cluster). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
#Command script to run pingpong performance testing on multiple machines as MPI task on Azure Batch. | ||
#Usage: application-cmd [nodes] | ||
|
||
#For more details of MPI/RDMA, visit: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/rdma-cluster | ||
|
||
#Use the intel mpi exists in CentOS-HPC 7.4 image | ||
source /opt/intel/impi/5.1.3.223/bin64/mpivars.sh | ||
#prepare environment variables for intel mpi to use RDMA | ||
export I_MPI_FABRICS=shm:dapl | ||
export I_MPI_DAPL_PROVIDER=ofa-v2-ib0 | ||
export I_MPI_DYNAMIC_CONNECTION=0 | ||
|
||
# Run mpi application with appropriate parameters | ||
mpirun -n $1 -ppn 1 -hosts $AZ_BATCH_HOST_LIST IMB-MPI1 pingpong |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
#Command script to run pingpong performance testing on multiple machines as MPI task on Azure Batch. | ||
#Usage: coordination-cmd | ||
|
||
#For more details of MPI/RDMA, visit: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/rdma-cluster | ||
|
||
#Prepare environment |
40 changes: 2 additions & 38 deletions
40
Python/Batch/article_samples/mpi/data/linux/openfoam/application-cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,7 @@ | ||
#!/usr/bin/env bash | ||
#Command script to run OpenFoam application on multiple machines as MPI task on Azure Batch. | ||
#Usage: application [nodes] [cores_per_node] [CFD iterations] | ||
|
||
#prepare environment variables for intel mpi and openfoam | ||
mnt=$4 | ||
source /opt/intel/impi/5.1.3.181/bin64/mpivars.sh | ||
export MPI_ROOT=$I_MPI_ROOT | ||
export FOAM_INST_DIR=$mnt/share/OpenFOAM | ||
source $mnt/share/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc | ||
source /opt/intel/impi/5.1.3.223/bin64/mpivars.sh | ||
export I_MPI_FABRICS=shm:dapl | ||
export I_MPI_DAPL_PROVIDER=ofa-v2-ib0 | ||
export I_MPI_DYNAMIC_CONNECTION=0 | ||
export LD_LIBRARY_PATH=$mnt/share/OpenFOAM/intel64_lin:$LD_LIBRARY_PATH | ||
# total number of processes is number of nodes multipled by number of processes per node | ||
(( numProc = $1 * $2 )) | ||
|
||
#prepare decomposition mesh as per total number of nodes, processes and number of iterations for openfoam | ||
cd $mnt/share/OpenFOAM/motorBike | ||
echo $numProc | ||
sed -i.bak "s/SUB1/$numProc/g" system/decomposeParDict | ||
sed -i.bak2 "s/SUB2/$1/g" system/decomposeParDict | ||
sed -i.bak "s/SUB1/$3/g" system/controlDict | ||
decomposePar | ||
ls -d processor* | xargs -I {} rm -rf ./{}/0 | ||
ls -d processor* | xargs -I {} cp -r 0.org ./{}/0 | ||
|
||
# Run mpi application with appropriate parameters | ||
mpirun -np $numProc -ppn $2 --host $5 -wdir $mnt/share/OpenFOAM/motorBike simpleFoam -parallel | ||
|
||
# process the output | ||
reconstructPar -latestTime | ||
foamToVTK -latestTime | ||
|
||
# prepare the output and compress it as result | ||
cp $4/genimages.py VTK/ | ||
cp $4/stdout.txt VTK/ | ||
cp $4/stderr.txt VTK/ | ||
cd VTK | ||
mv motorBike*/*.vtk . | ||
mmv "*:*.vtk" "#1#2.vtk" | ||
mmv "*%*.vtk" "#1#2.vtk" | ||
tar -czf $4/VTK.tgz ../VTK/ | ||
mpirun -n $1 -ppn `nproc` --host $AZ_BATCH_HOST_LIST IMB-MPI1 pingpong |
41 changes: 0 additions & 41 deletions
41
Python/Batch/article_samples/mpi/data/linux/openfoam/coordination-cmd
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.