mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-28 22:00:33 +05:00
Changed MyMPI_RecvCmd and MyMPI_SendCmd. Disabled USE_BUFFERS for now.
This commit is contained in:
parent
dc1fb0a947
commit
383ced496b
@ -16,35 +16,29 @@ namespace netgen
|
|||||||
|
|
||||||
void MyMPI_SendCmd (const char * cmd)
|
void MyMPI_SendCmd (const char * cmd)
|
||||||
{
|
{
|
||||||
char buf[10000];
|
int ntasks;
|
||||||
strcpy (buf, cmd);
|
MPI_Comm_size(MPI_COMM_WORLD, &ntasks);
|
||||||
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
|
|
||||||
|
if(ntasks==1)
|
||||||
|
return;
|
||||||
|
|
||||||
for (int dest = 1; dest < ntasks; dest++)
|
for (int dest = 1; dest < ntasks; dest++)
|
||||||
MPI_Send( &buf, 10000, MPI_CHAR, dest, MPI_TAG_CMD, MPI_COMM_WORLD);
|
MPI_Send( cmd, (strlen(cmd)+1), MPI_CHAR, dest, MPI_TAG_CMD, MPI_COMM_WORLD);
|
||||||
}
|
}
|
||||||
|
|
||||||
string MyMPI_RecvCmd ()
|
string MyMPI_RecvCmd ()
|
||||||
{
|
{
|
||||||
char buf[10000];
|
|
||||||
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
|
|
||||||
|
|
||||||
// VT_OFF();
|
|
||||||
MPI_Status status;
|
MPI_Status status;
|
||||||
int flag;
|
int flag;
|
||||||
do
|
int size_of_msg = -1;
|
||||||
{
|
|
||||||
MPI_Iprobe (0, MPI_TAG_CMD, MPI_COMM_WORLD, &flag, &status);
|
|
||||||
if (!flag)
|
|
||||||
{
|
|
||||||
VT_TRACER ("sleep");
|
|
||||||
usleep (1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (!flag);
|
|
||||||
// VT_ON();
|
|
||||||
|
|
||||||
MPI_Recv( &buf, 10000, MPI_CHAR, 0, MPI_TAG_CMD, MPI_COMM_WORLD, &status);
|
MPI_Probe(0, MPI_TAG_CMD, MPI_COMM_WORLD, &status);
|
||||||
|
MPI_Get_count(&status, MPI_CHAR, &size_of_msg);
|
||||||
|
|
||||||
|
//char* buf = (char*)malloc(size_of_msg*sizeof(char));
|
||||||
|
char buf[100000]; //1MB should be enough...
|
||||||
|
|
||||||
|
MPI_Recv( &buf, size_of_msg, MPI_CHAR, 0, MPI_TAG_CMD, MPI_COMM_WORLD, &status);
|
||||||
|
|
||||||
return string(buf);
|
return string(buf);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ class DLL_HEADER VisualSceneSolution : public VisualScene
|
|||||||
Point<3> p;
|
Point<3> p;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define USE_BUFFERS
|
// #define USE_BUFFERS
|
||||||
#ifdef USE_BUFFERS
|
#ifdef USE_BUFFERS
|
||||||
bool has_surfel_vbo = false;
|
bool has_surfel_vbo = false;
|
||||||
GLuint surfel_vbo[4]; //
|
GLuint surfel_vbo[4]; //
|
||||||
|
Loading…
Reference in New Issue
Block a user