Skip to content

Commit

Permalink
lsdkjf<
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKallekleiv committed Dec 6, 2023
1 parent 7a2c48a commit a04678c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions backend/src/backend/primary/user_session_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ async def _create_new_job(self, user_id: str) -> None:
# these could be dynamic based on e.g. the selected ensemble sizess by the user.
json={
"resources": {
"limits": {"memory": "128GiB", "cpu": "16"},
"requests": {"memory": "32GiB", "cpu": "4"},
"limits": {"memory": "64GiB", "cpu": "4"},
"requests": {"memory": "32GiB", "cpu": "2"},
}
},
)
Expand Down
18 changes: 7 additions & 11 deletions backend/src/backend/user_session/routers/surface/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ async def well_intersection_reals_from_user_session(
for res in res_array:
tot_mb += len(res) / (1024 * 1024)
bytesios = [BytesIO(bytestr) for bytestr in res_array]
xtgeofiles = [_XTGeoFile(bytestr) for bytestr in bytesios]
test = [BytesIO(bytestr).read() for bytestr in res_array]
# xtgeofiles = [_XTGeoFile(bytestr) for bytestr in bytesios]
# test = [BytesIO(bytestr).read() for bytestr in res_array]
elapsed_bytesio = timer.lap_s()

surfaces = [
xtgeo.surface_from_file(bytestr, fformat="irap_binary") for bytestr in bytesios
]
# surfaces = [
# xtgeo.surface_from_file(bytestr, fformat="irap_binary") for bytestr in bytesios
# ]
elapsed_xtgeo = timer.lap_s()

# surfaces2 = [
Expand Down Expand Up @@ -140,12 +140,8 @@ def read_header(buf):

def read_values_optimized(header, buf):
stv = 100
n_blocks = (len(buf) - stv) // (
header["ncol"] * 4 + 8
) # approximate number of blocks
datav = np.empty(
(header["ncol"] * n_blocks,), dtype=np.float32
) # preallocated array
n_blocks = (len(buf) - stv) // (header["ncol"] * 4 + 8)
datav = np.empty((header["ncol"] * n_blocks,), dtype=np.float32) # preallocate

idx = 0
while stv < len(buf):
Expand Down

0 comments on commit a04678c

Please sign in to comment.