MESSAGE
DATE | 2015-03-30 |
FROM | Ruben Safir
|
SUBJECT | Subject: [LIU Comp Sci] HW 4.18 Problem
|
From owner-learn-outgoing-at-mrbrklyn.com Mon Mar 30 10:45:57 2015 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by mrbrklyn.com (Postfix) id 77253161166; Mon, 30 Mar 2015 10:45:57 -0400 (EDT) Delivered-To: learn-outgoing-at-mrbrklyn.com Received: by mrbrklyn.com (Postfix, from userid 28) id 56EBF16112F; Mon, 30 Mar 2015 10:45:57 -0400 (EDT) Delivered-To: learn-at-nylxs.com Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by mrbrklyn.com (Postfix) with ESMTP id 5962216112F; Mon, 30 Mar 2015 10:45:31 -0400 (EDT) Received: from [10.0.0.19] (unknown [96.57.23.82]) by mailbackend.panix.com (Postfix) with ESMTPSA id A28D7121AF; Mon, 30 Mar 2015 10:45:30 -0400 (EDT) Message-ID: <5519618A.1030608-at-panix.com> Date: Mon, 30 Mar 2015 10:45:30 -0400 From: Ruben Safir User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: learn-at-nylxs.com, hangout Subject: [LIU Comp Sci] HW 4.18 Problem Content-Type: multipart/mixed; boundary="------------060906030808030106020600" Sender: owner-learn-at-mrbrklyn.com Precedence: bulk Reply-To: learn-at-mrbrklyn.com
This is a multi-part message in MIME format. --------------060906030808030106020600 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit
thisis 4.18
Interesting problem in its own right. It is not theoretically necessary to map the negative random numbers because distance is always a positive number
I wan tot try this with OMP and spread the calculation across CPUs
One thing was, I maxed out of the instruction size for buffer size using #declare
relocation truncated to fit: R_X86_64_32 against symbol `ts' defined in .bss section in pi_lib.o
etc. No time to figure a fix but I have lots of ram, would be interesting to use it all.
This is why NASA uses LISP.
Ruben
--------------060906030808030106020600 Content-Type: application/x-compressed-tar; name="hw4.18.pi_calc.tgz" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="hw4.18.pi_calc.tgz"
H4sIAI1fGVUAA+0c/VfbOLK/kr9Cm21LQkkcfwYI4V2X0l3uoHCF7nbfbl+esZXE28T22g4h 18f97TeS7USOFMdQoHd7nr7X2NJoZvQxo9FoTFMae2406/lO03r2SNACMDSN/MptvUXf5fid QluVn8mK3jIU3TA09VlLVhRDfoZajyUQC5MwMgOEngWTK+zm4uEgfAqBnha+d1xrNLEx2g8j 2/Gaw4NKpmjkXGXKqr7To2VVBs+PhgE2bYJYufYcG22haWD6Pg5q5HWr3qlUHDdCY9Nxa+TB DAbWNrKGMPJb5OX6t0/1L5UN25tcjTDynU5lI6HZM6Mo6EEL+FkudVwnqr0kj3WmKkKRY8N7 IghQR1307sPJCYNjwf8Rrr0EzG1EKWynEm+TFiy9PzwQmiISIqQrG74DJC1zZIHa1ChuAL3q 16rnDnJChMPIGQN9G6RG3e4BetH/3f3drW5Dz2j7AEeTwEVyp3IrHLBYbDIiG4Hp2t6454MQ EWW1YXkTN4K+h46N45JUUnwD4xFLf1spOP9NKZnQR9P+tfqvaG091X8V/oH+y4ahl/r/FCBt oX9OyIL1XKQ15R3UD7wxioYYebAazchxByichREeh+inX+LaS3wTVWCNnl2gIxvtksfDkRmG 6Gze5OLXuAkowMnxB0RQzgNvgE7Rj8PAGeAASkjhezLq6MLsOwFqoIsIzIlLaW/dE6S5WeIN WmF7BuqLs5YQ1HlIzVsYBRMrQlQf0dQLPoe+aeHfTo9Oz97/2rs4f3149KlTGXlk2DBYgC5q Ja+xxvZgaHuWE1hg52hdQpCwDH1soSjsZJmE5tgf4c4S6y2UsQzEatQrYDBIHTGfiSm92Z4R g+P0a7E0wJKaFWvkWZ97AxwRvrXDk7PDf/TeH70+uTw+PQKLGIXUsCQ9iMJmdN1zQ2zRQsKY kiM4t5WNvhegmkN7gxy0j9ixgJJXryhHSeonVhLBNOAADG31KAig7Qub2s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WY3epBEg7m9//Db3X/39J1 ef79d1uT2/T+X1XK+/+ngP+X+//hf8n9v++XGQDfPAPgThfvedf7uR935OYZlFf25ZV9eWXP Xaj1YRX00enZu8vj3vnx19y2L4gCRTIFOUTz7ty/8iuLlDnjiq44tS1Hrlqi09jjfIchuBzK nAXyrswL3btkfO+8K+4i1LJxrbxL7dviN9T3u2d+qLu1e95E553m7sQx73r64aJdxT+4KHxV fb9L5oV6Yteehyn+V1O4vwqa0tj8DDZqhB+Px5rzX0s30r//o8rx+Q/QyvzvJ4GPH/e6A8uq HH78+Pbk9Y8Xe93GL+ZohBoD1PAHqHLyJimmr43kE4lKJT1fIeqcx1/Yeyg5bHmVjec1oFhH 9IdSIM8JsTpqeItW+AYLSVSYQoaJhVKU4VouFtOsUkkpA7WUQvpgFSA1R62kaT9Ec5o29sPK /GkPbTWtDnr+Bajcxj+Uwi1qnJIqdPD8b3+JvxtSQgkllFBCCSWUUEIJJZRQQgkllFBCCSWU UEIJJZRQQgkllFBCCSWUUEIJJZRQQgklfDv4DzjUJBgAeAAA --------------060906030808030106020600 Content-Type: text/html; charset=UTF-8; name="pi_lib.h.html" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="pi_lib.h.html"
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIiAiaHR0 cDovL3d3dy53My5vcmcvVFIvaHRtbDQvc3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KPG1l dGEgaHR0cC1lcXVpdj0iY29udGVudC10eXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJz ZXQ9VVRGLTgiPgo8dGl0bGU+fi9zcmMvZ3JhZF9zY2hvb2wvb3BlcmF0aW5nX3N5c3RlbXMv bW9udHlfcGkvcGlfbGliLmguaHRtbDwvdGl0bGU+CjxtZXRhIG5hbWU9IkdlbmVyYXRvciIg Y29udGVudD0iVmltLzcuNCI+CjxtZXRhIG5hbWU9InBsdWdpb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3NwYW4+KTsKPHNwYW4gaWQ9IkwxNCIgY2xhc3M9IkxpbmVOciI+ MTQgPC9zcGFuPgo8c3BhbiBpZD0iTDE1IiBjbGFzcz0iTGluZU5yIj4xNSA8L3NwYW4+Cjxz cGFuIGlkPSJMMTYiIGNsYXNzPSJMaW5lTnIiPjE2IDwvc3Bhbj48c3BhbiBjbGFzcz0iUHJl UHJvYyI+I2VuZGlmPC9zcGFuPgo8L3ByZT4KPC9ib2R5Pgo8L2h0bWw+CjwhLS0gdmltOiBz ZXQgZm9sZG1ldGhvZD1tYW51YWwgOiAtLT4K --------------060906030808030106020600 Content-Type: text/html; charset=UTF-8; name="pi_lib.c.html" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="pi_lib.c.html"
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIiAiaHR0 cDovL3d3dy53My5vcmcvVFIvaHRtbDQvc3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KPG1l dGEgaHR0cC1lcXVpdj0iY29udGVudC10eXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJz ZXQ9VVRGLTgiPgo8dGl0bGU+fi9zcmMvZ3JhZF9zY2hvb2wvb3BlcmF0aW5nX3N5c3RlbXMv bW9udHlfcGkvcGlfbGliLmMuaHRtbDwvdGl0bGU+CjxtZXRhIG5hbWU9IkdlbmVyYXRvciIg Y29udGVudD0iVmltLzcuNCI+CjxtZXRhIG5hbWU9InBsdWdpbi12ZXJzaW9uIiBjb250ZW50 PSJ2aW03LjRfdjEiPgo8bWV0YSBuYW1lPSJzeW50YXgiIGNvbnRlbnQ9ImMiPgo8bWV0YSBu YW1lPSJzZXR0aW5ncyIgY29udGVudD0ibnVtYmVyX2xpbmVzLHVzZV9jc3MscHJlX3dyYXAs bm9fZm9sZGNvbHVtbixleHBhbmRfdGFicyxsaW5lX2lkcyxwcmV2ZW50X2NvcHk9Ij4KPG1l dGEgbmFtZ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yIj42NSA8L3NwYW4+CjxzcGFuIGlkPSJMNjYiIGNsYXNzPSJMaW5lTnIiPjY2 IDwvc3Bhbj4KPHNwYW4gaWQ9Ikw2NyIgY2xhc3M9IkxpbmVOciI+NjcgPC9zcGFuPgo8L3By ZT4KPC9ib2R5Pgo8L2h0bWw+CjwhLS0gdmltOiBzZXQgZm9sZG1ldGhvZD1tYW51YWwgOiAt LT4K --------------060906030808030106020600 Content-Type: text/html; charset=UTF-8; name="monty_pi.c.html" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="monty_pi.c.html"
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIiAiaHR0 cDovL3d3dy53My5vcmcvVFIvaHRtbDQvc3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KPG1l dGEgaHR0cC1lcXVpdj0iY29udGVudC10eXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJz ZXQ9VVRGLTgiPgo8dGl0bGU+fi9zcmMvZ3JhZF9zY2hvb2wvb3BlcmF0aW5nX3N5c3RlbXMv bW9udHlfcGkvbW9udHlfcGkuYy5odG1sPC90aXRsZT4KPG1ldGEgbmFtZT0iR2VuZXJhdG9y IiBjb250ZW50PSJWaW0vNy40Ij4KPG1ldGEgbmFtZT0icGx1Z2luLXZlcnNpb24iIGNvbnRl bnQ9InZpbTcuNF92MSI+CjxtZXRhIG5hbWU9InN5bnRheCIgY29udGVudD0iYyI+CjxtZXRh IG5hbWU9InNldHRpbmdzIiBjb250ZW50PSJudW1iZXJfbGluZXMsdXNlX2NzcyxwcmVfd3Jh cCxub19mb2xkY29sdW1uLGV4cGFuZF90YWJzLGxpbmVfaWRzLHByZXZlbnRfY29weT0iPgo8 bWV0YSBuYW1lPSJjb2xvcnNjaGVtZSIgY29udGVudD0icGVhY2hwdWZmIj4KPHN0eWxlIHR5 cGU9InRleHQvY3NzIj4KPCEtLQpwcmUgeyB3aGl0ZS1zcG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XNzPSJMaW5lTnIiPjI0IDwvc3Bhbj4gICAg ICByYW5kb21fcG9pbnQoKTsKPHNwYW4gaWQ9IkwyNSIgY2xhc3M9IkxpbmVOciI+MjUgPC9z cGFuPiAgICAgIGNvdW50X2luc2lkZSgpOwo8c3BhbiBpZD0iTDI2IiBjbGFzcz0iTGluZU5y Ij4yNiA8L3NwYW4+ICAgICAgcHRocmVhZF9leGl0KGFyZyk7CjxzcGFuIGlkPSJMMjciIGNs YXNzPSJMaW5lTnIiPjI3IDwvc3Bhbj59CjwvcHJlPgo8L2JvZHk+CjwvaHRtbD4KPCEtLSB2 aW06IHNldCBmb2xkbWV0aG9kPW1hbnVhbCA6IC0tPgo= --------------060906030808030106020600 Content-Type: text/x-csrc; name="monty_pi.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="monty_pi.c"
#include #include #include "pi_lib.h" #include
void * wrapper(void*);
int main(int argc, char * argv[]){ double pi; pthread_attr_t attr; pthread_attr_init(&attr); pthread_t tid; void * arg = NULL; pthread_create(&tid, &attr, wrapper, arg); pthread_join(tid, NULL);
pi = calc_pi(); printf("Pi is estimated at ==> %f\n\n", pi);
return 1; }
void * wrapper(void * arg){ random_point(); count_inside(); pthread_exit(arg); }
--------------060906030808030106020600 Content-Type: text/x-chdr; name="pi_lib.h" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pi_lib.h"
#ifndef MONTI_PI #define MONTI_PI
#define MEMORY_SPACE 100000000
struct point{ double x; double y; };
struct point * random_point(void); double calc_pi(void); int count_inside(void);
#endif
--------------060906030808030106020600 Content-Type: text/x-csrc; name="pi_lib.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pi_lib.c"
/* Question 4.18 from the operating systems HW from Text * OS Ed 9 * Class Operating SYstems at LIU * Prog M Ghriger * * Ruben Safir - Student * ********************************************************/ #include #include #include "pi_lib.h" #include #include
struct point workspace[MEMORY_SPACE]; long seed = 0; long inside_the_circle = 0; struct timespec ts; struct point sample;
struct point * random_point(void) { int i; double x,y;
if(seed == 0){ clock_gettime(CLOCK_REALTIME, &ts); seed = ts.tv_nsec; srand(seed); } for (i = 0; i < MEMORY_SPACE; i++){ //fprintf( stderr, "Error %d\n", __LINE__); //x = ((double)rand()) % (double)1000000 ; x = rand() % 1000000 ; x = x / (double)1000000;
// printf ("x==> %F", x); //y = ((double)rand())% (double)1000000 ; y = rand()% 10000000 ; y = y / (double)10000000; // printf(" y==> %F\n", y); workspace[i].x = x; workspace[i].y = y; } return &workspace[0]; }
int count_inside(void) { int i = 0; double d; for(i = 0; i < MEMORY_SPACE; i++){ d = sqrt(pow(workspace[i].x, 2.0) + pow(workspace[i].y, 2.0)); // printf ("distance => %f\n", d); if (d <= 1.0) inside_the_circle++; } return inside_the_circle; }
double calc_pi(){ return 4.0 * (( double)inside_the_circle/ (double)MEMORY_SPACE) ; }
--------------060906030808030106020600 Content-Type: text/plain; charset=UTF-8; name="makefile" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="makefile"
WFg6PWdjYwpDWFhGTEFHUzo9LVdhbGwgLWcgLXBnIApMREZMQUdTOj0gLXBnIC1wdGhyZWFk Cgptb250eV9waSA6IG1vbnR5X3BpLm8gcGlfbGliLm8KCSQoQ1hYKSAkKENYWEZMQUdTKSAk KExERkxBR1MpIC1vIG1vbnR5X3BpLmV4ZSBtb250eV9waS5vIHBpX2xpYi5vCgptb250eV9w aS5vIDogbW9udHlfcGkuYyAgcGlfbGliLmgKCSQoQ1hYKSAkKENYWEZMQUdTKSAkKExERkxB R1MpIC1jIG1vbnR5X3BpLmMKCnBpX2xpYi5vIDogcGlfbGliLmggcGlfbGliLmMKCSQoQ1hY KSAkKENYWEZMQUdTKSAkKExERkxBR1MpIC1jIHBpX2xpYi5jCgppbmNsdWRlIG1ha2UuZGVw cwptYWtlLmRlcHM6ICouYzsgJHtDWFh9ICR7Q1hYRkxBR1N9IC1NICouYyA+JEAKCg== --------------060906030808030106020600--
|
|