Author Topic: Error Running Dakota: Expected 0 gradients but found 1.  (Read 4750 times)

xln

  • Newbie
  • *
  • Posts: 2
    • View Profile
Error Running Dakota: Expected 0 gradients but found 1.
« on: December 05, 2022, 07:07:10 AM »
Hi, I tried to run my own case using quoFEM and it works fine locally. The logs report a Dakota error that I don't understand.

Code: [Select]
14:27:05 Running response simulation
FMK COMMAND: "D:\quoFEM_Windows_Download\applications\python\python.exe" "D:\quoFEM_Windows_Download\applications\performUQ\dakota\DakotaUQ.py" "--workflowInput" "scInput.json" "--driverFile" "driver" "--workflowOutput" "EDP.json" "--runType" "runningLocal"
         Simulation command:

"D:\quoFEM_Windows_Download\applications\python\python.exe" "D:\quoFEM_Windows_Download\applications\performUQ\dakota\DakotaUQ.py" "--workflowInput" "scInput.json" "--driverFile" "driver" "--workflowOutput" "EDP.json" "--runType" "runningLocal"

Output:

EVAL CONCURRENCY: 20
CWD: D:\Documents\quoFEM\LocalWorkDir\tmp.SimCenter\templatedir
running Dakota:  dakota -input dakota.in -output dakota.out -error dakota.err


         Response simulation finished successfully.
         -----------------------------------------------------------------------

14:29:23 - Analysis done
14:29:23 - Error Running Dakota: Expected 0 gradients but found 1.
14:29:23 - Analysis complete

This is a time history analysis to calculate the top-level displacement of a reinforced concrete frame in an earthquake. Forward propagation LHS is used with a total of 6 random variables. I looked up the local cache path tmp.SimCenter and found that the calculation stops at workdir.20. Theoretically there should be workdir.50. Anyone who can help me is greatly appreciated :)

Sang-ri

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 61
    • View Profile
Re: Error Running Dakota: Expected 0 gradients but found 1.
« Reply #1 on: December 05, 2022, 08:02:54 PM »
Hello, thanks for posting the issue!

Perhaps the model output file (results.out) is not written in the correct format. To check this, please inspect the "results.out" file under the cache folder "LocalWorkDir\tmp.SimCenter\workdir.1". The file should contain only the numbers and spaces (or tabs) and not the brackets. Dakota uses brackets to indicate the gradient values of the model - so having additional brackets there could have prompted the error.

If this is the case, please modify your main or postprocessing FEM scripts such that it only writes the numbers. If this is not the case, can you please share the below two files with us to help us identify the cause of the error?
(1)LocalWorkDir\tmp.SimCenter\workdir.1\results.out
(2)LocalWorkDir\tmp.SimCenter\dakota.in

Thanks,
Sang-ri

xln

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Error Running Dakota: Expected 0 gradients but found 1.
« Reply #2 on: December 07, 2022, 05:14:40 AM »
Hello, thanks for posting the issue!

Perhaps the model output file (results.out) is not written in the correct format. To check this, please inspect the "results.out" file under the cache folder "LocalWorkDir\tmp.SimCenter\workdir.1". The file should contain only the numbers and spaces (or tabs) and not the brackets. Dakota uses brackets to indicate the gradient values of the model - so having additional brackets there could have prompted the error.

If this is the case, please modify your main or postprocessing FEM scripts such that it only writes the numbers. If this is not the case, can you please share the below two files with us to help us identify the cause of the error?
(1)LocalWorkDir\tmp.SimCenter\workdir.1\results.out
(2)LocalWorkDir\tmp.SimCenter\dakota.in

Thanks,
Sang-ri

Sang-ri, thank you so much! You pointed out the real problem! I changed the 'write file' statement of post.py, and then quoFEM successfully displayed the simulation result data. The key is the way Dakota.in is set up, stating no gradients and no hessians.

Sang-ri

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 61
    • View Profile
Re: Error Running Dakota: Expected 0 gradients but found 1.
« Reply #3 on: December 07, 2022, 05:27:59 PM »
Glad to know it worked. Thanks for letting us know! :D