summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbustico2008-02-08 09:33:07 +0000
committerbustico2008-02-08 09:33:07 +0000
commit4013e1acba325a4f7ef4192c13ec39f64b4d098a (patch)
tree0eadf35fb16550a75f1e7cea6c4e4d08d2c3f22c /src
parente2f721ae39bd48abacb80c414b64e934abdbe610 (diff)
downloadivy-c-4013e1acba325a4f7ef4192c13ec39f64b4d098a.zip
ivy-c-4013e1acba325a4f7ef4192c13ec39f64b4d098a.tar.gz
ivy-c-4013e1acba325a4f7ef4192c13ec39f64b4d098a.tar.bz2
ivy-c-4013e1acba325a4f7ef4192c13ec39f64b4d098a.tar.xz
fix makefile for non omp target
Diffstat (limited to 'src')
-rw-r--r--src/Makefile14
-rw-r--r--src/ivy.c5
-rw-r--r--src/ivysocket.c20
-rw-r--r--src/ivythroughput.cpp2
4 files changed, 33 insertions, 8 deletions
diff --git a/src/Makefile b/src/Makefile
index b56c92e..6bdde25 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -264,7 +264,6 @@ installlibs: static-libs shared-libs
-test -d $(DESTDIR)$(X11_PREFIX)$(LIB) || mkdirhier $(DESTDIR)$(X11_PREFIX)$(LIB)
install -m644 libivy.a $(DESTDIR)$(PREFIX)$(LIB)
- install -m644 libivy_omp.a $(DESTDIR)$(PREFIX)$(LIB)
install -m644 libgivy.a $(DESTDIR)$(PREFIX)$(LIB)
-install -m644 libxtivy.a $(DESTDIR)$(X11_PREFIX)$(LIB)
install -m644 libtclivy.a $(DESTDIR)$(PREFIX)$(LIB)
@@ -275,6 +274,12 @@ installlibs: static-libs shared-libs
-install -m644 libxtivy.so.$(MAJOR).$(MINOR) $(DESTDIR)$(X11_PREFIX)$(LIB)
install -m644 libtclivy.so.$(MAJOR).$(MINOR) $(DESTDIR)$(PREFIX)$(LIB)
install -m644 libglibivy.so.$(MAJOR).$(MINOR) $(DESTDIR)$(PREFIX)$(LIB)
+
+installlibs_omp: static-libs shared-libs
+ test -d $(DESTDIR)$(PREFIX)$(LIB) || mkdirhier $(DESTDIR)$(PREFIX)$(LIB)
+ -test -d $(DESTDIR)$(X11_PREFIX)$(LIB) || mkdirhier $(DESTDIR)$(X11_PREFIX)$(LIB)
+
+ install -m644 libivy_omp.a $(DESTDIR)$(PREFIX)$(LIB)
install -m644 libivy_omp.so.$(MAJOR).$(MINOR) $(DESTDIR)$(PREFIX)$(LIB)
includes:
@@ -308,10 +313,10 @@ installliblinks: installlibs
installbins: commands
test -d $(DESTDIR)$(PREFIX)/bin || mkdirhier $(DESTDIR)$(PREFIX)/bin
install -m755 ivyprobe $(DESTDIR)$(PREFIX)/bin
+
+installbins_omp: commands
+ test -d $(DESTDIR)$(PREFIX)/bin || mkdirhier $(DESTDIR)$(PREFIX)/bin
install -m755 ivyprobe_omp $(DESTDIR)$(PREFIX)/bin
- #install -m755 ivyxtprobe $(DESTDIR)$(PREFIX)/bin
- #install -m755 ivyglibprobe $(DESTDIR)$(PREFIX)/bin
- #install -m755 ivyglutprobe $(DESTDIR)$(PREFIX)/bin
installdocs:
test -d $(DESTDIR)$(PREFIX)/share/doc/ivy-c || mkdirhier $(DESTDIR)$(PREFIX)/share/doc/ivy-c
@@ -331,6 +336,7 @@ installdocs:
install -m 766 ../examples/unBind.tcl $(DESTDIR)$(PREFIX)/share/doc/ivy-c/examples
install: installlibs installbins installliblinks installdocs includes installpkgconf
+install_omp: installlibs_omp installbins_omp
rpm::
/usr/bin/rpmize
diff --git a/src/ivy.c b/src/ivy.c
index 0d146ee..df180b2 100644
--- a/src/ivy.c
+++ b/src/ivy.c
@@ -21,6 +21,8 @@
° mesures de perfo
° compil rejeu en monothread et omp et tests
° compil sur mac et windows pour portabilité
+ ° faire un repertoire exemple avec tous les executables
+ ° faire un configure
*/
#ifdef OPENMP
@@ -695,7 +697,8 @@ static void BroadcastReceive( Client client, void *data, char *line )
#endif /*DEBUG */
/* connect to the service and send the regexp */
- app = SocketConnectAddr(SocketGetRemoteAddr(client), serviceport, 0, Receive, ClientDelete );
+ app = SocketConnectAddr(SocketGetRemoteAddr(client), serviceport, 0, Receive,
+ ClientDelete );
if (app) {
IvyClientPtr clnt;
clnt = SendService( app, appname );
diff --git a/src/ivysocket.c b/src/ivysocket.c
index d0fd60e..1cc12e6 100644
--- a/src/ivysocket.c
+++ b/src/ivysocket.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
+#include <fcntl.h>
#ifdef WIN32
#define close closesocket
@@ -186,6 +187,7 @@ static void HandleServer(Channel channel, HANDLE fd, void *data)
HANDLE ns;
socklen_t addrlen;
struct sockaddr_in remote2;
+ long socketFlag;
TRACE( "Accepting Connection...\n");
@@ -210,6 +212,13 @@ static void HandleServer(Channel channel, HANDLE fd, void *data)
client->terminator = '\n';
client->from = remote2;
client->fd = ns;
+
+ socketFlag = fcntl (client->fd, F_GETFD);
+ if (fcntl (client->fd, F_SETFD, socketFlag|O_NONBLOCK)) {
+ fprintf(stderr,"Warning : Setting socket in nonblock mode FAILED\n");
+ }
+
+
client->channel = IvyChannelAdd (ns, client, DeleteSocket, HandleSocket );
client->interpretation = server->interpretation;
client->ptr = client->buffer;
@@ -490,7 +499,8 @@ void *SocketGetData (Client client )
void SocketBroadcast ( char *fmt, ... )
{
Client client;
- static IvyBuffer buffer = {NULL, 0, 0 }; /* Use satic mem to eliminate multiple call to malloc /free */
+ static IvyBuffer buffer = {NULL, 0, 0 }; /* Use satic mem to eliminate
+ multiple call to malloc /free */
#ifdef OPENMP
#pragma omp threadprivate (buffer)
#endif
@@ -521,7 +531,8 @@ Client SocketConnect (char * host, unsigned short port,
fprintf(stderr, "Erreur %s Calculateur inconnu !\n",host);
return NULL;
}
- return SocketConnectAddr ((struct in_addr*)(rhost->h_addr), port, data, interpretation, handle_delete);
+ return SocketConnectAddr ((struct in_addr*)(rhost->h_addr), port, data,
+ interpretation, handle_delete);
}
Client SocketConnectAddr (struct in_addr * addr, unsigned short port,
@@ -533,6 +544,7 @@ Client SocketConnectAddr (struct in_addr * addr, unsigned short port,
HANDLE handle;
Client client;
struct sockaddr_in remote;
+ long socketFlag;
remote.sin_family = AF_INET;
remote.sin_addr = *addr;
@@ -547,6 +559,10 @@ Client SocketConnectAddr (struct in_addr * addr, unsigned short port,
perror ("*** client connect ***");
return NULL;
};
+ socketFlag = fcntl (handle, F_GETFD);
+ if (fcntl (handle, F_SETFD, socketFlag|O_NONBLOCK)) {
+ fprintf(stderr,"Warning : Setting socket in nonblock mode FAILED\n");
+ }
IVY_LIST_ADD_START(clients_list, client );
diff --git a/src/ivythroughput.cpp b/src/ivythroughput.cpp
index 3d56a60..21d04a9 100644
--- a/src/ivythroughput.cpp
+++ b/src/ivythroughput.cpp
@@ -500,7 +500,7 @@ void startOfSeqCB (IvyClientPtr app, void *user_data, int argc, char *argv[])
void endOfSeqCB (IvyClientPtr app, void *user_data, int argc, char *argv[])
{
- nbMess--;
+ //nbMess--;
printf ("recepteur %d a recu %d messages\n", globalInst, nbMess);
}