ansys / pyfluent

Pythonic interface to Ansys Fluent
https://fluent.docs.pyansys.com
MIT License
238 stars 41 forks source link

Start pyfluent using additional arguments #2324

Open jharming opened 6 months ago

jharming commented 6 months ago

šŸ” Before submitting the issue

šŸž Description of the bug

I can use the code below to start fluent in batch mode. Using pyfluent to start then I cant pass '-rsh="plink -batch -l aaaaa"' It interpretate it as separate commands. Have tried several methods but all

run([r"C:/Program Files/ANSYS Inc/v232/fluent/ntbin/win64/fluent.exe", '3ddp', 
             '-t{}'.format(cores), '-nodepath=/mapr/danfoss4.com/apps/Ansys/v232/v232/fluent', '-node0=dkrdc01-loginnodevm',
             '-rsh="plink -batch -l aaaaa"', '-scheduler=slurm', '-scheduler_account=aaaaa',
             '-scheduler_queue={}'.format(scheduler), '-scheduler_headnode=dkrdc01-headnodevm', '-setenv="FLUENT_REMOTE_SSH=1"',
             '-sifile="C:\Temp\server.txt"'])

šŸ“ Steps to reproduce

Different methods tried

session = pyfluent.launch_fluent(
        version="3d", precision="double", mode="solver",
        processor_count=64, show_gui=True,
        start_transcript=False,
        # additional_arguments=r'-nodepath=/mapr/danfoss4.com/apps/Ansys/v''232/v232/fluent -node0=dkrdc01-loginnodevm -rsh=""C:\Python\plink.exe -batch -l aaaaa"" -scheduler=slurm -scheduler_account=aaaaa -scheduler_queue=normal -scheduler_headnode=dkrdc01-headnodevm -setenv="FLUENT_REMOTE_SSH=1"'
        # additional_arguments=r'-nodepath=/mapr/danfoss4.com/apps/Ansys/v232/v232/fluent -node0=dkrdc01-loginnodevm -rsh="plink -batch -l aaaaa" -scheduler=slurm -scheduler_account=aaaaa -scheduler_queue=normal -scheduler_headnode=dkrdc01-headnodevm -setenv="FLUENT_REMOTE_SSH=1"'
        # additional_arguments=r'-nodepath=/mapr/danfoss4.com/apps/Ansys/v232/v232/fluent -node0=dkrdc01-loginnodevm -rsh="C:\Python\plink.exe -batch -l aaaaa" -scheduler=slurm -scheduler_account=aaaaa -scheduler_queue=normal -scheduler_headnode=dkrdc01-headnodevm -setenv="FLUENT_REMOTE_SSH=1"'
        # additional_arguments='-nodepath=/mapr/danfoss4.com/apps/Ansys/v232/v232/fluent -node0=dkrdc01-loginnodevm -rsh=\"C:\\Python\\plink.exe -batch -l aaaaa\" -scheduler=slurm -scheduler_account=aaaaa -scheduler_queue=normal -scheduler_headnode=dkrdc01-headnodevm -setenv=\"FLUENT_REMOTE_SSH=1\"'
        # additional_arguments=r'-nodepath=/mapr/danfoss4.com/apps/Ansys/v232/v232/fluent -node0=dkrdc01-loginnodevm -rsh=\"C:\Python\plink.exe -batch -l aaaaa\" -scheduler=slurm -scheduler_account=aaaaa -scheduler_queue=normal -scheduler_headnode=dkrdc01-headnodevm -setenv="FLUENT_REMOTE_SSH=1"'         
                            )

šŸ’» Which operating system are you using?

Windows

šŸ“€ Which ANSYS version are you using?

23r2

šŸ Which Python version are you using?

3.9

šŸ“¦ Installed packages

p
prmukherj commented 5 months ago

fluent launch string like this works: fluent.exe 3ddp -t4 -rsh="plink -batch -l aaaaa" -sifile=s1.txt

From pyfluent end the parsing code seems to be working correctly:

session = pyfluent.launch_fluent( version="3d", precision="double", mode="solver", processor_count=4, show_gui=True, start_transcript=False, additional_arguments=r'-rsh="plink -batch -l aaaaa"')

Corresponds to a fluent launch string of :

".....\fluent.exe" 3ddp -t4 -rsh="plink -batch -l aaaaa" -sifile=.....\serverinfo-0gx4tr4g.txt -nm

which launches the fluent session as expected without any issues. @jharming, could you please try out your option 2 and confirm the issue again. Thank you.

prmukherj commented 4 months ago

@jharming, is this bug still relevant?

jharming commented 4 months ago

Sorry about the late answer. No it does not work the error message is Unable to read from standard input: The handle is invalid.

seanpearsonuk commented 2 months ago

@PyPablo would you like to work with @jharming in order to understand the specifics of their issue further?