Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@

if 'stampede2' not in socket.gethostname():
from FetchOpenQuake import get_site_rup_info_oq
from FetchOpenSHA import * # noqa: F403
#from FetchOpenSHA import * # noqa: F403
from FetchOpenSHA_25_4_1 import * # noqa: F403
import threading # noqa: E402

import ujson # noqa: E402
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
import pandas as pd

if 'stampede2' not in socket.gethostname():
from FetchOpenSHA import * # noqa: F403
#from FetchOpenSHA import * # noqa: F403
from FetchOpenSHA_25_4_1 import * # noqa: F403


def get_rups_to_run(scenario_info, user_scenarios, num_scenarios): # noqa: C901, D103
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def __call__(self, *args, **kwargs):


if 'stampede2' not in socket.gethostname():
from FetchOpenSHA import (
#from FetchOpenSHA import (
from FetchOpenSHA_25_4_1 import (
get_site_vs30_from_opensha,
get_site_z1pt0_from_opensha,
get_site_z2pt5_from_opensha,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
from org.opensha.commons.data import * # noqa: F403
from org.opensha.commons.data.function import * # noqa: F403
from org.opensha.commons.data.siteData import * # noqa: F403
from org.opensha.commons.geo import * # noqa: F403
#from org.opensha.commons.geo import * # noqa: F403
from org.opensha.commons.geo import Location # noqa: F403
from org.opensha.commons.param import * # noqa: F403
from org.opensha.commons.param.constraint import * # noqa: F403
from org.opensha.commons.param.event import * # noqa: F403
Expand Down Expand Up @@ -464,6 +465,7 @@ def get_PointSource_info_CY2014(source_info, siteList): # noqa: N802, N803, D10
'dip': float(source_info['AverageDip']),
'width': 0.0,
'zTop': sourceDepth,
'zHyp': sourceDepth,
'aveRake': float(source_info['AverageRake']),
}
return site_rup_info, siteList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@

R2D = True

OPENSHA_JAR = 'opensha-all.jar' # version 25.4.1 (invoked in 04/2026)


def site_job(hazard_info): # noqa: C901, D103
# Sites and stations
Expand Down Expand Up @@ -542,12 +544,14 @@ def hazard_job(hazard_info): # noqa: C901, D103, PLR0915

memory_total = psutil.virtual_memory().total / (1024.0**3)
memory_request = int(memory_total * 0.75)
jpype.addClassPath('./lib/OpenSHA-1.5.2.jar')
#jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') # not supported by opensha starting from 02/2026
jpype.addClassPath('./lib/{}'.format(OPENSHA_JAR))
try:
jpype.startJVM(f'-Xmx{memory_request}G', convertStrings=False)
except: # noqa: E722
print( # noqa: T201
f'StartJVM of ./lib/OpenSHA-1.5.2.jar with {memory_request} GB Memory fails. Try again after releasing some memory'
#f'StartJVM of ./lib/OpenSHA-1.5.2.jar with {memory_request} GB Memory fails. Try again after releasing some memory'
f'StartJVM of ./lib/{OPENSHA_JAR} with {memory_request} GB Memory fails. Try again after releasing some memory'
)
if oq_flag:
# clear up old db.sqlite3 if any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

R2D = True

OPENSHA_JAR = 'opensha-all.jar' # version 25.4.1 (invoked in 04/2026)

def hazard_job(hazard_info): # noqa: C901, D103, PLR0915
from CreateScenario import load_ruptures_openquake
Expand Down Expand Up @@ -578,7 +579,8 @@ def hazard_job(hazard_info): # noqa: C901, D103, PLR0915

memory_total = psutil.virtual_memory().total / (1024.0**3)
memory_request = int(memory_total * 0.75)
jpype.addClassPath('./lib/OpenSHA-1.5.2.jar')
#jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') # not supported by opensha starting from 02/2026
jpype.addClassPath('./lib/{}'.format(OPENSHA_JAR))
jpype.startJVM(f'-Xmx{memory_request}G', convertStrings=False)
if oq_flag:
# clear up old db.sqlite3 if any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

import psutil

OPENSHA_JAR = 'opensha-all.jar' # version 25.4.1 (invoked in 04/2026)

if __name__ == '__main__':
# parse arguments
parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -112,7 +114,8 @@

memory_total = psutil.virtual_memory().total / (1024.0**3)
memory_request = int(memory_total * 0.75)
jpype.addClassPath('./lib/OpenSHA-1.5.2.jar')
#jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') # not supported by opensha starting from 02/2026
jpype.addClassPath('./lib/{}'.format(OPENSHA_JAR))
jpype.startJVM(f'-Xmx{memory_request}G', convertStrings=False)
from CreateScenario import (
create_earthquake_scenarios,
Expand Down
Loading