From 7152a232feeffabafc7617a5a8d867588d8ceaf4 Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Mon, 7 Dec 2020 17:58:33 +0100 Subject: [PATCH] Separating CPU time output from Data outut to allow better analysis. --- runs/1D_Cathode/input.json | 4 ++-- runs/ALPHIE_Grid/input.json | 5 +++-- runs/cylFlow/input.json | 2 +- src/modules/moduleInput.f95 | 9 ++++++++- src/modules/moduleOutput.f95 | 3 ++- src/modules/moduleSolver.f95 | 16 +++++++++++++--- 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/runs/1D_Cathode/input.json b/runs/1D_Cathode/input.json index 21a85b9..fe9e9d5 100644 --- a/runs/1D_Cathode/input.json +++ b/runs/1D_Cathode/input.json @@ -2,7 +2,7 @@ { "output": { "path": "./runs/1D_Cathode/", - "trigger": 100, + "triggerOutput": 100, "cpuTime": false, "numColl": false, "EMField": true @@ -26,7 +26,7 @@ ], "boundaryEM": [ {"name": "Cathode", "type": "dirichlet", "potential": 0.0, "physicalSurface": 1}, - {"name": "Infinite", "type": "dirichlet", "potential": 600.0, "physicalSurface": 2} + {"name": "Infinite", "type": "dirichlet", "potential": 100.0, "physicalSurface": 2} ], "inject": [ {"name": "Cathode Electron", "species": "Electron", "flow": 9.0e-5, "units": "A", "v": 27500.0, "T": [2500.0, 2500.0, 2500.0], "n": [ 1, 0, 0], "physicalSurface": 1} diff --git a/runs/ALPHIE_Grid/input.json b/runs/ALPHIE_Grid/input.json index 0011588..1e1e360 100644 --- a/runs/ALPHIE_Grid/input.json +++ b/runs/ALPHIE_Grid/input.json @@ -1,8 +1,9 @@ { "output": { "path": "./runs/ALPHIE_Grid/", - "trigger": 500, - "cpuTime": false, + "triggerOutput": 500, + "triggerCPUTime": 1, + "cpuTime": true, "numColl": false, "EMField": true }, diff --git a/runs/cylFlow/input.json b/runs/cylFlow/input.json index bdef229..3dd4b77 100644 --- a/runs/cylFlow/input.json +++ b/runs/cylFlow/input.json @@ -1,7 +1,7 @@ { "output": { "path": "./runs/cylFlow/", - "trigger": 10, + "triggerOutput": 10, "cpuTime": true, "numColl": false }, diff --git a/src/modules/moduleInput.f95 b/src/modules/moduleInput.f95 index 5618df4..05813d3 100644 --- a/src/modules/moduleInput.f95 +++ b/src/modules/moduleInput.f95 @@ -193,7 +193,7 @@ MODULE moduleInput object = 'output' CALL config%get(object // '.path', path, found) - CALL config%get(object // '.trigger', triggerOutput, found) + CALL config%get(object // '.triggerOutput', triggerOutput, found) IF (.NOT. found) THEN triggerOutput = 100 CALL warningError('Using default trigger for output file of 100 iterations') @@ -211,6 +211,13 @@ MODULE moduleInput CALL config%get(object // '.numColl', collOutput, found) CALL config%get(object // '.EMField', emOutput, found) + CALL config%get(object // '.triggerCPUTime', triggerCPUTime, found) + IF (.NOT. found) THEN + triggerCPUTime = triggerOutput + IF (timeOutput) CALL warningError('No triggerCPUTime found, using same vale as triggerOutput') + + END IF + END SUBROUTINE readOutput !Reads information about the case species diff --git a/src/modules/moduleOutput.f95 b/src/modules/moduleOutput.f95 index fe1df6f..33d9a94 100644 --- a/src/modules/moduleOutput.f95 +++ b/src/modules/moduleOutput.f95 @@ -22,7 +22,8 @@ MODULE moduleOutput CHARACTER(:), ALLOCATABLE:: path CHARACTER(:), ALLOCATABLE:: folder - INTEGER:: triggerOutput, counterOutput + INTEGER:: triggerOutput, counterOutput = 0 + INTEGER:: triggerCPUTime, counterCPUTime = 0 LOGICAL:: timeOutput = .FALSE. LOGICAL:: collOutput = .FALSE. LOGICAL:: emOutput = .FALSE. diff --git a/src/modules/moduleSolver.f95 b/src/modules/moduleSolver.f95 index b05bc59..b8708ee 100644 --- a/src/modules/moduleSolver.f95 +++ b/src/modules/moduleSolver.f95 @@ -555,15 +555,14 @@ MODULE moduleSolver INTEGER, INTENT(in):: t - counterOutput=counterOutput+1 - IF (counterOutput>=triggerOutput .OR. & + counterOutput = counterOutput + 1 + IF (counterOutput >= triggerOutput .OR. & t == tmax .OR. t == 0) THEN !Resets output counter counterOutput=0 CALL mesh%printOutput(t) - CALL printTime(t, t == 0) CALL mesh%printColl(t) CALL mesh%printEM(t) WRITE(*, "(5X,A21,I10,A1,I10)") "t/tmax: ", t, "/", tmax @@ -584,6 +583,17 @@ MODULE moduleSolver END IF + counterCPUTime = counterCPUTime + 1 + IF (counterCPUTime >= triggerCPUTime .OR. & + t == tmax .OR. t == 0) THEN + + !Reset CPU Time counter + counterCPUTime = 0 + + CALL printTime(t, t == 0) + + END IF + END SUBROUTINE doOutput