Role: Class faciliting how the Surface Process Model control is organised, and for holding the top-level objects needed by the application.
Comments: Ogar's old description: Description : Implement the Catch and Hold Algorithm for Parallel SPModel Phase 1 :
Build and sort the hold list
Determine the receiver and providers of each node
Determine the depth and self->nproc of each node Phase 2 :
Allocate catchments and nodes to processors Phase 3 :
Calculations in timestep and update of values & states (parallel)
Ogar's old ChangeLog: Date created : 18 June 2003 Dates updated : 26 June 2003 Store nodes in globalNodes array, created maxCatchmentList 30 June 2003 Modify assignDepth requirements and delete() function -> bugs fixed -> Phase 1 works perfectly Create a seperate function buildWaterNetwork() which contains the Phase 1 codes 01 July 2003 Modify maxCatchmentList into a linked list instead of array of Catchments (since we do not know how many they are and also easier to sort) Added assignCatchments() and successfully sorted the maxCatchmentList (descending order) 04 July 2003 Written computeHaloNodes() - tested and working fine Put numNeigh as global 07 July 2003 Fix the bug - processorNodes[add], pass address of "add" instead of the value Send myLoad to each processor 11 July 2003 Broken up main.c into main.c, phase1.c, and phase2.c and same for the header files Move some contents of main.c (global variables & structs) into declaration.h, which is included in phase1.h and phase2.h too 29 July 2003 Make globalNodes to be global variable 30 July 2003 Starting Phase 3 : send nodes to their processors - tested successfully for one proc only 31 July 2003 Successfully sent the nodes to their processors - tested on 5 processors & received correctly Declare and initialize numHaloNodes in main() and pass it as parameter to computeHaloNodes() Sent the number of halo nodes to every processor Re-arrangements : determine and send all the processor nodes first then the halo nodes afterwards Successfully sent the Halo Nodes to each processor, and received correctly - tested on 5 procs 04 Aug 2003 Determined ForeignHaloNodes, ForeignOutflowHaloNodes, InflowHaloNodes and sent them to processors 08 Aug 2003 Create receiveNodes() separate from main() and later need to put it in a seperate file called phase3.c Put the node arrays as global variables in the declaration.h 11 Aug 2003 Written function propagateDepthChanges() - compiled but not yet tested 13 Aug 2003 Added the XML input variables 14 Aug 2003 Sorted myNodes by depth Added surface and boundary variables to node structure 15 Aug 2003 Added h0 and hi arrays Send data from other processors to processor 0 to determine the timestep (ensure a single value of dt for all procs) 19 Aug 2003 Call fluvial_erosion() - working with single or multiple processors now (tested on single time step) Need extra handling when the receiver node is on other processor (not just update myHaloNodes, but also myNodes of the OTHER processor) 20 Aug 2003 fluvial_erosion() is working fine, but there might be a problem if processors are waiting for each other Create a file phase3.c and its header phase3.h which contains receiveNodes(), fluvial_erosions(), and propagateDepthChanges() 26 Aug 2003 Added slope, length, and nlake into node structure 28 Aug 2003 Written codes to update bedrock and update time step 02 Sept 2003 Written updateFlows() and put it in phase3.c 04 Sept 2003 Update the state of HaloNodes and send them across processors Proc 0 sends delta to all other processors 05 Sept 2003 When sending HaloNodes, send only the necessary data as required (may need to change later) 08 Sept 2003 Need to re-order MyNodes by depth in every iteration (since the node depths may change due to changes in receiver/providers) Need to define the global to local mapping array in each iteration since the order of nodes in MyNodes may change after re-ordering 09 Sept 2003 Declare iadapt, sidex, sidey here instead of inside buildWaterNetwork(), then pass them as parameters to it 11 Sept 2003 I found out that we need to include Node.receiver in the HaloNodes, foreignHaloNodes, foreignOutflowHaloNodes, and inflowHaloNodes