|
[Sponsors] |
January 25, 2016, 10:47 |
Run a user fortran routine in parallel
|
#1 |
New Member
Jure Ravnik
Join Date: Aug 2015
Posts: 1
Rep Power: 0 |
Hello everybody,
we have written a rather large user fortran model, which runs perfectly when running CFX on a single processor. In order to be able to use our user fortran model in parallel, we would like to know, how to get the processor number in user fortran. Namely, we would like to have only one processor writing the results and others skipping this step. In short, we would like to do myproc = the number of parallel thread nproc = number of all threads IF (myproc.EQ.1) THEN CALL DoSomething END IF The question is how to get myproc and nproc? Thank you for your answers! |
|
January 25, 2016, 11:41 |
|
#2 | |
Senior Member
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33 |
Worth reading the documentation. For example,
Quote:
|
||
March 28, 2017, 05:35 |
|
#3 |
New Member
Tony
Join Date: Mar 2016
Posts: 24
Rep Power: 10 |
Thanks for the hints. I got the same problem and fixed it. The solver crashed if my subroutine wrote a result file in the parallel mode.
Now a result file is written only if the master processor calls my user routine. Here is the code block concerning output: CALL GET_PARALLEL_INFO ('PARMOD',PAR_MODE,CNAME,CRESLT) if (PAR_MODE .EQ. 1) THEN open(12,FILE='PressureRecordFile',POSITION = 'APPEND') write(12,*) CTSTEP close(12) ENDIF Hope it helps people who also work with user routine. |
|
Tags |
cfx, parallel computation, user fortran |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Salome] Salome import "Cannot find file "points" in directory..." | mismichael | OpenFOAM Meshing & Mesh Conversion | 6 | June 24, 2024 04:17 |
parallel run is slower than serial run (pimpleFoam) !!! | mechy | OpenFOAM | 18 | August 17, 2016 18:19 |
simpleFoam in parallel issue | plucas | OpenFOAM Running, Solving & CFD | 3 | July 17, 2013 12:30 |
User fortran routines, DEBUG AND OUTPUT | Bloshchitsyn Vladimir | CFX | 5 | October 29, 2007 02:31 |
user subroutine error | CFDUSER | CFX | 2 | December 9, 2006 07:31 |