Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RoutingPP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IPSL
LMD
InTro
RoutingPP
Commits
35b1ad0c
"test/demo/static/css/bootstrap.css" did not exist on "f84b59baa90dc313b1a498e429bc917f06ff1f4d"
Commit
35b1ad0c
authored
4 years ago
by
POLCHER Jan
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Partition.py
+20
-13
20 additions, 13 deletions
Partition.py
tests/Mallorca/BuildHTUs_Mallorca.pbs
+3
-3
3 additions, 3 deletions
tests/Mallorca/BuildHTUs_Mallorca.pbs
with
23 additions
and
16 deletions
Partition.py
+
20
−
13
View file @
35b1ad0c
...
...
@@ -50,23 +50,24 @@ def halfpartition(partin, land) :
def
fit_partition
(
partin
,
land
):
partout
=
[]
for
i
,
dom
in
enumerate
(
partin
):
l
=
land
[
dom
[
"
jstart
"
]:
dom
[
"
jstart
"
]
+
dom
[
"
nbj
"
],
dom
[
"
istart
"
]:
dom
[
"
istart
"
]
+
dom
[
"
nbi
"
]]
l1
=
np
.
sum
(
l
,
axis
=
0
)
if
dom
[
"
nbland
"
]
>
0
:
l
=
land
[
dom
[
"
jstart
"
]:
dom
[
"
jstart
"
]
+
dom
[
"
nbj
"
],
dom
[
"
istart
"
]:
dom
[
"
istart
"
]
+
dom
[
"
nbi
"
]]
l1
=
np
.
sum
(
l
,
axis
=
0
)
i0
=
np
.
where
(
l1
>
0
)[
0
][
0
]
i1
=
np
.
where
(
l1
>
0
)[
0
][
-
1
]
i0
=
np
.
where
(
l1
>
0
)[
0
][
0
]
i1
=
np
.
where
(
l1
>
0
)[
0
][
-
1
]
l2
=
np
.
ma
.
sum
(
l
,
axis
=
1
)
j0
=
np
.
where
(
l2
>
0
)[
0
][
0
]
j1
=
np
.
where
(
l2
>
0
)[
0
][
-
1
]
l2
=
np
.
ma
.
sum
(
l
,
axis
=
1
)
j0
=
np
.
where
(
l2
>
0
)[
0
][
0
]
j1
=
np
.
where
(
l2
>
0
)[
0
][
-
1
]
dom
[
"
jstart
"
]
=
j0
+
dom
[
"
jstart
"
]
dom
[
"
nbj
"
]
=
j1
-
j0
+
1
dom
[
"
istart
"
]
=
i0
+
dom
[
"
istart
"
]
dom
[
"
nbi
"
]
=
i1
-
i0
+
1
dom
[
"
nbland
"
]
=
int
(
np
.
nansum
(
land
[
dom
[
"
jstart
"
]:
dom
[
"
jstart
"
]
+
dom
[
"
nbj
"
],
dom
[
"
istart
"
]:
dom
[
"
istart
"
]
+
dom
[
"
nbi
"
]]))
dom
[
"
jstart
"
]
=
j0
+
dom
[
"
jstart
"
]
dom
[
"
nbj
"
]
=
j1
-
j0
+
1
dom
[
"
istart
"
]
=
i0
+
dom
[
"
istart
"
]
dom
[
"
nbi
"
]
=
i1
-
i0
+
1
dom
[
"
nbland
"
]
=
int
(
np
.
nansum
(
land
[
dom
[
"
jstart
"
]:
dom
[
"
jstart
"
]
+
dom
[
"
nbj
"
],
dom
[
"
istart
"
]:
dom
[
"
istart
"
]
+
dom
[
"
nbi
"
]]))
partout
.
append
(
dom
)
partout
.
append
(
dom
)
return
partout
#
#
...
...
@@ -361,6 +362,12 @@ class partition :
#
self
.
allistart
=
[]
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
)
:
self
.
allistart
.
append
(
part
[
i
][
"
istart
"
])
self
.
alljstart
.
append
(
part
[
i
][
"
jstart
"
])
...
...
This diff is collapsed.
Click to expand it.
tests/Mallorca/BuildHTUs_Mallorca.pbs
+
3
−
3
View file @
35b1ad0c
...
...
@@ -42,15 +42,15 @@ fi
#
/bin/rm
-f
run.def
*
.txt
cp
run_E2OFD.def run.def
mpirun
-n
2
python ../../RoutingPreProc.py
mpirun
-n
3
python ../../RoutingPreProc.py
if
[
$?
-gt
0
]
;
then
echo
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
echo
"X Run E2OFD on
4
Proc failed X"
echo
"X Run E2OFD on
3
Proc failed X"
echo
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
exit
else
echo
"=================================="
echo
"= Run E2OFD on
4
Proc successful ="
echo
"= Run E2OFD on
3
Proc successful ="
echo
"=================================="
ls
-lt
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment