|
[Sponsors] |
February 21, 2003, 10:10 |
HPC and subroutines
|
#1 |
Guest
Posts: n/a
|
Hi,
I have a user subroutine, the body of which is only executed by node 0 for an HPC job. That subroutine may want (need) to shut down the whole job. Is there an undocumented subroutine/function call in StarCD that I can call to effect this? Currently it calls the FORTRAN STOP statement, which stops node 0, leaving the other nodes hanging. I cannot find anything in the HPC manual that seems to apply. Any advise greatfully accepted. - Steve |
|
February 21, 2003, 11:38 |
Re: HPC and subroutines
|
#2 |
Guest
Posts: n/a
|
Yes there is. The "nice" way to exit your user subroutine is to call stquit().
|
|
February 21, 2003, 12:25 |
Re: HPC and subroutines
|
#3 |
Guest
Posts: n/a
|
But does it nicely shut down STAR as well? Maybe a 'call system' statement that does a 'touch ABORT' (may need to use with ssh or rsh command) on all working directories?
|
|
February 24, 2003, 12:48 |
Re: HPC and subroutines
|
#4 |
Guest
Posts: n/a
|
sounds complicated!
In your subroutine include; if(everything goes wrong) call stquit(1) and your STAR run will die, all of it. |
|
February 24, 2003, 20:46 |
Re: HPC and subroutines
|
#5 |
Guest
Posts: n/a
|
Is stquit() a STAR function or standard Fortran function? Will it properly save the last iteration's data in the post file?
|
|
February 25, 2003, 09:43 |
Re: HPC and subroutines
|
#6 |
Guest
Posts: n/a
|
If you want the process to stop and write out a .pst file then stquit is not for you. stquit, is a replacement for the FORTRAN 'STOP' (FYI it is a STAR routine).
If you want to exit and write out a pst file, then you can do this by creating an ABORT file on the master node (only, you don't really need to have one in each subdirectory). You could probably do something clever with a gsum of a variable and a test on the master node, which would then create your ABORT file. I think that would be easier than going into system commands etc.... |
|
February 25, 2003, 10:36 |
Re: HPC and subroutines
|
#7 |
Guest
Posts: n/a
|
Thanks jimbo. I toyed with HPC for awhile (demo license) and was thinking along the lines of something like the C3 (http://www.csm.ornl.gov/torc/C3/) suite of command-line programs where you can execute commands on all nodes simultaneously. But since you only need to create an ABORT file on the master node, I guess it's really much easier then.
BTW, how can I find out more about 'undocumented' STAR routines? I only knew of two before (gloloc and locglo) and today, stquit. |
|
February 25, 2003, 11:47 |
Re: HPC and subroutines
|
#8 |
Guest
Posts: n/a
|
As you may have guessed, I work for CD adapco, hence my knowledge of things like stquit. You should be able to get some info from your support engineer although, understandably, not every support engineer has an in-depth knowledge of advanced user coding techniques.
The other way is to go on the User Subroutines course which, in my opinion, is very good and is used a lot internally for top user coding tips. If anyone (who doesn't work for CD adapco) who has been on the User Coding course, perhaps they could give their comments ... |
|
February 25, 2003, 21:23 |
Re: HPC and subroutines
|
#9 |
Guest
Posts: n/a
|
Well, I haven't gone to the course yet but I do have the course notes (.pdf format) left over from my predecessors. I running solely on elbow grease...
It's quite comprehensive but a bit dated. Windows users will be puzzled at first when their usubs don't work because now the COMMON blocks are referenced by pointers (have to specify the COMMON pointers too in the usub). Found this out when comparing between starin.f from the Windows v3.15 and UNIX v3.15 but not after some angst in trying to root out a bug that wasn't there in the first place. I'm still stuck on a couple of issues (last checked: yet unanswered on this forum), and the support engineer was quick in supplying me some sample user coding -but unfortunately gave only very scant explanation as to how anything works. Although STAR-CD usub coding is not yet 'general knowledge' amongst users, I appreciate the fact that CD-Adapco has made a solid product with a very 'open' architecture. Of course I also understand that CD-A cannot document or make public everything that is in the code to avoid giving away the tricks-of-the-trade to competitors. |
|
February 26, 2003, 08:05 |
Re: HPC and subroutines
|
#10 |
Guest
Posts: n/a
|
Thanks for the comments guys.
I think I'll try how stquit()performs. Sounds like yet another undocumented facet of user subroutine use. Are there any platform dependencies or is it a wrapper around them? - Steve |
|
February 28, 2003, 12:39 |
Re: HPC and subroutines
|
#11 |
Guest
Posts: n/a
|
Hi,
CJ, if you look at either the release or sup notes for the Windows port you will find the documentation of pointers for common blocks on windows. Steve, there are no system specific issues relating to stquit. Bye. |
|
March 1, 2003, 01:01 |
Re: HPC and subroutines
|
#12 |
Guest
Posts: n/a
|
Thanks jimbo. I found it eventually on pg 4 of the FAQ.
Does CD-A plan/has any documentation on internal STAR routines like stquit()? I found it appears only exactly once in the User Subroutine training notes... Others like GLOLOC and LOCGLO (which are useful if you have multiple axes of rotation in a model to manipulate) I had to find out from support and was never public, as far I could remember. |
|
March 3, 2003, 06:02 |
Re: HPC and subroutines
|
#13 |
Guest
Posts: n/a
|
Given that StarCD is simply a monolithic hunk of FORTRAN code shipped as a set of objects and libraries, you could, in theory, call any proprietary function or subroutine if you knew it's argument list. And I bet there are many user routines out there based on hints/tips/insider knowledge given out by current or former Star personnel.
The fun starts when one Star office recommends using an undocumented routine or common block, whilst another Star office is in the process of removing it from the code for ever. |
|
March 3, 2003, 11:19 |
Re: HPC and subroutines
|
#14 |
Guest
Posts: n/a
|
Dang, I'm being drawn into 'underground' STAR-CD... the 'back-alleys' of coding.
Er, are you in any position to give tips? I would particularly like to know what flip32 does... or is there any routine for you to 'point' to a particular event arbitrarily and have it executed regardless of event time? |
|
March 3, 2003, 12:49 |
Re: HPC and subroutines
|
#15 |
Guest
Posts: n/a
|
Er, sorry no. I'm not that same "Steve" that hangs around here occasionally and seems to maybe work for either CD or Adapco.
Given its name, I reckon flip32 could be a byte swapping routine. Just a guess though. |
|
March 4, 2003, 00:53 |
Re: HPC and subroutines
|
#16 |
Guest
Posts: n/a
|
Dang, I was hoping you were. Well, that'll be an open question to all the Steves in this forum. Thanks.
|
|
March 4, 2003, 04:36 |
Re: HPC and subroutines
|
#17 |
Guest
Posts: n/a
|
Nope. He spells his name with a lower case "s". My interest in user routines is using them to couple 1D and 3D codes, StarCD being one such 3D code.
|
|
March 4, 2003, 06:35 |
Re: HPC and subroutines
|
#18 |
Guest
Posts: n/a
|
GTPower? Wave? I take it you need to subroutines to help map the results at some node of your 1D code as transient boundary conditions for a STAR-CD model -ICE, perhaps?
|
|
March 5, 2003, 15:19 |
Re: HPC and subroutines
|
#19 |
Guest
Posts: n/a
|
Could you not set up a conditional event? If you look at the EICOND, you can force an event to happen in the user subroutine UBINIT. It appears that you can make events happen anytime you want that way.
If I capitalize the first letter of my name nobody would ever know who was talking to who. Steve |
|
March 5, 2003, 21:08 |
Re: HPC and subroutines
|
#20 |
Guest
Posts: n/a
|
Why don't you guys postfix something to your nicks, like Steve3:69 or steve_wonder?
Tried that at first when I couldn't figure out the sample usub supplied by support (that uses some obscure method of reading from I/O 32, using flip32(,,), and the variable ETIMEJ). By golly I was really hoping it would work but somehow ProSTAR hangs when I try to declare: (previous two events 1 and 2 are partial sliding events) *SET EVTN 2 1 *SET CTYS 49 1 *SET CLAM 150 *DEFI NOEX EVCN EVTN EDDI LOCAL 2 3 EDCE ADD CTYPE CTYS !or EACE DELE CTYPE CTYS EVSA EVTN *END *LOOP 1 CLAM - 1 ...specifically when executing EDCE or EACE. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
subroutines in UDF | kk | FLUENT | 3 | February 9, 2007 02:38 |
CFX subroutines | Neser | CFX | 0 | November 9, 2005 00:07 |
subroutines | Jared | Siemens | 1 | August 25, 2005 14:38 |
fft subroutines | pratap | Main CFD Forum | 1 | August 6, 2003 17:49 |
User subroutines | Mir | Siemens | 10 | May 4, 2002 17:16 |