Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Process status API?

Intel_C_Intel
Employee
1,168 Views
In my continuing battle to build a distributed computing capability in an environment where I don't have admin access.........
I am trying to write a remote process monitor and contoller. Specifically, I would like to "get" the PID for a particular process, set it's priority, check forits CPU and memory usageand kill it if I have an indication that it isn't working right. I can get the PID from CreateProcess when I start the task, but would really like to be able to get it from another console session on the same system.I could usethe functions in PSAPI.dll, but there doesn't seem to be a wrapper in CVF for these functions. It also seems like there should be a way toset the process priority after it has been started, similar to the Windows TaskManager GUI, but I can't seem to find it.
Does anyone have or know where Fortran interfaces to PSAPI can be found?
Any suggestions for alternatives?
Thanks, Cliff

Message Edited by frieler on 03-22-2004 11:14 AM

0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
1,168 Views
It also seems like there should be a way toset the process priority after it has been started, similar to the Windows TaskManager GUI, but I can't seem to find it.
Not exactly my area, but SetPriorityClass appears to do that (and SetProcessPriorityBoost is related).
Does anyone have or know where Fortran interfaces to PSAPI can be found?
Any suggestions for alternatives?
No, but Psapi.h (found in VS .NET) is just 380 sparse lines, half of which are UNICODE versions (*W), which you probably don't need. It shouldn't take more than a half hour to translate it to Fortran (you probably want LPCSTR's -> CHARACTER(*) + !DEC$ATTRIBUTES REFERENCE).
However, I don't find Psapi.lib in my copy of VC++ 6, and I doubt whether the one from VS.NET is compatible with CVF. You could probably roll your own as well if you don't have one from older platform SDK (dumpbin /exports -> manual .DEF file editing -> lib /DEF), but I've never done that myself.
Jugoslav
0 Kudos
Reply