Salome HOME
Update copyrights
[plugins/ghs3dprlplugin.git] / bin / mg-tetra_hpc.bash
1 #!/bin/bash
2 # Copyright (C) 2014-2019  CEA/DEN, EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20
21 #bash script mg-tetra_hpc.bash
22 #could assume overriding set licence file of user/other new version distene products
23 #this script is used for only one call of mg-tetra_hpc.bash from salome plugin GHS3DPRLPLUGIN
24
25 #$0 have to be ignored: name of script
26 echo "mg-tetra_hpc.bash initial parameters are:\n  "$@"\n"
27
28 #example mg-tetra_hpc_mpi v2.1.11
29 #mpirun -n 6 mg-tetra_hpc_mpi.exe --gradation 1.05 --max_size 0 --min_size 0 --verbose 3 --in /tmp/GHS3DPRL.mesh --out /tmp/GHS3DPRL_out.mesh
30
31
32 #this is for example, sometimes DISTENE_LICENSE_FILE have to be overriden
33 #if [ $HOST == "hpcspot" ]
34 # then
35 #  export DISTENE_LICENSE_FILE="Use global envvar: DLIM8VAR"
36 #  export DLIM8VAR="dlim8 1:1:29030@10.27.51.1/002590c96d98::8fbdc02cde090ca0369ad028e839065b97709e3c33e640eb6a3c2c7e40fe3985"
37 # else
38 #   export DISTENE_LICENSE_FILE="Use global envvar: DLIM8VAR"
39 #   export DLIM8VAR="dlim8 1:1:29030@132.166.151.49/84c419b8::87af196ab2a936ab31363624539bff8096fbe1f3c83028c8f6b399b0a904ef85"
40 #fi
41
42
43 #this is for example, sometimes need to compile stubs/libmeshgems_mpi.so for mg-tetra_hpc.exe, depends of openmpi system or not#CURRENTDIR=`pwd`
44 CURRENTDIR=`pwd`
45 COMPILDIR=$MESHGEMSHOME/stubs           #/export/home/prerequisites_SALOME_780/MeshGems-2.1-11/FROM_nothing/stubs
46 MPI_EXE=`which mg-tetra_hpc_mpi.exe`
47 TARGETDIR=$MESHGEMSHOME/lib/Linux_64    #/export/home/prerequisites_SALOME_780/MeshGems-2.1-11/FROM_nothing/lib/Linux_64
48 echo "CURRENTDIR=" $CURRENTDIR
49 #rm $TARGETDIR/libmeshgems_mpi.so #compile every times
50 #if [ ! -f $TARGETDIR/libmeshgems_mpi.so ]
51 #then
52   echo "Compile libmeshgems_mpi.so with current openmpi:"
53   echo `which mpicc`
54   echo "COMPILDIR=" $COMPILDIR
55   echo "TARGETDIR=" $TARGETDIR
56   cd $COMPILDIR
57   mpicc  meshgems_mpi.c -DMESHGEMS_LINUX_BUILD -I../include -shared -fPIC -o $TARGETDIR/libmeshgems_mpi.so
58   find $MESHGEMSHOME -name "libmeshgems_mpi.so"
59   cd $CURRENTDIR
60 #fi
61
62 #example version mpi a mano
63 #cd /export/home/prerequisites_SALOME_780/MeshGems-2.1-11/FROM_nothing/stubs
64 #mpicc meshgems_mpi.c -DMESHGEMS_LINUX_BUILD -I../include -shared -fPIC -o libmeshgems_mpi.so
65 #cp -f libmeshgems_mpi.so /export/home/prerequisites_SALOME_780/MeshGems-2.1-11/FROM_nothing/lib/Linux_64/.
66
67 echo "mg-tetra_hpc.bash assume licence file set:"
68 echo DLIM8VAR=$DLIM8VAR
69 echo DISTENE_LICENSE_FILE=$DISTENE_LICENSE_FILE
70
71 #version multithread: why not use plugin/hypothesis mg-tetra.exe instead?
72 #which mg-tetra_hpc.exe
73 #echo mg-tetra_hpc.exe --max_number_of_threads $2 --number_of_subdomains $2 --in ... --out /tmp/GHS3DPRL_out.mesh --verbose 3
74 #for multithread only one /tmp/GHS3DPRL_out.mesh created...
75 #TODO create one med file from /tmp/GHS3DPRL_out.mesh if utile later
76
77
78 which mg-tetra_hpc_mpi.exe
79 #echo mpirun -n $2 mg-tetra_hpc_mpi.exe ${@:3:30}
80 echo mpirun -n $2 mg-tetra_hpc_mpi.exe --in /tmp/GHS3DPRL.mesh --out /tmp/GHS3DPRL_out.mesh
81 mpirun -n $2 mg-tetra_hpc_mpi.exe --in /tmp/GHS3DPRL.mesh --out /tmp/GHS3DPRL_out.mesh
82
83 #typically write files /tmp/GHS3DPRL_out.00000?.mesh  & /tmp/GHS3DPRL_out.00000?.global
84
85