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

Check license before running on the cluster

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 13, 2013, 10:09
Question Check license before running on the cluster
  #1
New Member
 
Join Date: Aug 2013
Posts: 2
Rep Power: 0
vbaros is on a distinguished road
Here is my problem:

I'm running CFX on the Microsoft HPC cluster 2008 R2 without any problems.

The problem I'm having is that the job will fail if there are no licenses available.
I have a general idea how I could create a submission filter for the HPC cluster.

What I would like to do is to be able to check the number of nodes/elements the job is using before job is submitted. Is there an API or a command line tool I could use to check this?

I want to do this because for example, if a job has more than 500000 elements it would require a Research license, <500000 means the jobs would use a student license (if also number of required nodes is <=4).

Can anyone help?
vbaros is offline   Reply With Quote

Old   August 13, 2013, 20:19
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
We implemented a license queuing system using PBS here at work. It was not straight forward and needed support from PBS to get it going, but it did work well once set up. I do not know of any easy way of doing it elsewhere - you will probably have to write your own script to call lmstat.exe and parse the returned file and decide whether enough licenses are available.
ghorrocks is offline   Reply With Quote

Old   August 14, 2013, 03:04
Default
  #3
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
There is a -preferred-license flag you can use in cfx5solve, but Im not sure how to get the number of nodes/cells in the .def file before running it. You might be able to get it if you run cfx5solve with -check-only and parse the output, if it prints the mesh info.
Lance is offline   Reply With Quote

Old   August 14, 2013, 03:33
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
If you use lmstat.exe it will return the status of the licenses. You can parse that file to extract the currently available number of licenses. Then feed that into PBS or your own gizmo which controls simulation execution and I think you have the question answered. And rather than extract the number of partitions in the def file it will probably be easier to set that when you run it so it is known.
ghorrocks is offline   Reply With Quote

Old   August 14, 2013, 03:38
Default
  #5
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
But the question was how to (automagically?) use student licenses when the number of nodes in the mesh was <500 000, and use research licenses for larger jobs. Then s/he need to know the number of nodes in the .def file before submitting the job to the scheduler.
Lance is offline   Reply With Quote

Old   August 14, 2013, 03:44
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Good point Maybe I should read questions a little more closely in future.

You could probably run a CFD-Post session file which loads a def file and returns count()@domain. That might do it.
ghorrocks is offline   Reply With Quote

Old   August 14, 2013, 03:57
Default
  #7
New Member
 
Join Date: Aug 2013
Posts: 2
Rep Power: 0
vbaros is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
Good point Maybe I should read questions a little more closely in future.

You could probably run a CFD-Post session file which loads a def file and returns count()@domain. That might do it.
We are on a right track now
Can you please write me an example?
vbaros is offline   Reply With Quote

Old   August 14, 2013, 04:33
Default
  #8
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
How about I tell you how to do it:

Load up CFD-Post, turn on recording a session file. Load up a def file and do a CEL function count()@domain (replace with the domain name). Not sure of the best way to return this value, you will have to try some options.

Also - what about a simple approach. How about you have a script which runs it using the node limited license and if bombs out it runs it again with the full license? This sounds simpler to implement, even if it is less elegant.
ghorrocks is offline   Reply With Quote

Old   August 14, 2013, 04:34
Default
  #9
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
here's a session file with some PERL that outputs the number of nodes in Default Domain to tmp.txt

Code:
COMMAND FILE:
  CFX Post Version = 14.5
END

DATA READER:
  
  Clear All Objects = false
  Append Results = false
  Edit Case Names = false
  Open to Compare = false
  Multi Configuration File Load Option = Last Case
  Open in New View = true
  Keep Camera Position = true
  Load Particle Tracks = true
  Files to Compare =
END

DATA READER:
  Domains to Load=
END
> load filename=##YOUR.DEFFILE##, force_reload=\
true

!$outfile = "tmp.txt";
!open(OUT, ">$outfile");
!$nodes = count("Default Domain");
!print OUT $nodes;
!close(OUT);
save it as sessionfile.cse and run
cfdpost -batch sessionfile.cse
Lance is offline   Reply With Quote

Reply

Tags
cfx hpc cluster license


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
License Error lffabiani CFX 2 June 30, 2011 21:51
Fluent Error while running on cluster amoolraina FLUENT 5 March 4, 2011 05:55
Running in Parallel on cluster NewFoamer OpenFOAM Running, Solving & CFD 3 November 3, 2010 17:20
Statically Compiling OpenFOAM Issues herzfeldd OpenFOAM Installation 21 January 6, 2009 10:38
Kubuntu uses dash breaks All scripts in tutorials platopus OpenFOAM Bugs 8 April 15, 2008 08:52


All times are GMT -4. The time now is 11:25.