src/java/m/wrfhydro/V1_0.java
@@ -43,25 +43,28 @@ |
|
public static final String MPI = "mpirun"; |
|
+ // in case the exe path needs adjustment. |
+ String wrf_hydro = Config.getString("wrf_hydro_exe", "/usr/local/tomcat/WRF/wrf_hydro_NoahMP.exe"); |
+ |
|
@Override |
protected void doProcess() throws Exception { |
|
// allow for num cores configuration |
- int threads = (int) (Runtime.getRuntime().availableProcessors() * 0.75); |
- threads = Config.getInt("mpi.cores", threads); |
+ int threads = Config.getInt("mpi.cores", 2); |
threads = metainfo().getInt("mpi.cores", threads); |
|
- Executable mpi = resources().getExe(MPI); |
- File wrf_hydro = new File("/usr/local/tomcat/WRF/wrf_hydro_NoahMP.exe"); |
- if (!wrf_hydro.exists()) { |
+ |
+ File exe = new File(wrf_hydro); |
+ if (!exe.exists()) { |
throw new ServiceException("Not found: " + wrf_hydro.toString()); |
} |
|
+ Executable mpi = resources().getExe(MPI); |
mpi.addArguments( |
"-wdir", getWorkspaceDir(), |
"-np", threads, |
- wrf_hydro.toString() |
+ wrf_hydro |
); |
|
int ret = mpi.exec(); |