Skip to content
Snippets Groups Projects
Commit 35b1ad0c authored by POLCHER Jan's avatar POLCHER Jan :bicyclist_tone4:
Browse files

A more elegant exit when a processor does not have any land points.

parent 7fb79a28
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,7 @@ def halfpartition(partin, land) : ...@@ -50,6 +50,7 @@ def halfpartition(partin, land) :
def fit_partition(partin, land): def fit_partition(partin, land):
partout = [] partout = []
for i, dom in enumerate(partin): for i, dom in enumerate(partin):
if dom["nbland"] > 0 :
l = land[dom["jstart"]:dom["jstart"]+dom["nbj"],dom["istart"]:dom["istart"]+dom["nbi"]] l = land[dom["jstart"]:dom["jstart"]+dom["nbj"],dom["istart"]:dom["istart"]+dom["nbi"]]
l1 = np.sum(l, axis = 0) l1 = np.sum(l, axis = 0)
...@@ -361,6 +362,12 @@ class partition : ...@@ -361,6 +362,12 @@ class partition :
# #
self.allistart = [] self.allistart = []
self.alljstart = [] self.alljstart = []
#
if self.size != len(part) :
ERROR("There are too many processors for the size of the domain.")
ERROR(str(self.size)+" processors. But partition could only achieve "+str(len(part))+" domain with land points")
sys.exit()
#
for i in range(self.size) : for i in range(self.size) :
self.allistart.append(part[i]["istart"]) self.allistart.append(part[i]["istart"])
self.alljstart.append(part[i]["jstart"]) self.alljstart.append(part[i]["jstart"])
......
...@@ -42,15 +42,15 @@ fi ...@@ -42,15 +42,15 @@ fi
# #
/bin/rm -f run.def *.txt /bin/rm -f run.def *.txt
cp run_E2OFD.def run.def cp run_E2OFD.def run.def
mpirun -n 2 python ../../RoutingPreProc.py mpirun -n 3 python ../../RoutingPreProc.py
if [ $? -gt 0 ] ; then if [ $? -gt 0 ] ; then
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
echo "X Run E2OFD on 4 Proc failed X" echo "X Run E2OFD on 3 Proc failed X"
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
exit exit
else else
echo "==================================" echo "=================================="
echo "= Run E2OFD on 4 Proc successful =" echo "= Run E2OFD on 3 Proc successful ="
echo "==================================" echo "=================================="
ls -lt ls -lt
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment