Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating FCS/FCSGX #52

Open
DLBPointon opened this issue Jul 25, 2024 · 9 comments · Fixed by #74 or #88
Open

Updating FCS/FCSGX #52

DLBPointon opened this issue Jul 25, 2024 · 9 comments · Fixed by #74 or #88
Assignees
Labels
enhancement New feature or request

Comments

@DLBPointon
Copy link
Contributor

Description of feature

I'm updating the fcs/fcsgx module on nf-core.

This will move it from v0.4.0 to v0.5.4

See: nf-core/modules#6036

@DLBPointon DLBPointon added the enhancement New feature or request label Jul 25, 2024
@DLBPointon DLBPointon self-assigned this Jul 25, 2024
@DLBPointon
Copy link
Contributor Author

Mahesh has done this and also included code for generating a ramdisk for the database. Spoken to @muffato about how we can best utilise this.

@muffato
Copy link
Member

muffato commented Jan 17, 2025

Here is how I suggest patching the fcs-gx nf-core module now that we have the database on all nodes (under /tmp/tol_data).

diff --git a/modules/nf-core/fcsgx/rungx/main.nf b/modules/nf-core/fcsgx/rungx/main.nf
index af6411aeb..0dd27084f 100644
--- a/modules/nf-core/fcsgx/rungx/main.nf
+++ b/modules/nf-core/fcsgx/rungx/main.nf
@@ -25,12 +25,8 @@ process FCSGX_RUNGX {
     script:
     def args = task.ext.args ?: ''
     def prefix = task.ext.prefix ?: "${meta.id}"
-    def mv_database_to_ram = ramdisk_path ? "rclone copy $gxdb $ramdisk_path/$task.index/" : ''
-    def database = ramdisk_path ? "$ramdisk_path/$task.index/" : gxdb // Use task.index to make memory location unique
+    def database = ramdisk_path ?: gxdb
     """
-    # Copy DB to RAM-disk when supplied. Otherwise, the tool is very slow.
-    $mv_database_to_ram
-
     export GX_NUM_CORES=${task.cpus}
     run_gx.py \\
         --fasta ${fasta} \\

@DLBPointon
Copy link
Contributor Author

@muffato
Is this across tol22? I've looked across random nodes in farm22 and tol22 and can't see the tol_data folder anywhere, is it for basement/hugemem nodes only?

I've made the changes to the pipeline in branch dp24_fcsgx_update 6533db4

@muffato
Copy link
Member

muffato commented Jan 20, 2025

@DLBPointon : on the tol22 farm, on all the nodes named tol-1-{9,10,11,12}-{1,2,3,4}. These are the only ones with enough memory to be in the hugemem and teramem queues

@DLBPointon
Copy link
Contributor Author

DLBPointon commented Jan 20, 2025

Thanks muffato, I have it running pretty happily on my end now.

Only warning I'm getting is:

Note: detected page-faults (disk-thrashing) - GX may run slowly.
Consider placing gxdb into non-swappable ramfs/tmpfs, or use `vmtouch -l`.

These are Ram disk alternatives, I wonder if internally it doesn't draw a distinction between solid-state and spinning-rust? and solid-state is ok really.

@muffato
Copy link
Member

muffato commented Jan 21, 2025

Since the migration to tol22/farm22, /tmp is not a ramdisk anymore, so I guess it makes sense. If I remember correctly, FCS-GX anyway goes through a phase of force-loading the database in memory ? That should still be faster if run from /lustre

@DLBPointon
Copy link
Contributor Author

Ah i see ok,

Yes it uses vmtouch to load into memory. However, that doesn't seem to happen unless I'm reading this wrong. This is perhaps a question for the FCSGX team though

-----------------------------------------------------------------------------


    GX requires the database to be entirely in RAM to avoid thrashing.
    Consider placing the database files in a non-swappable tmpfs or ramfs.
    See https://github.com/ncbi/fcs/wiki/FCS-GX for details.
    Will prefetch (vmtouch) the database pages to have the OS cache them in main memory.

        

gxdb/all.gxs is 0% in RAM.
Prefetching gxdb/all.gxs 1%...                         
Prefetching gxdb/all.gxs 2%...                         
Prefetching gxdb/all.gxs 3%...                         
Prefetching gxdb/all.gxs 4%...                         
Prefetching gxdb/all.gxs 5%...                         
Prefetching gxdb/all.gxs 6%...                         
Prefetching gxdb/all.gxs 7%...                         
Prefetching gxdb/all.gxs 8%...                         
Prefetching gxdb/all.gxs 9%...                         
Prefetching gxdb/all.gxs 10%...                         
Prefetching gxdb/all.gxs 11%...                         
Prefetching gxdb/all.gxs 12%...                         
Prefetching gxdb/all.gxs 13%...                         
Prefetching gxdb/all.gxs 14%...                         
Prefetching gxdb/all.gxs 15%...                         
Prefetching gxdb/all.gxs 16%...                         
Prefetching gxdb/all.gxs 17%...                         
Prefetching gxdb/all.gxs 18%...                         
Prefetching gxdb/all.gxs 19%...                         
Prefetching gxdb/all.gxs 20%...                         
Prefetching gxdb/all.gxs 21%...                         
Prefetching gxdb/all.gxs 22%...                         
Prefetching gxdb/all.gxs 23%...                         
Prefetching gxdb/all.gxs 24%...                         
Prefetching gxdb/all.gxs 25%...                         
Prefetching gxdb/all.gxs 26%...                         
Prefetching gxdb/all.gxs 27%...                         
Prefetching gxdb/all.gxs 28%...                         
Prefetching gxdb/all.gxs 29%...                         
Prefetching gxdb/all.gxs 30%...                         
Prefetching gxdb/all.gxs 31%...                         
Prefetching gxdb/all.gxs 32%...                         
Prefetching gxdb/all.gxs 33%...                         
Prefetching gxdb/all.gxs 34%...                         
Prefetching gxdb/all.gxs 35%...                         
Prefetching gxdb/all.gxs 36%...                         
Prefetching gxdb/all.gxs 37%...                         
Prefetching gxdb/all.gxs 38%...                         
Prefetching gxdb/all.gxs 39%...                         
Prefetching gxdb/all.gxs 40%...                         
Prefetching gxdb/all.gxs 41%...                         
Prefetching gxdb/all.gxs 42%...                         
Prefetching gxdb/all.gxs 43%...                         
Prefetching gxdb/all.gxs 44%...                         
Prefetching gxdb/all.gxs 45%...                         
Prefetching gxdb/all.gxs 46%...                         
Prefetching gxdb/all.gxs 47%...                         
Prefetching gxdb/all.gxs 48%...                         
Prefetching gxdb/all.gxs 49%...                         
Prefetching gxdb/all.gxs 50%...                         
Prefetching gxdb/all.gxs 51%...                         
Prefetching gxdb/all.gxs 52%...                         
Prefetching gxdb/all.gxs 53%...                         
Prefetching gxdb/all.gxs 54%...                         
Prefetching gxdb/all.gxs 55%...                         
Prefetching gxdb/all.gxs 56%...                         
Prefetching gxdb/all.gxs 57%...                         
Prefetching gxdb/all.gxs 58%...                         
Prefetching gxdb/all.gxs 59%...                         
Prefetching gxdb/all.gxs 60%...                         
Prefetching gxdb/all.gxs 61%...                         
Prefetching gxdb/all.gxs 62%...                         
Prefetching gxdb/all.gxs 63%...                         
Prefetching gxdb/all.gxs 64%...                         
Prefetching gxdb/all.gxs 65%...                         
Prefetching gxdb/all.gxs 66%...                         
Prefetching gxdb/all.gxs 67%...                         
Prefetching gxdb/all.gxs 68%...                         
Prefetching gxdb/all.gxs 69%...                         
Prefetching gxdb/all.gxs 70%...                         
Prefetching gxdb/all.gxs 71%...                         
Prefetching gxdb/all.gxs 72%...                         
Prefetching gxdb/all.gxs 73%...                         
Prefetching gxdb/all.gxs 74%...                         
Prefetching gxdb/all.gxs 75%...                         
Prefetching gxdb/all.gxs 76%...                         
Prefetching gxdb/all.gxs 77%...                         
Prefetching gxdb/all.gxs 78%...                         
Prefetching gxdb/all.gxs 79%...                         
Prefetching gxdb/all.gxs 80%...                         
Prefetching gxdb/all.gxs 81%...                         
Prefetching gxdb/all.gxs 82%...                         
Prefetching gxdb/all.gxs 83%...                         
Prefetching gxdb/all.gxs 84%...                         
Prefetching gxdb/all.gxs 85%...                         
Prefetching gxdb/all.gxs 86%...                         
Prefetching gxdb/all.gxs 87%...                         
Prefetching gxdb/all.gxs 88%...                         
Prefetching gxdb/all.gxs 89%...                         
Prefetching gxdb/all.gxs 90%...                         
Prefetching gxdb/all.gxs 91%...                         
Prefetching gxdb/all.gxs 92%...                         
Prefetching gxdb/all.gxs 93%...                         
Prefetching gxdb/all.gxs 94%...                         
Prefetching gxdb/all.gxs 95%...                         
Prefetching gxdb/all.gxs 96%...                         
Prefetching gxdb/all.gxs 97%...                         
Prefetching gxdb/all.gxs 98%...                         
Prefetching gxdb/all.gxs 99%...                         
Prefetched gxdb/all.gxs in 297.554s; 0.59515 GB/s. The file is 0% in RAM.

@muffato
Copy link
Member

muffato commented Jan 21, 2025

Oh, that's weird. I'll run some tests as well

@DLBPointon
Copy link
Contributor Author

DLBPointon commented Feb 5, 2025

Hi @muffato
Did you find anything in the end? Thankfully, It doesn't seem to be causing a slowdown on my end.

@DLBPointon DLBPointon linked a pull request Feb 12, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants