...
Setting up Condor in the general adapter
The Condor computations are run as part of a normal General Adapter run - no modification to the workflow is needed.
In the general section of the generalAdapterRun the number of ensembles should be specified (Please note that currently the general adapter ensemble run can only be executed from one initial state. Ensembles of historical states are not currently supported):
<ensembleMemberCount>17</ensembleMemberCount>
The tag %ENSEMBLE_MEMBER_ID% can then be used to loop through the ensemble output directories.
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <!--Delft FEWS PO--> <generalAdapterRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/generalAdapterRun.xsd"> <!-- General information for General Adapter run --> <general> <description>Sobek Model run for the Como Lake</description> <rootDir>%REGION_HOME%/Modules/SbkParallel/como</rootDir> <workDir>%ROOT_DIR%</workDir> <exportDir>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/fews_in</exportDir> <exportIdMap>IdSobekExportForecast</exportIdMap> <importDir>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/fews_out</importDir> <importIdMap>IdSobekImportForecast</importIdMap> <dumpFileDir>$GA_DUMPFILEDIR$</dumpFileDir> <dumpDir>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%</dumpDir> <diagnosticFile>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/fews_out/diagnostic.xml</diagnosticFile> <convertDatum>true</convertDatum> <ensembleMemberCount>17</ensembleMemberCount> </general> <activities> <startUpActivities> <purgeActivity> <filter>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/fews_in/*.*</filter> </purgeActivity> <purgeActivity> <filter>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/fews_out/*.*</filter> </purgeActivity> <purgeActivity> <filter>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/model/*.*</filter> </purgeActivity> <purgeActivity> <filter>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/log/*.*.*</filter> </purgeActivity> </startUpActivities> <!-- Export activities --> <exportActivities> <!-- Export state (warm state)--> <exportStateActivity> <moduleInstanceId>Sobek_Po_Como_Historical</moduleInstanceId> <stateExportDir>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/model</stateExportDir> <stateConfigFile>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/fews_in/states.xml</stateConfigFile> <stateLocations type="file"> <stateLocation> <readLocation>sobek.rda</readLocation> <writeLocation>sobek.nda</writeLocation> </stateLocation> <stateLocation> <readLocation>sobek.rdf</readLocation> <writeLocation>sobek.ndf</writeLocation> </stateLocation> </stateLocations> <stateSelection> <warmState> <stateSearchPeriod unit="hour" start="-48" end="0"/> </warmState> </stateSelection> </exportStateActivity> <!-- Export time series --> <exportTimeSeriesActivity> <description>Export inflows for Sobek Como Lake model</description> <exportFile>Input_Como_Pi.xml</exportFile> <timeSeriesSets> <timeSeriesSet> <moduleInstanceId>Sobek_MergeInput_Forecast_COSMO</moduleInstanceId> <valueType>scalar</valueType> <parameterId>Q.simulated.forecast</parameterId> <locationId>Adda23635</locationId> <timeSeriesType>simulated forecasting</timeSeriesType> <timeStep unit="hour" multiplier="1"/> <relativeViewPeriod unit="hour" endOverrulable="true" end="72"/> <readWriteMode>read only</readWriteMode> <ensembleId>CosmoLeps</ensembleId> </timeSeriesSet> <timeSeriesSet> <moduleInstanceId>Interpolation_Sobek_Forecast</moduleInstanceId> <valueType>scalar</valueType> <parameterId>H.forecast.external</parameterId> <locationId>I-203000</locationId> <timeSeriesType>external forecasting</timeSeriesType> <timeStep unit="hour" multiplier="1"/> <relativeViewPeriod unit="hour" endOverrulable="true" end="72"/> <readWriteMode>read only</readWriteMode> </timeSeriesSet> </timeSeriesSets> </exportTimeSeriesActivity> </exportActivities> <!-- Export activities --> <!-- Execute activities:Run SOBEK Adapter, Batch tool --> <executeActivities> <executeActivity> <command> <className>nl.wldelft.fews.adapter.sobek.PreSobekModelAdapter</className> </command> <arguments> <argument>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%</argument> <argument>../Config/sobekConfig.xml</argument> </arguments> <timeOut>500000</timeOut> <overrulingDiagnosticFile>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/diagnostics/presobekmodeladapter.xml</overrulingDiagnosticFile> </executeActivity> <!-- Run Condor --> <executeActivity> <description>Condor Batch script by Frederik</description> <command> <executable>%ROOT_DIR%\run_condor_sobek.bat</executable> </command> <arguments> <argument>-o</argument> <argument>\\$CONDOR_REMOTE_DIR$\SbkParallel</argument> <argument>-n</argument> <argument>17</argument> <argument>-t</argument> <argument>18000000</argument> <argument>-d</argument> <argument>\\$CONDOR_REMOTE_DIR$\SbkParallel</argument> </arguments> <!-- timeout in milliseconds: 30min x 60sec --> <timeOut>19000000</timeOut> <ignoreDiagnostics>true</ignoreDiagnostics> </executeActivity> <executeActivity> <command> <className>nl.wldelft.fews.adapter.sobek.PostSobekModelAdapter</className> </command> <arguments> <argument>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%</argument> <argument>../Config/sobekConfig.xml</argument> </arguments> <timeOut>500000</timeOut> <overrulingDiagnosticFile>%ROOT_DIR%/%ENSEMBLE_MEMBER_ID%/diagnostics/postsobekmodeladapter.xml</overrulingDiagnosticFile> </executeActivity> </executeActivities> <importActivities> <!-- Import Sobek results--> <importTimeSeriesActivity> <description>Import XML file</description> <importFile>reachseg.xml</importFile> <timeSeriesSets> <timeSeriesSet> <moduleInstanceId>Sobek_Po_Como_Forecast_COSMO_Parallel</moduleInstanceId> <valueType>scalar</valueType> <parameterId>Q.simulated.forecast</parameterId> <locationId>Serbatoio_Como235</locationId> <timeSeriesType>simulated forecasting</timeSeriesType> <timeStep unit="hour" multiplier="1"/> <readWriteMode>add originals</readWriteMode> <expiryTime unit="day" multiplier="2"/> <ensembleId>CosmoLeps</ensembleId> </timeSeriesSet> </timeSeriesSets> </importTimeSeriesActivity> </importActivities> </activities> </generalAdapterRun> |
...
From the example above we see that the general adapter executes a batch script with a number of arguments
Code Block | ||||
---|---|---|---|---|
| ||||
<!-- Run Condor --> <executeActivity> <description>Condor Batch script by Frederik</description> <command> <executable>%ROOT_DIR%\run_condor_sobek.bat</executable> </command> <arguments> <argument>-o</argument> <argument>\\$CONDOR_REMOTE_DIR$\SbkParallel</argument> <argument>-n</argument> <argument>17</argument> <argument>-t</argument> <argument>18000000</argument> <argument>-d</argument> <argument>\\$CONDOR_REMOTE_DIR$\SbkParallel</argument> </arguments> <!-- timeout in milliseconds: 30min x 60sec --> <timeOut>19000000</timeOut> <ignoreDiagnostics>true</ignoreDiagnostics> </executeActivity> |
...