Environment variable ($MPI_PROCS) in decomposeParDict
this is my second post, so please excuse me if the question is pretty stupid.
I'm trying to run a OpenFOAM case on a super-computer with PBS queue manager. In the launch script I create the environment variable MPI_PROCS that contains the number of CPU that i'm using.
Is it possible to use this variable as number of subdomain in the decomposeParDict? (I'm using the scotch/ptscotch method, so I don't have to bother about the number of subdomain in other options)
I've tried to set just $MPI_PROCS in the place of the number of subdomain, but it gives me the error "Bad token in decomposeParDict ....etc etc".
PS: I'm not even very sure of what i'm saying, but could it be that i need to "export" the variable from the launch script to the variables of the run? (excuse me if my language is not technically correct, but I'm not a computer technician, I don't even now very well what environment variables are...)
Ok; this might not be what you want, but this is my solution to this problem:
However, if someone has a method of getting environment variables directly in a dictionary, that would be great, as this method is a bit "dirty".
Thank you very much haakon.
I see what you mean when you say that it's a bit "dirty", but it does exactly what I need.
It saves me from change that damn number every time i need to change number of CPU.
Thank you very much for the tip ;)
|All times are GMT -4. The time now is 01:39.|