caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Shivkumar Chandrasekaran <shiv@ece.ucsb.edu>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Matrix libraries
Date: Mon, 15 Dec 2003 09:14:52 -0800	[thread overview]
Message-ID: <327A735C-2F22-11D8-85BF-000393942C76@ece.ucsb.edu> (raw)
In-Reply-To: <200312131638.01256.oleg_trott@columbia.edu>


On Dec 13, 2003, at 1:38 PM, Oleg Trott wrote:

>
> 3.) Regarding "WORK" arguments. Why not have a shared workspace:
>
> (* module Workspace, untested *)

I was thinking of using weak arrays for this, so that a one-time use of 
a large workspace does not consume memory for too long.

>
> (* private *)
> let workspace = ref (Array1.create float64 100)
>
> (* public *)
> let size () = Array1.dim !workspace
>
> let resize n = workspace := Array1.create float64 n
>
> let delete () = resize 0
>
> let get_float64 n = if size () >= n then !workspace
>                                                 else (resize n; 
> !workspace)
>
> This way, one does not need to "hoist" workspace allocation out of 
> loops
> manually. OTOH performance does not suffer from allocating workspace
> for each function call. I don't know how this would inter-operate with
> threading or SMP though.

Since the "naive" way of doing multiple OCaml-threads does not imply 
that multiple processors will be used (see old posts on this subject), 
I was hoping to write yet another interface to Lapack+Blas where each 
fortran call would run in its own C thread. That way the user can 
precisely control the threading. Anybody has any advice on this matter?

Apparently ATLAS BLAS already can exploit SMP, but it does not seem to 
matter for small matrix sizes, which is my case. I just happen to have 
lots of them!


>
> 4) Submatrices. For a function f that takes a matrix argument "a" of 
> size m by
> n, you normally use something like
>
> f ar ac a m n
>
> where ar and ac refer to the "beginning" of the submatrix. Even though 
> they
> can default to 1, this is kind of inconvenient compared to
>
> f a
>
> I would propose using the latter everywhere, and letting the "mat" type
> include ar, ac, m and n.
>
> submatrix : int -> int -> int -> int -> mat -> mat
> (* submatrix x1 y1 x2 y2 a *)
>
> would provide "views" into matrix a.

See my previous "pre-announcement" for CamlFloat. It provides such a 
mechanism, and tracks all the nasty details of unit diagonal 
lower-triangular matrices, etc., etc., for you. That is, all the usual 
things that make most non-trivial Lapack programs buggy.

>
> 5) I think a function that lets one view matrices as vectors 
> vec_of_mat is
> needed. They are all just ordered sets of numbers after all.
>
> 6) License. Have you thought of adding a static linking exception to 
> your LGPL
> license? Even INRIA did with Caml standard library. I might even 
> consider
> contributing then :-)
>
> -- 
> Oleg Trott <oleg_trott@columbia.edu>
>
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: 
> http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: 
> http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      parent reply	other threads:[~2003-12-15 21:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-13 13:51 romildo
2003-12-13 16:36 ` Markus Mottl
2003-12-13 21:38   ` Oleg Trott
2003-12-14 15:01     ` Markus Mottl
2003-12-14 23:10       ` Oleg Trott
2003-12-15 10:01         ` Markus Mottl
2003-12-15 17:05     ` [Caml-list] CamlFloat Shivkumar Chandrasekaran
2003-12-15 17:14     ` Shivkumar Chandrasekaran [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=327A735C-2F22-11D8-85BF-000393942C76@ece.ucsb.edu \
    --to=shiv@ece.ucsb.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).