eaton-lab / tetrad

Phylogenetic inference using phylogenetic invariants and quartet joining
GNU General Public License v3.0
0 stars 2 forks source link

--ipcluster option fails despite working ipcluster #11

Closed alexkrohn closed 5 months ago

alexkrohn commented 5 months ago

Running tetrad 0.9.14 downloaded from github

ipcluster start -n 30 --cluster-id=tetrad --daemonize

That outputs a lot of information, ending in:

2024-06-28 14:25:15.846 [KernelNanny.16] Starting kernel nanny for engine 16, pid=81901, nanny pid=82058
2024-06-28 14:25:15.847 [KernelNanny.16] Nanny watching parent pid 81901.
Leaving cluster running: /home/tangled/.ipython/profile_default/security/cluster-tetrad.json

Then when running tetrad, I get this error:

tetrad -i no-low-loci-inds-or-cinereus.snps.hdf5 -b 1000 -n 5maxmissing-allinds -o tetrad-out --ipcluster=tetrad

-------------------------------------------------------
tetrad [v.0.9.14]
Quartet inference from phylogenetic invariants
-------------------------------------------------------
tetrad instance: 5maxmissing-allinds
loading snps array [154 taxa x 32659 snps]
max unlinked SNPs per quartet [nloci]: 2555
quartet sampler [random, nsamples**2.8]: 1333699 / 22533126
Traceback (most recent call last):
  File "/home/tangled/miniforge3/envs/tetrad-june2024/bin/tetrad", line 33, in <module>
    sys.exit(load_entry_point('tetrad', 'console_scripts', 'tetrad')())
  File "/home/tangled/yonahlossee-working/tetrad/tetrad/__main__.py", line 287, in main
    CLI()
  File "/home/tangled/yonahlossee-working/tetrad/tetrad/__main__.py", line 163, in __init__
    ipyclient = ipp.Client(profile=self.args.ipcluster)
  File "/home/tangled/miniforge3/envs/tetrad-june2024/lib/python3.7/site-packages/ipyparallel/client/client.py", line 460, in __init__
    raise OSError(no_file_msg)
OSError: You have attempted to connect to an IPython Cluster but no Controller could be found.
Please double-check your configuration and ensure that a cluster is running.

Confirming that the cluster did initiate:

ipcluster stop --cluster-id=tetrad
2024-06-28 14:25:45.544 [IPClusterStop] Stopping cluster tetrad
2024-06-28 14:25:45.544 [IPClusterStop] Stopping controller
2024-06-28 14:25:45.728 [IPClusterStop] Stopping engine(s): 1719584712 

This command got tetrad to work with 30 cores as expected:

tetrad -i no-low-loci-inds-or-cinereus.snps.hdf5 -b 1000 -n 5maxmissing-allinds -o tetrad-out -c 30

-------------------------------------------------------
tetrad [v.0.9.14]
Quartet inference from phylogenetic invariants
-------------------------------------------------------
tetrad instance: 5maxmissing-allinds
loading snps array [154 taxa x 32659 snps]
max unlinked SNPs per quartet [nloci]: 2555
quartet sampler [random, nsamples**2.8]: 1333699 / 22533126
Parallel connection | tbc-comp2: 30 cores
initializing quartet sets database

Probably not super dire behavior, but I wasn't quite sure why it was failing.

isaacovercast commented 5 months ago

Hey Alex,

Ok, this is a bit weird and isn't documented very well, but the --ipcluster argument for tetrad doesn't actually accept an input value, it is hard coded to use the 'default' instance of ipcluster, so any values passed in with --ipcluster are ignored. The preferred way to operate this is like this:

# No --cluster-id, uses 'default' ipcluster ID
ipcluster start -n 30 --daemonize

# No arguments for --ipcluster flag are necessary
tetrad -i no-low-loci-inds-or-cinereus.snps.hdf5 -b 1000 -n 5maxmissing-allinds -o tetrad-out --ipcluster

Hope that helps! -isaac

alexkrohn commented 5 months ago

Ah, that works. Thanks for clarifying!