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

POSIX tutorial

dondilworth
Novo colaborador II
4.174 Visualizações

Today I'm looking into the POSIX routines, hoping to get multi-processor efficiency.  I have the standard documentation for all the library and function calls, but for a beginner I still have a zillion questions.  Can anyone point me to a good tutorial on the subject?  I'd hate to pester experts with dumb (to them) questions.

DD

0 Kudos
26 Respostas
dondilworth
Novo colaborador II
980 Visualizações

Super!  It works perfectly, thank you.

andrew_4619
Colaborador honorário III
980 Visualizações

If the polling loop is causing a lot of cpu activity, put a very short sleepqq of a handfulll of milliseconds in the loop. that usually makes a big differance.

dondilworth
Novo colaborador II
980 Visualizações

Ooops... Not perfect.  The path that comes back from GET_COMMAND is

"C:\SYNOPSYSV14\.\Debug\SYNOPSYS200v14.exe"

What the spawnl() needs is

"C:/SYNOPSYSV14/Debug/SYNOPSYS200v14.exe"

So the spawnl() doesn't work.  Is there an easy way to convert that format?  Or should I process the line character by character myself?

andrew_4619
Colaborador honorário III
980 Visualizações

That is only because you are invoking from VS with debug, it is the command line being used! If you run from the system you will get a 'normal' path. That is still a valid path I think anyway, the .\ does not add anything but will still work.

dondilworth
Novo colaborador II
980 Visualizações

There is more that that wrong.  The slashes are backwards and the path string has extra quote marks in it.  If I delete the quotes and change the backslashes to slashes, the spawn works ... but then the command string I pass is not read correctly when the new processes start up.

Is there a C++ call that will recover the path in a friendly fashion?  (I know this is a Fortran forum, but I'll try anything.)

andrew_4619
Colaborador honorário III
980 Visualizações

why use spawnlp in fortran, you could use the built in in runqq or systemqq functions for example.

Are you running from debug? The path you are getting I am sure will be what was supplied to the system to invoke the program.

Responder