def test_mpi_builder__multithreaded__complex_cmd(): builder = AtomicMPICmdBuilder(["python", "/foo/run.py"], threads=3) assert_equal(builder.call, ["mpirun", "-n", 3, "python", "/foo/run.py"]) assert_equal(builder.kwargs, {"EXEC_MAIN": "python"})
def test_mpi_builder__kwargs(): builder = AtomicMPICmdBuilder("ls", set_cwd=True) assert_equal(builder.kwargs, {"set_cwd": True, "EXEC_MPI": "mpirun"})
def test_mpi_builder__defaults__complex_cmd(): builder = AtomicMPICmdBuilder(["python", "/foo/run.py"]) assert_equal(builder.call, ["python", "/foo/run.py"]) assert_equal(builder.kwargs, {"EXEC_MPI": "mpirun"})
def test_mpi_builder__multithreaded__str(): builder = AtomicMPICmdBuilder("ls", threads=3) assert_equal(builder.call, ["mpirun", "-n", 3, "ls"]) assert_equal(builder.kwargs, {"EXEC_MAIN": "ls"})
def test_mpi_builder__defaults__str(): builder = AtomicMPICmdBuilder("ls") assert_equal(builder.call, ["ls"]) assert_equal(builder.kwargs, {"EXEC_MPI": "mpirun"})
def customize(cls, input_binary, initial_tree, output_template, threads = 1, dependencies = ()): """ Arguments: input_binary -- A binary alignment file in a format readable by ExaML. output_template -- A template string used to construct final filenames. Should consist of a full path, including a single '%s', which is replaced with the variable part of RAxML output files (e.g. 'info', 'bestTree', ...). Example destination: '/disk/project/SN013420.RAxML.%s' Example output: '/disk/project/SN013420.RAxML.bestTree'""" # TODO: Make MPIParams! command = AtomicMPICmdBuilder("examl", threads = threads) # Ensures that output is saved to the temporary directory command.set_option("-w", "%(TEMP_DIR)s") command.set_option("-s", "%(IN_ALN)s") command.set_option("-t", "%(IN_TREE)s") command.set_option("-n", "Pypeline") command.set_kwargs(IN_ALN = input_binary, IN_TREE = initial_tree, # Final output files, are not created directly OUT_INFO = output_template % "info", OUT_BESTTREE = output_template % "result", OUT_BOOTSTRAP = output_template % "log", CHECK_EXAML = EXAML_VERSION) # Use the GAMMA model of NT substitution by default command.set_option("-m", "GAMMA", fixed = False) return {"command" : command}
def customize(cls, input_binary, initial_tree, output_template, threads=1, dependencies=()): """ Arguments: input_binary -- A binary alignment file in a format readable by EXaML. output_template -- A template string used to construct final filenames. Should consist of a full path, including a single '%s', which is replaced with the variable part of RAxML output files (e.g. 'info', 'bestTree', ...). Example destination: '/disk/project/SN013420.RAxML.%s' Example output: '/disk/project/SN013420.RAxML.bestTree'""" # TODO: Make MPIParams! command = AtomicMPICmdBuilder("examl", threads=threads) # Ensures that output is saved to the temporary directory command.set_option("-w", "%(TEMP_DIR)s") command.set_option("-s", "%(IN_ALN)s") command.set_option("-t", "%(IN_TREE)s") command.set_option("-n", "Pypeline") command.set_kwargs( IN_ALN=input_binary, IN_TREE=initial_tree, # Final output files, are not created directly OUT_INFO=output_template % "info", OUT_BESTTREE=output_template % "result", OUT_BOOTSTRAP=output_template % "log") # Use the GAMMA model of NT substitution by default command.set_option("-m", "GAMMA", fixed=False) return {"command": command}