Δημοσιεύτηκε: 08 Απρ 2009, 22:28
Ο πηγαίος κώδικας που χρησιμοποίησα στο pc μου (και μου έβγαλε το θέμα του segmentation fault στην παράλληλη επεξεργασία) έχει ήδη δοκιμαστεί σε άλλους υπολογιστές με linux red hat και με τον ίδιο compiler (intel fortran 11 - γι' αυτό και ήθελα τον συγκεκριμένο compiler γιατί πάνω κάτω τον έχω δοκιμάσει και ψιλοξέρω κάποια ορίσματά του) και εκεί δεν εμφανίζεται κανένα πρόβλημα segmentation. Άρα δεν νομίζω ότι φταίει τόσο ο κώδικας όσο κάποιες ρυθμίσεις του pc μου. Στο κάτω κάτω ο κώδικας είναι κώδικας ρευστομηχανικής, τροποποιημένος για παράλληλη επεξεργασία, δεν μπορώ να καταλάβω τι θα μπορούσα να του αλλάξω για να μην εμφανίζει αυτό το σφάλμα (πέραν ίσως του αριθμού των threads και τις private μεταβλητές?).
Τώρα όσον αφορά το openmp και το stacksize στο βιβλίο Using OpenMP Portable Shared Memory Parallel Programming λέει ότι :
Note that each thread’s stack has a fixed amount of space. If the programmer
does not specify its size, the compiler will arrange for an implementation-dependent
default amount of memory to be allocated per thread when they are started up.
Since it may need to hold copies of a considerable amount of data including the
private variables of all the procedures active at any given time, the stack can grow
quickly and may exceed the space reserved for it. As a result, it may be necessary to
increase the thread stacksize. The programmer should consult the documentation
to find out how to do so.
Άρα νομίζω πως μάλλον υπάρχει μια ιδιαίτερη ευαισθησία του stacksize στο openmp. Τουλάχιστον αυτό πιστεύω από την (σχετικά λίγη) εμπειρία μου πάνω στο θέμα. Οποιοδήποτε σχόλιο είναι ευπρόσδεκτο.
Τώρα όσον αφορά το openmp και το stacksize στο βιβλίο Using OpenMP Portable Shared Memory Parallel Programming λέει ότι :
Note that each thread’s stack has a fixed amount of space. If the programmer
does not specify its size, the compiler will arrange for an implementation-dependent
default amount of memory to be allocated per thread when they are started up.
Since it may need to hold copies of a considerable amount of data including the
private variables of all the procedures active at any given time, the stack can grow
quickly and may exceed the space reserved for it. As a result, it may be necessary to
increase the thread stacksize. The programmer should consult the documentation
to find out how to do so.
Άρα νομίζω πως μάλλον υπάρχει μια ιδιαίτερη ευαισθησία του stacksize στο openmp. Τουλάχιστον αυτό πιστεύω από την (σχετικά λίγη) εμπειρία μου πάνω στο θέμα. Οποιοδήποτε σχόλιο είναι ευπρόσδεκτο.