Changeset 9515


Ignore:
Timestamp:
Dec 20, 2014 10:03:58 PM (4 years ago)
Author:
wehart
Message:

Changing system call syntax to avoid the following
error on Linux:

Bad fd number

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyomo/trunk/pyomo/pysp/tests/unit/test_ph.py

    r9514 r9515  
    12371237        model_dir = farmer_examples_dir + os.sep + "models"
    12381238        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1239         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=cplex --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_quadratic_cplex_with_pyro.out"
     1239        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=cplex --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_quadratic_cplex_with_pyro.out 2>&1"
    12401240        print("Testing command: " + argstring)
    12411241
     
    12491249        model_dir = farmer_examples_dir + os.sep + "models"
    12501250        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1251         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --handshake-with-phpyro --solver=cplex --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_quadratic_cplex_with_phpyro.out"
     1251        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --handshake-with-phpyro --solver=cplex --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_quadratic_cplex_with_phpyro.out 2>&1"
    12521252        print("Testing command: " + argstring)
    12531253
     
    12611261        model_dir = farmer_examples_dir + os.sep + "models"
    12621262        instance_dir = farmer_examples_dir + os.sep + "scenariodataWithTwoBundles"
    1263         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=cplex --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_quadratic_with_bundles_cplex_with_pyro.out"
     1263        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=cplex --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_quadratic_with_bundles_cplex_with_pyro.out 2>&1"
    12641264        print("Testing command: " + argstring)
    12651265
     
    12731273        model_dir = farmer_examples_dir + os.sep + "models"
    12741274        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1275         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --solver=gurobi --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_quadratic_gurobi_with_phpyro.out"
     1275        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --solver=gurobi --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_quadratic_gurobi_with_phpyro.out 2>&1"
    12761276        print("Testing command: " + argstring)
    12771277
     
    12851285        model_dir = farmer_examples_dir + os.sep + "models"
    12861286        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1287         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --linearize-nonbinary-penalty-terms=10 --solver=gurobi --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_linearized_gurobi_with_phpyro.out"
     1287        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --linearize-nonbinary-penalty-terms=10 --solver=gurobi --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_linearized_gurobi_with_phpyro.out 2>&1"
    12881288        print("Testing command: " + argstring)
    12891289
     
    12971297        model_dir = farmer_examples_dir + os.sep + "models"
    12981298        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1299         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_quadratic_ipopt_with_pyro.out"
     1299        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_quadratic_ipopt_with_pyro.out 2>&1"
    13001300        print("Testing command: " + argstring)
    13011301
     
    13091309        model_dir = farmer_examples_dir + os.sep + "models"
    13101310        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1311         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_quadratic_ipopt_with_phpyro.out"
     1311        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_quadratic_ipopt_with_phpyro.out 2>&1"
    13121312        print("Testing command: " + argstring)
    13131313
     
    13211321        model_dir = farmer_examples_dir + os.sep + "models"
    13221322        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1323         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --linearize-nonbinary-penalty-terms=10 --solver=ipopt --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_linearized_ipopt_with_phpyro.out"
     1323        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --linearize-nonbinary-penalty-terms=10 --solver=ipopt --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_linearized_ipopt_with_phpyro.out 2>&1"
    13241324        print("Testing command: " + argstring)
    13251325
     
    13331333        model_dir = farmer_examples_dir + os.sep + "models"
    13341334        instance_dir = farmer_examples_dir + os.sep + "scenariodataWithTrivialBundles"
    1335         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_quadratic_trivial_bundling_ipopt_with_phpyro.out"
     1335        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_quadratic_trivial_bundling_ipopt_with_phpyro.out 2>&1"
    13361336        print("Testing command: " + argstring)
    13371337
     
    13451345        model_dir = farmer_examples_dir + os.sep + "models"
    13461346        instance_dir = farmer_examples_dir + os.sep + "scenariodataWithTwoBundles"
    1347         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 2 phsolverserver : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_quadratic_bundling_ipopt_with_phpyro.out"
     1347        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 2 phsolverserver : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=phpyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_quadratic_bundling_ipopt_with_phpyro.out 2>&1"
    13481348        print("Testing command: " + argstring)
    13491349
     
    13651365                    " --ww-extension-cfgfile="+sizes_example_dir+os.sep+"config"+os.sep+"wwph.cfg"+ \
    13661366                    " --ww-extension-suffixfile="+sizes_example_dir+os.sep+"config"+os.sep+"wwph.suffixes"+ \
    1367                     " >& "+this_test_file_directory+"sizes3_quadratic_cplex_with_phpyro.out"
     1367                    " > "+this_test_file_directory+"sizes3_quadratic_cplex_with_phpyro.out 2>&1"
    13681368        print("Testing command: " + argstring)
    13691369
     
    13861386        model_dir = farmer_examples_dir + os.sep + "models"
    13871387        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1388         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --max-iterations=10 --solve-ef --solver=cplex --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_with_integers_quadratic_cplex_with_pyro_with_postef_solve.out"
     1388        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --max-iterations=10 --solve-ef --solver=cplex --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_with_integers_quadratic_cplex_with_pyro_with_postef_solve.out 2>&1"
    13891389        print("Testing command: " + argstring)
    13901390
     
    14071407                    " --ww-extension-suffixfile="+sizes_example_dir+os.sep+"config"+os.sep+"wwph.suffixes"+ \
    14081408                    " --linearize-nonbinary-penalty-terms=4" + \
    1409                     " >& "+this_test_file_directory+"sizes3_linearized_cplex_with_phpyro.out"
     1409                    " > "+this_test_file_directory+"sizes3_linearized_cplex_with_phpyro.out 2>&1"
    14101410        print("Testing command: " + argstring)
    14111411
     
    14351435                    " --ww-extension-cfgfile="+sizes_example_dir+os.sep+"config"+os.sep+"wwph.cfg"+ \
    14361436                    " --ww-extension-suffixfile="+sizes_example_dir+os.sep+"config"+os.sep+"wwph.suffixes"+ \
    1437                     " >& "+this_test_file_directory+"sizes3_quadratic_gurobi_with_phpyro.out"
     1437                    " > "+this_test_file_directory+"sizes3_quadratic_gurobi_with_phpyro.out 2>&1"
    14381438        print("Testing command: " + argstring)
    14391439
     
    14601460        model_dir = farmer_examples_dir + os.sep + "models"
    14611461        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1462         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runef --verbose --solver=cplex --solver-manager=pyro --solve --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_ef_with_solve_cplex_with_pyro.out"
     1462        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runef --verbose --solver=cplex --solver-manager=pyro --solve --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_ef_with_solve_cplex_with_pyro.out 2>&1"
    14631463        print("Testing command: " + argstring)
    14641464
     
    14731473        model_dir = farmer_examples_dir + os.sep + "models"
    14741474        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1475         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_quadratic_async_ipopt_with_pyro.out"
     1475        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_quadratic_async_ipopt_with_pyro.out 2>&1"
    14761476        print("Testing command: " + argstring)
    14771477
     
    14861486        model_dir = farmer_examples_dir + os.sep + "models"
    14871487        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1488         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=gurobi --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_quadratic_async_gurobi_with_pyro.out"
     1488        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=gurobi --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_quadratic_async_gurobi_with_pyro.out 2>&1"
    14891489        print("Testing command: " + argstring)
    14901490
     
    14991499        model_dir = farmer_examples_dir + os.sep + "models"
    15001500        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1501         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=gurobi --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" --linearize-nonbinary-penalty-terms=10  "+" >& "+this_test_file_directory+"farmer_linearized_async_gurobi_with_pyro.out"
     1501        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=gurobi --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" --linearize-nonbinary-penalty-terms=10  "+" > "+this_test_file_directory+"farmer_linearized_async_gurobi_with_pyro.out 2>&1"
    15021502        print("Testing command: " + argstring)
    15031503
     
    15121512        model_dir = farmer_examples_dir + os.sep + "models"
    15131513        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1514         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" --linearize-nonbinary-penalty-terms=10  "+" >& "+this_test_file_directory+"farmer_linearized_async_ipopt_with_pyro.out"
     1514        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 1 pyro_mip_server : -np 1 runph -r 1.0 --solver=ipopt --solver-manager=pyro --shutdown-pyro --model-directory="+model_dir+" --instance-directory="+instance_dir+" --linearize-nonbinary-penalty-terms=10  "+" > "+this_test_file_directory+"farmer_linearized_async_ipopt_with_pyro.out 2>&1"
    15151515
    15161516        print("Testing command: " + argstring)
     
    15241524        model_dir = farmer_examples_dir + os.sep + "models"
    15251525        instance_dir = farmer_examples_dir + os.sep + "scenariodata"
    1526         argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --solver=cplex --solver-manager=phpyro --shutdown-pyro --linearize-nonbinary-penalty-terms=8 --model-directory="+model_dir+" --instance-directory="+instance_dir+" >& "+this_test_file_directory+"farmer_with_integers_linearized_cplex_with_phpyro.out"
     1526        argstring = "mpirun -np 1 pyomo_ns : -np 1 dispatch_srvr : -np 3 phsolverserver : -np 1 runph -r 1.0 --solver=cplex --solver-manager=phpyro --shutdown-pyro --linearize-nonbinary-penalty-terms=8 --model-directory="+model_dir+" --instance-directory="+instance_dir+" > "+this_test_file_directory+"farmer_with_integers_linearized_cplex_with_phpyro.out 2>&1"
    15271527        print("Testing command: " + argstring)
    15281528
     
    15421542                    " --max-iterations=5"+ \
    15431543                    " --rho-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"rhosettermixed.py"+ \
    1544                     " >& "+this_test_file_directory+"networkflow1ef10_simple_quadratic_cplex_with_phpyro.out"
     1544                    " > "+this_test_file_directory+"networkflow1ef10_simple_quadratic_cplex_with_phpyro.out 2>&1"
    15451545        print("Testing command: " + argstring)
    15461546
     
    15631563                    " --enable-ww-extensions"+ \
    15641564                    " --ww-extension-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"wwph-mipgaponly.cfg" + \
    1565                     " >& "+this_test_file_directory+"networkflow1ef10_advanced_quadratic_cplex_with_phpyro.out"
     1565                    " > "+this_test_file_directory+"networkflow1ef10_advanced_quadratic_cplex_with_phpyro.out 2>&1"
    15661566        print("Testing command: " + argstring)
    15671567
     
    15901590                    " --bounds-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"xboundsetter.py" + \
    15911591                    " --aggregate-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"aggregategetter.py"+ \
    1592                     " >& "+this_test_file_directory+"networkflow1ef10_linearized_gurobi_with_phpyro.out"
     1592                    " > "+this_test_file_directory+"networkflow1ef10_linearized_gurobi_with_phpyro.out 2>&1"
    15931593        print("Testing command: " + argstring)
    15941594
     
    16131613                    " --bounds-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"xboundsetter.py" + \
    16141614                    " --aggregate-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"aggregategetter.py"+ \
    1615                     " >& "+this_test_file_directory+"networkflow1ef3_simple_linearized_cplex_with_phpyro.out"
     1615                    " > "+this_test_file_directory+"networkflow1ef3_simple_linearized_cplex_with_phpyro.out 2>&1"
    16161616        print("Testing command: " + argstring)
    16171617
     
    16371637                    " --bounds-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"xboundsetter.py" + \
    16381638                    " --aggregate-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"aggregategetter.py"+ \
    1639                     " >& "+this_test_file_directory+"networkflow1ef10_simple_linearized_cplex_with_phpyro.out"
     1639                    " > "+this_test_file_directory+"networkflow1ef10_simple_linearized_cplex_with_phpyro.out 2>&1"
    16401640        print("Testing command: " + argstring)
    16411641
     
    16611661                    " --bounds-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"xboundsetter.py"+ \
    16621662                    " --aggregate-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"aggregategetter.py"+ \
    1663                     " >& "+this_test_file_directory+"networkflow1ef10_advanced_linearized_cplex_with_phpyro.out"
     1663                    " > "+this_test_file_directory+"networkflow1ef10_advanced_linearized_cplex_with_phpyro.out 2>&1"
    16641664        print("Testing command: " + argstring)
    16651665
     
    16891689                    " --bounds-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"xboundsetter.py"+ \
    16901690                    " --aggregate-cfgfile="+networkflow_example_dir+os.sep+"config"+os.sep+"aggregategetter.py"+ \
    1691                     " >& "+this_test_file_directory+"networkflow1ef10_linearized_cplex_with_bundles_with_phpyro.out"
     1691                    " > "+this_test_file_directory+"networkflow1ef10_linearized_cplex_with_bundles_with_phpyro.out 2>&1"
    16921692        print("Testing command: " + argstring)
    16931693
Note: See TracChangeset for help on using the changeset viewer.