# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=188

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 189

---

## [Julia Slurm Output with MPI](https://discourse.julialang.org/t/julia-slurm-output-with-mpi/111635)

<div class="topic-metadata">

**Author:** [@erny123](https://discourse.julialang.org/u/erny123)\
**Replies:** 0\
**Last updated:** [March 15, 2024, 12:32am UTC](https://discourse.julialang.org/t/julia-slurm-output-with-mpi/111635 "2024-03-15T00:32:42Z")

</div>

I have a simple script to use in slurm and I’m having trouble understanding the output: #MPItest.jl using MPI println("Testing MPI") That I run on slurm with the following sbatch script: #!/bin/bash #SBATCH -p free…

---

## [Initialize a package](https://discourse.julialang.org/t/initialize-a-package/111662)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [March 15, 2024, 2:55pm UTC](https://discourse.julialang.org/t/initialize-a-package/111662 "2024-03-15T14:55:29Z")

</div>

I have a package that needs some configuration data. Example data that is needed for tests is included in the package. But when I load the package the data path shall be set to joinpath(pwd(), "data"). Where could I cal…

---

## [Julia speed](https://discourse.julialang.org/t/julia-speed/111511)

<div class="topic-metadata">

**Author:** [@peDurand](https://discourse.julialang.org/u/peDurand)\
**Replies:** 28\
**Last updated:** [March 14, 2024, 8:17pm UTC](https://discourse.julialang.org/t/julia-speed/111511 "2024-03-14T20:17:00Z")

</div>

Hello ! I teach computational Physics in a french university. I learn to my students to code in Modern Fortran and Python. I know that many people claim that Julia may be as fast as C or Fortran. So, I try a little test…

---

## [Providing datasets in a package](https://discourse.julialang.org/t/providing-datasets-in-a-package/111622)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 7\
**Last updated:** [March 14, 2024, 4:16pm UTC](https://discourse.julialang.org/t/providing-datasets-in-a-package/111622 "2024-03-14T16:16:40Z")

</div>

Hi, I want to include some dataset, on the form of an object (say of type Mytype from my package, so that import Mypackage will provide a Mypackage.myobject binding for this dataset. I might have to do this for several…

---

## [Does CUDA.jl have sortperm! implemented?](https://discourse.julialang.org/t/does-cuda-jl-have-sortperm-implemented/111594)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 2\
**Last updated:** [March 14, 2024, 2:41pm UTC](https://discourse.julialang.org/t/does-cuda-jl-have-sortperm-implemented/111594 "2024-03-14T14:41:50Z")

</div>

Hello! I am getting quite confused. I have a vector of CartesianIndices and when I call sortperm! on it, it works great. I notice though that when tracking performance with CUDA.@time it reports to me a lot of CPU alloc…

---

## [Does DifferentialEquations.jl support matrix-shaped noise](https://discourse.julialang.org/t/does-differentialequations-jl-support-matrix-shaped-noise/110958)

<div class="topic-metadata">

**Author:** [@matt1](https://discourse.julialang.org/u/matt1)\
**Replies:** 2\
**Last updated:** [March 14, 2024, 2:08pm UTC](https://discourse.julialang.org/t/does-differentialequations-jl-support-matrix-shaped-noise/110958 "2024-03-14T14:08:27Z")

</div>

let’s say I want to solve the following system of SDEs: \\begin{align\*} du\_{1} &= f\_{1}(u,du,p,t) dt+c\_{11}dW\_{1}+c\_{12}dW\_{2} \\\\ du\_{2} &= f\_{2}(u,du,p,t) dt+c\_{23}dW\_{3}+c\_{24}dW\_{4} \\\\ du\_{3} &= f\_{3}(u,du,p…

---

## [Array printing of custom objects](https://discourse.julialang.org/t/array-printing-of-custom-objects/111606)

<div class="topic-metadata">

**Author:** [@mdsalerno](https://discourse.julialang.org/u/mdsalerno)\
**Replies:** 1\
**Last updated:** [March 14, 2024, 10:02am UTC](https://discourse.julialang.org/t/array-printing-of-custom-objects/111606 "2024-03-14T10:02:08Z")

</div>

I defined the following object and show() methods: # Custom Set struct CustomSet{T} dict::Dict{T, Nothing} end CustomSet(xs) = CustomSet(Dict(zip(xs, fill(nothing, length(xs))))) # default show used by print func…

---

## [Any good books on julia?](https://discourse.julialang.org/t/any-good-books-on-julia/111456)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 4\
**Last updated:** [March 14, 2024, 9:55am UTC](https://discourse.julialang.org/t/any-good-books-on-julia/111456 "2024-03-14T09:55:11Z")

</div>

I am from matlab and find julia a very difficult language. Is there any good book introducing julia for scientific computing?

---

## [Creating a Makie Streamplot using the output from DifferentialEquations.jl](https://discourse.julialang.org/t/creating-a-makie-streamplot-using-the-output-from-differentialequations-jl/111604)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 4\
**Last updated:** [March 14, 2024, 9:23am UTC](https://discourse.julialang.org/t/creating-a-makie-streamplot-using-the-output-from-differentialequations-jl/111604 "2024-03-14T09:23:22Z")

</div>

So I was looking to plot the phase diagram for simple ode systems using Makie. Now in the past I have used the Streamplot to display simple phase diagrams where I had an analytic solution for the ODE, as in this example. …

---

## [PkgEval success rate dropping - a cause for concern?](https://discourse.julialang.org/t/pkgeval-success-rate-dropping-a-cause-for-concern/111421)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 7\
**Last updated:** [March 14, 2024, 7:14am UTC](https://discourse.julialang.org/t/pkgeval-success-rate-dropping-a-cause-for-concern/111421 "2024-03-14T07:14:33Z")

</div>

Looking at https://raw.githubusercontent.com/JuliaCI/NanosoldierReports/gh-pages/pkgeval\_charts/daily.png, it appears that the PkgEval success rate has dropped substantially in the 1.11-dev period (and into the current 1…

---

## [HDF5 high-level wrapper for nested Dicts](https://discourse.julialang.org/t/hdf5-high-level-wrapper-for-nested-dicts/111588)

<div class="topic-metadata">

**Author:** [@baptnz](https://discourse.julialang.org/u/baptnz)\
**Replies:** 3\
**Last updated:** [March 14, 2024, 4:58am UTC](https://discourse.julialang.org/t/hdf5-high-level-wrapper-for-nested-dicts/111588 "2024-03-14T04:58:01Z")

</div>

I’m storing some data in hdf5 format to use in a multilanguage environment (others will use Python, R, C, etc. to access those files). I’ve implemented the export using HDF5.jl without much trouble, but it’s not very wel…

---

## [On the issues of foundational packages deprecation and lack of replacements](https://discourse.julialang.org/t/on-the-issues-of-foundational-packages-deprecation-and-lack-of-replacements/111601)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 3\
**Last updated:** [March 14, 2024, 4:34am UTC](https://discourse.julialang.org/t/on-the-issues-of-foundational-packages-deprecation-and-lack-of-replacements/111601 "2024-03-14T04:34:36Z")

</div>

Julia is founded on a premise that if you’re skilled enough, you can do anything, sometimes by calling C or even tinkering with the compiler. However, this comes with an issue. If there are some talented programmers ad…

---

## [Julia crashed - Core dumped](https://discourse.julialang.org/t/julia-crashed-core-dumped/107308)

<div class="topic-metadata">

**Author:** [@KapilKhanal](https://discourse.julialang.org/u/KapilKhanal)\
**Replies:** 13\
**Last updated:** [March 13, 2024, 7:55pm UTC](https://discourse.julialang.org/t/julia-crashed-core-dumped/107308 "2024-03-13T19:55:08Z")

</div>

I tried to report bug therough this command julia --bug-report=yes. But it is giving the segmentation fault for this as well. I updated to Julia 1.9, the latest stable version and now it crashes. \[ Info: Loading BugRepo…

---

## [Profiling code with heavy IO times](https://discourse.julialang.org/t/profiling-code-with-heavy-io-times/111589)

<div class="topic-metadata">

**Author:** [@ianfiske](https://discourse.julialang.org/u/ianfiske)\
**Replies:** 0\
**Last updated:** [March 13, 2024, 7:57pm UTC](https://discourse.julialang.org/t/profiling-code-with-heavy-io-times/111589 "2024-03-13T19:57:46Z")

</div>

Usually I can get a lot of mileage out of the user-friendly @profview macro and I get all the info I need to spot performance bottlenecks. However, sometimes I have code where there is a lot of IO (e.g., downloading var…

---

## [Struggling with isposdef and floating point errors](https://discourse.julialang.org/t/struggling-with-isposdef-and-floating-point-errors/111582)

<div class="topic-metadata">

**Author:** [@theplatters](https://discourse.julialang.org/u/theplatters)\
**Replies:** 2\
**Last updated:** [March 13, 2024, 7:25pm UTC](https://discourse.julialang.org/t/struggling-with-isposdef-and-floating-point-errors/111582 "2024-03-13T19:25:28Z")

</div>

I am trying to do a Quasi-Newton method with a basic cholesky adaptation, to guarantee B is positive definite. The code goes as follows: function choleksyadaption!(A,β = 10e-3, max\_iter = 1000) @info "Adapting Chole…

---

## [Using LinearMaps.jl Inversemap for Preconditioning IterativeSolvers.jl](https://discourse.julialang.org/t/using-linearmaps-jl-inversemap-for-preconditioning-iterativesolvers-jl/110070)

<div class="topic-metadata">

**Author:** [@erny123](https://discourse.julialang.org/u/erny123)\
**Replies:** 1\
**Last updated:** [March 13, 2024, 5:03pm UTC](https://discourse.julialang.org/t/using-linearmaps-jl-inversemap-for-preconditioning-iterativesolvers-jl/110070 "2024-03-13T17:03:40Z")

</div>

I’ve seen some examples of creating a matrix-free method via linear operators, structs, and linear maps for IterativeSolvers.jl and LinearMaps.jl . However, I haven’t seen any examples of creating matrix-free preconditio…

---

## [Reshape() permanently locks underlying array (bug?)](https://discourse.julialang.org/t/reshape-permanently-locks-underlying-array-bug/94714)

<div class="topic-metadata">

**Author:** [@torrance](https://discourse.julialang.org/u/torrance)\
**Replies:** 1\
**Last updated:** [March 13, 2024, 3:37pm UTC](https://discourse.julialang.org/t/reshape-permanently-locks-underlying-array-bug/94714 "2024-03-13T15:37:58Z")

</div>

I want to iteratively build a matrix by first append!(v, col) column vectors to a larger vector v, and then finally resizing to a matrix v2 when I’m finished. Once I’m finished with the matrix v2, I then want to empty!(v…

---

## [Dictionarys on the GPU for Agents.jl](https://discourse.julialang.org/t/dictionarys-on-the-gpu-for-agents-jl/111233)

<div class="topic-metadata">

**Author:** [@Kemper](https://discourse.julialang.org/u/Kemper)\
**Replies:** 4\
**Last updated:** [March 13, 2024, 3:37pm UTC](https://discourse.julialang.org/t/dictionarys-on-the-gpu-for-agents-jl/111233 "2024-03-13T15:37:23Z")

</div>

Hello! I am working on an Agent Based Model with the Agents.jl framework and I am having performance problems. I am working with dictonarys to save positions and values. Is there a way to work with dictonaries on the G…

---

## [Reorder dictionary keys](https://discourse.julialang.org/t/reorder-dictionary-keys/111547)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 8\
**Last updated:** [March 13, 2024, 6:58am UTC](https://discourse.julialang.org/t/reorder-dictionary-keys/111547 "2024-03-13T06:58:43Z")

</div>

I have dictionary in below format and would like to check if we have any existing methos that can reorder dictionary if we provide the array with the key names in desired order? I would like to see my final dictionary i…

---

## [How can i plot a Correlation HeatMap?](https://discourse.julialang.org/t/how-can-i-plot-a-correlation-heatmap/78411)

<div class="topic-metadata">

**Author:** [@folleyz](https://discourse.julialang.org/u/folleyz)\
**Replies:** 8\
**Last updated:** [March 13, 2024, 6:34am UTC](https://discourse.julialang.org/t/how-can-i-plot-a-correlation-heatmap/78411 "2024-03-13T06:34:52Z")

</div>

Hello Guys! I need a help. i want make this heatmap: I’m trying with that code: Plots.heatmap(cor(Matrix(df\[!,\[:Age,:Balance, :Tenure,:NumOfProducts,:EstimatedSalary\]\])) ) \*\* But how can i put the annotations o…

---

## [When we complain of compilation times](https://discourse.julialang.org/t/when-we-complain-of-compilation-times/111549)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [March 13, 2024, 2:47am UTC](https://discourse.julialang.org/t/when-we-complain-of-compilation-times/111549 "2024-03-13T02:47:27Z")

</div>

… we could compare with some C++ projects. Right now deal.ii has been compiling for more than an hour and the process is at 30%. Edit: two hours later it is at 57%.

---

## [Revise Fails to Precompile](https://discourse.julialang.org/t/revise-fails-to-precompile/111537)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 1\
**Last updated:** [March 12, 2024, 8:55pm UTC](https://discourse.julialang.org/t/revise-fails-to-precompile/111537 "2024-03-12T20:55:56Z")

</div>

Somehow revise has stopped precompiling for me. The last thing I can remember doing before this issue cropped up is that I was using Revise alongside Debugger and when I was finished I closed the Julia session. Upon star…

---

## [Problem changing value of a fixed variable in a function](https://discourse.julialang.org/t/problem-changing-value-of-a-fixed-variable-in-a-function/111325)

<div class="topic-metadata">

**Author:** [@clopen](https://discourse.julialang.org/u/clopen)\
**Replies:** 12\
**Last updated:** [March 12, 2024, 7:04pm UTC](https://discourse.julialang.org/t/problem-changing-value-of-a-fixed-variable-in-a-function/111325 "2024-03-12T19:04:11Z")

</div>

Hello, I am new to programming in Julia and currently working on transitioning code from Fortran to Julia. In a file called codeA.jl, I have declared several variables, some of which are utilized as parameters within a …

---

## [Gadfly v1.4.0 documentation](https://discourse.julialang.org/t/gadfly-v1-4-0-documentation/111483)

<div class="topic-metadata">

**Author:** [@Brinkhuis](https://discourse.julialang.org/u/Brinkhuis)\
**Replies:** 2\
**Last updated:** [March 12, 2024, 4:55pm UTC](https://discourse.julialang.org/t/gadfly-v1-4-0-documentation/111483 "2024-03-12T16:55:00Z")

</div>

I installed Gadfly in a (new) Julia environment. The package manager status command shows it’s version v1.4.0. However, on https://gadflyjl.org/stable the latest version is v1.3.4. Where can I find the v1.4.0 documentati…

---

## [How to do literal dispatch?](https://discourse.julialang.org/t/how-to-do-literal-dispatch/111493)

<div class="topic-metadata">

**Author:** [@putianyi888](https://discourse.julialang.org/u/putianyi888)\
**Replies:** 3\
**Last updated:** [March 12, 2024, 12:48am UTC](https://discourse.julialang.org/t/how-to-do-literal-dispatch/111493 "2024-03-12T00:48:26Z")

</div>

I’d like to make a function dispatch on literal inputs, like how Base.^ dispatches on literal\_pow, but I have no idea how it works. A quick search suggests it’s done by the compiler which means that my goal is not possib…

---

## [Integrating network of particles+springs with varying number of particles](https://discourse.julialang.org/t/integrating-network-of-particles-springs-with-varying-number-of-particles/111482)

<div class="topic-metadata">

**Author:** [@70Gage70](https://discourse.julialang.org/u/70Gage70)\
**Replies:** 7\
**Last updated:** [March 12, 2024, 4:06pm UTC](https://discourse.julialang.org/t/integrating-network-of-particles-springs-with-varying-number-of-particles/111482 "2024-03-12T16:06:57Z")

</div>

This is a mwe of code which integrates a network of ~100 - ~1000 interacting particles that can grow and die. In general, the connections are arbitrary and growth/death has logic but here I just connect every particle an…

---

## [Fitting hierarchical model with Turing NUTS error](https://discourse.julialang.org/t/fitting-hierarchical-model-with-turing-nuts-error/111527)

<div class="topic-metadata">

**Author:** [@jpdelong](https://discourse.julialang.org/u/jpdelong)\
**Replies:** 0\
**Last updated:** [March 12, 2024, 3:55pm UTC](https://discourse.julialang.org/t/fitting-hierarchical-model-with-turing-nuts-error/111527 "2024-03-12T15:55:47Z")

</div>

Hi all - I am trying to fit a nonlinear hierarchical model to data using Turing. It works fine without the hierarchical part and it works with the MH sampler, but it fails using HMC and NUTS, with the following errors: E…

---

## [Percentages in pie plot](https://discourse.julialang.org/t/percentages-in-pie-plot/82366)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 9\
**Last updated:** [March 12, 2024, 3:03pm UTC](https://discourse.julialang.org/t/percentages-in-pie-plot/82366 "2024-03-12T15:03:02Z")

</div>

How to show percentages also in pie plot ? I want to show percentages of “Will churn” and “Will not churn”.

---

## ["immutable struct\_name" once okay in julia?](https://discourse.julialang.org/t/immutable-struct-name-once-okay-in-julia/111503)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 4\
**Last updated:** [March 12, 2024, 3:01pm UTC](https://discourse.julialang.org/t/immutable-struct-name-once-okay-in-julia/111503 "2024-03-12T15:01:51Z")

</div>

I see codes like immutable sector Sz::Int64 kx::Float64 ky::Float64 z::Int64 end in some github repository. Now it should be struct sector Sz::Int64 kx::Float64 ky::Float64 z::Int64 en…

---

## [Broken link in unit test documentation](https://discourse.julialang.org/t/broken-link-in-unit-test-documentation/111514)

<div class="topic-metadata">

**Author:** [@madhavkrishnan](https://discourse.julialang.org/u/madhavkrishnan)\
**Replies:** 3\
**Last updated:** [March 12, 2024, 1:09pm UTC](https://discourse.julialang.org/t/broken-link-in-unit-test-documentation/111514 "2024-03-12T13:09:16Z")

</div>

I was reading the documentation on unit tests at https://docs.julialang.org/en/v1/stdlib/Test/#~:text=adding%20tests%20to%20your%20Julia%20Package.. The highligted link which resolves to https://pkgdocs.julialang.org/d…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=187)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=189)
