CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens

HPC and subroutines

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 21, 2003, 10:10
Default HPC and subroutines
  #1
Steve
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
  Reply With Quote

Old   February 21, 2003, 11:38
Default Re: HPC and subroutines
  #2
jimbo
Guest
 
Posts: n/a
Yes there is. The "nice" way to exit your user subroutine is to call stquit().
  Reply With Quote

Old   February 21, 2003, 12:25
Default Re: HPC and subroutines
  #3
cjtune
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?
  Reply With Quote

Old   February 24, 2003, 12:48
Default Re: HPC and subroutines
  #4
jimbo
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.
  Reply With Quote

Old   February 24, 2003, 20:46
Default Re: HPC and subroutines
  #5
CJ Tune
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?

  Reply With Quote

Old   February 25, 2003, 09:43
Default Re: HPC and subroutines
  #6
jimbo
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....
  Reply With Quote

Old   February 25, 2003, 10:36
Default Re: HPC and subroutines
  #7
cjtune
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.
  Reply With Quote

Old   February 25, 2003, 11:47
Default Re: HPC and subroutines
  #8
jimbo
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 ...
  Reply With Quote

Old   February 25, 2003, 21:23
Default Re: HPC and subroutines
  #9
CJ Tune
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.
  Reply With Quote

Old   February 26, 2003, 08:05
Default Re: HPC and subroutines
  #10
Steve
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
  Reply With Quote

Old   February 28, 2003, 12:39
Default Re: HPC and subroutines
  #11
jimbo
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.
  Reply With Quote

Old   March 1, 2003, 01:01
Default Re: HPC and subroutines
  #12
cjtune
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.
  Reply With Quote

Old   March 3, 2003, 06:02
Default Re: HPC and subroutines
  #13
Steve
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.

  Reply With Quote

Old   March 3, 2003, 11:19
Default Re: HPC and subroutines
  #14
cjtune
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?
  Reply With Quote

Old   March 3, 2003, 12:49
Default Re: HPC and subroutines
  #15
Steve
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.
  Reply With Quote

Old   March 4, 2003, 00:53
Default Re: HPC and subroutines
  #16
cjtune
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.
  Reply With Quote

Old   March 4, 2003, 04:36
Default Re: HPC and subroutines
  #17
Steve
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.
  Reply With Quote

Old   March 4, 2003, 06:35
Default Re: HPC and subroutines
  #18
cjtune
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?
  Reply With Quote

Old   March 5, 2003, 15:19
Default Re: HPC and subroutines
  #19
steve
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
  Reply With Quote

Old   March 5, 2003, 21:08
Default Re: HPC and subroutines
  #20
cjtune
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.

  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 04:08.