1
1
CIDs: 737,739,740,741,742,743,744,756,907,1110,1111

This commit was SVN r19376.
Этот коммит содержится в:
Matthias Jurenz 2008-08-20 15:50:15 +00:00
родитель 04fe1e1875
Коммит 67f1e35eb0
4 изменённых файлов: 53 добавлений и 51 удалений

Просмотреть файл

@ -142,7 +142,10 @@ int RFG_Filter_readDefFile( RFG_Filter* filter )
orgline = ( char* )malloc( MAX_LINE_LEN * sizeof( char ) );
if( orgline == NULL )
{
fclose( f );
return 0;
}
/* read lines */

Просмотреть файл

@ -147,7 +147,10 @@ int RFG_Groups_readDefFile( RFG_Groups* groups )
orgline = ( char* )malloc( MAX_LINE_LEN * sizeof( char ) );
if( orgline == NULL )
{
fclose( f );
return 0;
}
/* read lines */

Просмотреть файл

@ -1518,13 +1518,12 @@ DEF_FMPI_FUNC( vt_mpi_waitall_f(MPI_Fint* count, MPI_Fint array_of_requests[],
MPI_Request* l_request = 0;
MPI_Status* c_status = 0;
if (*count > 0) {
l_request = alloc_request_array(*count);
c_status = alloc_status_array(*count);
for (i=0; i<*count; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
l_request = alloc_request_array(*count);
c_status = alloc_status_array(*count);
for (i=0; i<*count; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
*ierr = MPI_Waitall(*count, l_request, c_status);
for (i=0; i<*count; i++) {
array_of_requests[i] = MPI_Request_c2f(l_request[i]);
@ -1548,12 +1547,11 @@ DEF_FMPI_FUNC( vt_mpi_waitany_f(MPI_Fint* count, MPI_Fint array_of_requests[],
MPI_Request *l_request = 0;
MPI_Status c_status;
if (*count > 0) {
l_request = alloc_request_array(*count);
for (i=0; i<*count; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
l_request = alloc_request_array(*count);
for (i=0; i<*count; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
*ierr = MPI_Waitany(*count, l_request, index, &c_status);
if (*ierr == MPI_SUCCESS) {
if (*index >= 0) {
@ -1583,13 +1581,12 @@ DEF_FMPI_FUNC( vt_mpi_waitsome_f(MPI_Fint* incount,
MPI_Request *l_request = 0;
MPI_Status *c_status = 0;
if (*incount > 0) {
l_request = alloc_request_array(*incount);
c_status = alloc_status_array(*incount);
for (i=0; i<*incount; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
l_request = alloc_request_array(*incount);
c_status = alloc_status_array(*incount);
for (i=0; i<*incount; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
*ierr = MPI_Waitsome(*incount, l_request, outcount, array_of_indices,
c_status);
if (*ierr == MPI_SUCCESS) {
@ -1644,12 +1641,11 @@ DEF_FMPI_FUNC( vt_mpi_testany_f(MPI_Fint* count, MPI_Fint array_of_requests[],
MPI_Request *l_request = 0;
MPI_Status c_status;
if (*count > 0) {
l_request = alloc_request_array(*count);
for (i=0; i<*count; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
l_request = alloc_request_array(*count);
for (i=0; i<*count; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
*ierr = MPI_Testany(*count, l_request, index, flag, &c_status);
if (*ierr == MPI_SUCCESS) {
if (*flag && *index >= 0) {
@ -1677,13 +1673,12 @@ DEF_FMPI_FUNC( vt_mpi_testall_f(MPI_Fint* count, MPI_Fint array_of_requests[],
MPI_Request *l_request = 0;
MPI_Status *c_status = 0;
if (*count > 0) {
l_request = alloc_request_array(*count);
c_status = alloc_status_array(*count);
for (i=0; i<*count; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
l_request = alloc_request_array(*count);
c_status = alloc_status_array(*count);
for (i=0; i<*count; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
*ierr = MPI_Testall(*count, l_request, flag, c_status);
for (i=0; i<*count; i++) {
array_of_requests[i] = MPI_Request_c2f(l_request[i]);
@ -1710,13 +1705,12 @@ DEF_FMPI_FUNC( vt_mpi_testsome_f(MPI_Fint* incount,
MPI_Request *l_request = 0;
MPI_Status *c_status = 0;
if (*incount > 0) {
l_request = alloc_request_array(*incount);
c_status = alloc_status_array(*incount);
for (i=0; i<*incount; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
l_request = alloc_request_array(*incount);
c_status = alloc_status_array(*incount);
for (i=0; i<*incount; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
*ierr = MPI_Testsome(*incount, l_request, outcount, array_of_indices,
c_status);
if (*ierr == MPI_SUCCESS) {
@ -1843,12 +1837,11 @@ DEF_FMPI_FUNC( vt_mpi_startall_f(MPI_Fint* count, MPI_Fint array_of_requests[],
int i;
MPI_Request *l_request = 0;
if (*count > 0) {
l_request = alloc_request_array(*count);
for (i=0; i<*count; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
l_request = alloc_request_array(*count);
for (i=0; i<*count; i++) {
l_request[i] = MPI_Request_f2c(array_of_requests[i]);
}
*ierr = MPI_Startall(*count, l_request);
if (*ierr == MPI_SUCCESS) {
for (i=0; i<*count; i++) {

Просмотреть файл

@ -39,7 +39,6 @@ static uint32_t tnum = 0;
VTThrd* VTThrd_create(uint32_t tid)
{
char tmp[PATH_MAX];
VTThrd *thread;
#if (defined (VT_METR))
int num_metrics = vt_metric_num();
@ -48,19 +47,18 @@ VTThrd* VTThrd_create(uint32_t tid)
if (tnum > (uint32_t)vt_env_max_threads())
vt_error_msg("FATAL: Cannot create more than %d threads", vt_env_max_threads());
thread = (VTThrd*) malloc(sizeof(VTThrd));
thread = (VTThrd*)malloc(sizeof(VTThrd));
if ( thread == NULL )
vt_error();
/* basename includes local path but neither thread identifier nor suffix */
sprintf(tmp, "%s/%s.%lx.%u", vt_env_ldir(), vt_env_fprefix(),
vt_pform_node_id(), getpid());
thread->tmp_name = (char*)calloc(strlen(tmp) + 1, sizeof(char*));
thread->tmp_name = (char*)calloc(PATH_MAX + 1, sizeof(char));
if ( thread->tmp_name == NULL )
vt_error();
strcpy(thread->tmp_name, tmp);
/* basename includes local path but neither thread identifier nor suffix */
snprintf(thread->tmp_name, PATH_MAX, "%s/%s.%lx.%u",
vt_env_ldir(), vt_env_fprefix(),
vt_pform_node_id(), getpid());
thread->stack_level = 0;
@ -146,19 +144,24 @@ void VTThrd_close(VTThrd* thrd)
void VTThrd_delete(VTThrd* thrd, uint32_t tid)
{
if (thrd && thrd->gen)
if (!thrd) return;
if (thrd->gen)
VTGen_delete(thrd->gen);
#if (defined (VT_METR))
if ( vt_metric_num() > 0 )
if (thrd->metv && vt_metric_num() > 0 )
vt_metric_free(thrd->metv);
#endif
#if (defined (RFG))
RFG_Regions_free( thrd->rfg_regions );
if (thrd->rfg_regions)
RFG_Regions_free( thrd->rfg_regions );
#endif
free(thrd->tmp_name);
if (thrd->tmp_name)
free(thrd->tmp_name);
free(thrd);
/* decrement the thread object counter */