Resources.java [src/java/m/oms] Revision: Date:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package m.oms;
import csip.Config;
import csip.api.server.PayloadParameter;
import csip.api.server.ServiceException;
/**
*
* @author holm,od
*/
public abstract class Resources {
public static final String DDM = "row";
static final String MPI_THREADS = "mpi.cores";
public static final String LOCATION_MNT_DATA
= Config.getString("oms.data.path", "/mnt/csip-oms");
// optional parameter
public static String[] optParams = {
"ACAdaptation",
"baseDepth",
"BetaW",
"Beta_min",
"Beta_rsd",
"DCAdaptation",
"FCAdaptation",
"Ksink",
"LExCoef",
"N_delay_RG1",
"N_delay_RG2",
"a_rain",
"a_snow",
"angstrom_a",
"angstrom_b",
"baseTemp",
"calib_clat_fact",
"ccf_factor",
"cn_froz",
"crop_19_soilPolRed",
"crop_203_soilPolRed",
"crop_204_soilPolRed",
"crop_301_soilPolRed",
"crop_401_soilPolRed",
"crop_753_soilPolRed",
"crop_801_soilPolRed",
"crop_802_soilPolRed",
"crop_19_BetaW",
"crop_203_BetaW",
"crop_204_BetaW",
"crop_301_BetaW",
"crop_401_BetaW",
"crop_753_BetaW",
"crop_801_BetaW",
"crop_802_BetaW",
"crop_19_a_rain",
"crop_203_a_rain",
"crop_204_a_rain",
"crop_301_a_rain",
"crop_401_a_rain",
"crop_753_a_rain",
"crop_801_a_rain",
"crop_802_a_rain",
"crop_19_a_snow",
"crop_203_a_snow",
"crop_204_a_snow",
"crop_301_a_snow",
"crop_401_a_snow",
"crop_753_a_snow",
"crop_801_a_snow",
"crop_802_a_snow",
"icn",
"r2adj",
"fcimp",
"meanCNFactor",
"meanKfFactor",
"defaultCO2",
"denitfac",
"delayNitrification",
"denitrificationRateCoefficient",
"denitrificationSoilSaturationThreshold",
"depdr",
"deposition_factor",
"drrad",
"drspac",
"f1",
"f12",
"f13",
"f14",
"f15",
"f16",
"f17",
"f18",
"f19",
"f2",
"f3",
"f4",
"f5",
"f6",
"f7",
"f8",
"flowRouteTA",
"fmt_date",
"fmt_double",
"g_factor",
"geoMaxPerc",
"gwCapRise",
"gwRG1Fact",
"gwRG1RG2dist",
"gwRG2Fact",
"halflife_RG1",
"halflife_RG2",
"infil_conc_factor",
"initLPS",
"initMPS",
"initN_concRG1",
"initN_concRG2",
"initRG1",
"initRG2",
"kdiff_layer",
"kf_calib",
"kf_fact",
"lagSurfaceRunoff",
"lagInterflow",
"locGrw",
"longTZ",
"nitri_delay",
"nitrificationSoilTemperatureThreshold",
"nitrificationSurfaceTemperatureThreshold",
"opti",
"piadin",
"r_factor",
"rootfactor",
"sceno",
"skipRegression",
"snowCritDens",
"snowDensConst",
"snowFactorA",
"snowFactorB",
"snowFactorC",
"snow_trans",
"snow_trs",
"soilDiffMPSLPS",
"soilDistMPSLPS",
"soilImpGT80",
"soilImpLT80",
"soilLatVertLPS",
"soilLinRed",
"soilMaxDPS",
"soilMaxInfSnow",
"soilMaxInfSummer",
"soilMaxInfWinter",
"soilMaxPerc",
"soilOutLPS",
"soilPolRed",
"t_factor",
"tempRes",
"temp_lag"
};
// simulation flags
public static String[] flags = {
"flagParallel",
"flagRegionalization",
"flagHRURouting",
"flagReachRouting",
"flagSort",
"flagSplit",
"flagInfiltration",
"flagTillage",
"flagTileDrain",
"flagUPGM",
"parallelismFactor",
"parallelismThreads",
"flagSaveState",
"flagLoadState",
"flagWB",
"loadStateFilePath",
"dataStartTime",
"dataEndTime"
};
// simulation flags
public static String[] outputs = {
"idSet_hru",
"idSet_reach",
"outFile_hru",
"attrSet_hru",
"attrSet_hru_w",
"outFile_hru_crop",
"attrSet_hru_crop",
"attrSet_hru_crop_w",
"outFile_hru_layer",
"attrSet_hru_layer",
"attrSet_hru_layer_w",
"outFile_hru_n_mb",
"attrSet_hru_n_mb",
"attrSet_hru_n_mb_w",
"outFile_hru_crop_upgm",
"attrSet_hru_crop_upgm",
"attrSet_hru_crop_upgm_w",
"outFile_catch",
"attrSet_catch",
"attrSet_catch_w",
"outFile_catch_crop_upgm",
"attrSet_catch_crop_upgm",
"attrSet_catch_crop_upgm_w",
"outFile_catch_n_mb",
"attrSet_catch_n_mb",
"attrSet_catch_n_mb_w",
"outFile_reach",
"attrSet_reach",
"outFile_outlet",
"attrSet_outlet"
};
/**
* get the # threads for MPI calls.
*
* @param parameter
* @return
* @throws ServiceException
*/
public static int mpiThreads(PayloadParameter parameter) throws ServiceException {
int threads = Runtime.getRuntime().availableProcessors() / 2;
threads = threads + (threads / 2); // using 75% of physical cores
threads = Config.getInt(MPI_THREADS, threads); // config
if (parameter != null) {
threads = parameter.getInt(MPI_THREADS, threads); // payload
}
return threads;
}
}