PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > 100k X 100k data processing summary
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
100k X 100k data processing summary

Réponse
 
LinkBack Outils de la discussion
Vieux 24/11/2007, 21h28   #1
a
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 100k X 100k data processing summary

By previous replies, it seems that the following method somehow solves the
problem up to 1000 * 1000 2D data, but when I try 10k * 10k, the
segmentation fault problem appears again.

Richard Tobin told me there is a system limit that can be changed. But I
don't know which file is to be changed.

I have modified again and again and hope to find out a solution that can
handle 100k * 100k data.

float** array_to_matrix(float* m, int rows, int cols) {
int i,j;

float** r;

r = (float**)calloc(rows,sizeof(float*));

for(i=0;i<rows;i++)
{
r[i] = (float*)calloc(cols,sizeof(float));

for(j=0;j<cols;j++)
r[i][j] = m[i*cols+j];
}
return r;

}


  Réponse avec citation
Vieux 24/11/2007, 21h38   #2
Ian Collins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: 100k X 100k data processing summary

a wrote:
> By previous replies, it seems that the following method somehow solves the
> problem up to 1000 * 1000 2D data, but when I try 10k * 10k, the
> segmentation fault problem appears again.
>

System memory is finite, if you attempt to allocate more than there is
available, you will fail.

> Richard Tobin told me there is a system limit that can be changed. But I
> don't know which file is to be changed.
>
> I have modified again and again and hope to find out a solution that can
> handle 100k * 100k data.
>

Which is 10GB*sizeof(float), do you have that much (virtual) memory to
play with?

It sound like you have more of an algorithm problem than a C one.

> float** array_to_matrix(float* m, int rows, int cols) {
> int i,j;
>
> float** r;
>
> r = (float**)calloc(rows,sizeof(float*));
>

Drop the cast.

--
Ian Collins.
  Réponse avec citation
Vieux 24/11/2007, 21h39   #3
Ian Collins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: 100k X 100k data processing summary

Ian Collins wrote:
> a wrote:
>> By previous replies, it seems that the following method somehow solves the
>> problem up to 1000 * 1000 2D data, but when I try 10k * 10k, the
>> segmentation fault problem appears again.
>>

> System memory is finite, if you attempt to allocate more than there is
> available, you will fail.
>
>> Richard Tobin told me there is a system limit that can be changed. But I
>> don't know which file is to be changed.
>>
>> I have modified again and again and hope to find out a solution that can
>> handle 100k * 100k data.
>>

> Which is 10GB*sizeof(float), do you have that much (virtual) memory to
> play with?
>
> It sound like you have more of an algorithm problem than a C one.
>
>> float** array_to_matrix(float* m, int rows, int cols) {
>> int i,j;
>>
>> float** r;
>>
>> r = (float**)calloc(rows,sizeof(float*));
>>

> Drop the cast.
>

And always check the return of [mc]alloc isn't null.

--
Ian Collins.
  Réponse avec citation
Vieux 24/11/2007, 23h09   #4
Richard Tobin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: 100k X 100k data processing summary

In article <fia513$rvc$1@justice.itsc.cuhk.edu.hk>, a <a@a.com> wrote:

>Richard Tobin told me there is a system limit that can be changed. But I
>don't know which file is to be changed.


As I said, ask your system administrator. Or read the manual.
We can't tell you, because you haven't even told us what system
you're using.

>I have modified again and again and hope to find out a solution that can
>handle 100k * 100k data.


100k * 100k is 10g, and if floats are 4 bytes that's 40 gigabytes.
You really will need a supercomputer for that. Perhaps you should
reconsider your algorithm, or wait several years.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
  Réponse avec citation
Vieux 24/11/2007, 23h16   #5
Ian Collins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: 100k X 100k data processing summary


>
> 100k * 100k is 10g, and if floats are 4 bytes that's 40 gigabytes.
> You really will need a supercomputer for that. Perhaps you should
> reconsider your algorithm, or wait several years.
>

<OT> Workstation boards with support for 64GB of RAM are available from
several vendors! All it takes is a spare $10K for the RAM... </OT>

--
Ian Collins.
  Réponse avec citation
Vieux 24/11/2007, 23h38   #6
Johannes Bauer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: 100k X 100k data processing summary

Richard Tobin schrieb:

> 100k * 100k is 10g, and if floats are 4 bytes that's 40 gigabytes.
> You really will need a supercomputer for that. Perhaps you should
> reconsider your algorithm, or wait several years.


It might work if enough virtual memory is available - serious thrashing
implied. Suitable for *some* problems, however, if access pattern to
this matrix are not arbitrary (which they aren't for most algorithms).

Usually data in such huge matrices is sparse anyways - so, I fully
second your statement the OP should reconsider his algorithm. If it
fails in the early stage of memory allocation he/she probably hasn't
thourhgt about it at all.

Greetings,
Johannes

--
"Viele der Theorien der Mathematiker sind falsch und klar
Gotteslästerlich. Ich vermute, dass diese falschen Theorien genau
deshalb so geliebt werden." -- Prophet und Visionär Hans Joss aka
HJP in de.sci.mathematik <4740ad67$0$3811$5402220f@news.sunrise.ch>
  Réponse avec citation
Vieux 25/11/2007, 00h59   #7
Gordon Burditt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: 100k X 100k data processing summary

>> 100k * 100k is 10g, and if floats are 4 bytes that's 40 gigabytes.
>> You really will need a supercomputer for that. Perhaps you should
>> reconsider your algorithm, or wait several years.

>
>It might work if enough virtual memory is available - serious thrashing
>implied.


On a 32-bit machine (say, Pentium with PAE36) you could have 64G
of physical memory, and a lot more physical swap/page space, but
with a 32-bit address space for an individual process, you're limited
to 4G (and sometimes much less). So you need a machine with 64-bit
addressing and an OS that supports it for individual processes.
Simply adding lots of memory and swap/page space isn't enough.

>Suitable for *some* problems, however, if access pattern to
>this matrix are not arbitrary (which they aren't for most algorithms).
>
>Usually data in such huge matrices is sparse anyways - so, I fully
>second your statement the OP should reconsider his algorithm. If it
>fails in the early stage of memory allocation he/she probably hasn't
>thourhgt about it at all.

  Réponse avec citation
Vieux 25/11/2007, 01h03   #8
a
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: 100k X 100k data processing summary

Thanks Richard. It's red hat enterprise, or Fedora related. The biggest
problem I'm having is that I don't know the keyword because compilation
memory program memory alike doesn't give me good results in google search.


"Richard Tobin" <richard@cogsci.ed.ac.uk> wrote in message
news:fiaav3$973$2@pc-news.cogsci.ed.ac.uk...
> In article <fia513$rvc$1@justice.itsc.cuhk.edu.hk>, a <a@a.com> wrote:
>
>>Richard Tobin told me there is a system limit that can be changed. But I
>>don't know which file is to be changed.

>
> As I said, ask your system administrator. Or read the manual.
> We can't tell you, because you haven't even told us what system
> you're using.
>
> -- Richard
> --
> "Consideration shall be given to the need for as many as 32 characters
> in some alphabets" - X3.4, 1963.



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h54.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17310 seconds with 16 queries