Newer
Older

Guillaume Demesy
committed
#!/bin/bash
export OPENBLAS_NUM_THREADS=1
export OMP_NUM_THREADS=1
export NPROC=64
export nb_phi=64
export myDir="res_Matrix_nb_phi"$nb_phi
export myFile="run_phideg_values_"$nb_phi".out"
rm -r $myDir
rm $myFile
mkdir $myDir
myfunc() {
local mysubDir=$myDir/run$1_psi$2
mkdir $mysubDir
cp grating3D.geo grating3D.pro grating3D_data_halfellipsoid.geo grating3D_data.geo grating3D_materials.pro $mysubDir
local phi=$(echo "scale=10;360/($nb_phi)*$1" | bc )
if [ $2 -eq 0 ]; then echo $1" "$phi >> $myDir/$myFile ; fi
cd $mysubDir
echo gmsh grating3D.pro -setstring test_case halfellipsoid -setnumber thetadeg 50 -setnumber phideg $phi -setnumber psideg $2 -setstring Solver.SocketName id$1$2 -
if [ $2 -eq 0 ]; then cp res3D/rs.txt ../r_pin_sout_phi$1.out ; fi
if [ $2 -eq 0 ]; then cp res3D/rp.txt ../r_pin_pout_phi$1.out ; fi
if [ $2 -eq 90 ]; then cp res3D/rs.txt ../r_sin_sout_phi$1.out ; fi
if [ $2 -eq 90 ]; then cp res3D/rp.txt ../r_sin_pout_phi$1.out ; fi
cd ../..
}
export -f myfunc
# parallel --lb -j $NPROC myfunc ::: $(seq 1 $nb_phi) ::: 0 90
parallel -j $NPROC myfunc ::: $(seq 1 $nb_phi) ::: 0 90