1
1

If it's not the HNP, release the cluster object first and return.

This commit was SVN r18247.
Этот коммит содержится в:
Shiqing Fan 2008-04-23 13:21:32 +00:00
родитель 750ce0152c
Коммит eb5f5d77cc
2 изменённых файлов: 45 добавлений и 43 удалений

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

@ -26,12 +26,12 @@
#include "orte/mca/plm/base/base.h"
#include "orte/mca/plm/base/plm_private.h"
#include "plm_ccp.h"
/* Import the Windows CCP API. */
#import "ccpapi.tlb" named_guids no_namespace raw_interfaces_only \
rename("SetEnvironmentVariable","SetEnvVar") \
rename("GetJob", "GetSingleJob") \
rename("AddJob", "AddSingleJob")
/* Import the Windows CCP API. */
#import "ccpapi.tlb" named_guids no_namespace raw_interfaces_only \
rename("SetEnvironmentVariable","SetEnvVar") \
rename("GetJob", "GetSingleJob") \
rename("AddJob", "AddSingleJob")
/*
@ -133,26 +133,27 @@ static int plm_ccp_close(void)
static orte_plm_base_module_t *plm_ccp_init(int *priority)
{
int rc;
ICluster* pCluster = NULL;
HRESULT hr = S_OK;
int rc;
ICluster* pCluster = NULL;
HRESULT hr = S_OK;
/* CCP is not thread safe. Use the apartment model. */
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
/* Try to create the Cluster object. */
hr = CoCreateInstance( __uuidof(Cluster),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(ICluster),
reinterpret_cast<void **> (&pCluster) );
if (FAILED(hr)) {
/* We are not Windows clusters, don't select us.*/
return NULL;
}
/* CCP is not thread safe. Use the apartment model. */
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
/* Try to create the Cluster object. */
hr = CoCreateInstance( __uuidof(Cluster),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(ICluster),
reinterpret_cast<void **> (&pCluster) );
if (FAILED(hr)) {
/* We are not Windows clusters, don't select us.*/
return NULL;
}
/* if we are NOT an HNP, then don't select us */
if (!orte_process_info.hnp) {
pCluster->Release();
return NULL;
}

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

@ -21,12 +21,12 @@
#include "orte/util/proc_info.h"
#include "ras_ccp.h"
/* Import the Windows CCP API. */
#import "ccpapi.tlb" named_guids no_namespace raw_interfaces_only \
rename("SetEnvironmentVariable","SetEnvVar") \
rename("GetJob", "GetSingleJob") \
rename("AddJob", "AddSingleJob")
/* Import the Windows CCP API. */
#import "ccpapi.tlb" named_guids no_namespace raw_interfaces_only \
rename("SetEnvironmentVariable","SetEnvVar") \
rename("GetJob", "GetSingleJob") \
rename("AddJob", "AddSingleJob")
/*
@ -90,26 +90,27 @@ static int ras_ccp_open(void)
static orte_ras_base_module_t *ras_ccp_init(int* priority)
{
int rc;
ICluster* pCluster = NULL;
HRESULT hr = S_OK;
int rc;
ICluster* pCluster = NULL;
HRESULT hr = S_OK;
/* CCP is not thread safe. Use the apartment model. */
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
/* Try to create the Cluster object. */
hr = CoCreateInstance( __uuidof(Cluster),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(ICluster),
reinterpret_cast<void **> (&pCluster) );
if (FAILED(hr)) {
/* We are not Windows clusters, don't select us.*/
return NULL;
/* CCP is not thread safe. Use the apartment model. */
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
/* Try to create the Cluster object. */
hr = CoCreateInstance( __uuidof(Cluster),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(ICluster),
reinterpret_cast<void **> (&pCluster) );
if (FAILED(hr)) {
/* We are not Windows clusters, don't select us.*/
return NULL;
}
/* if we are NOT an HNP, then don't select us */
if (!orte_process_info.hnp) {
pCluster->Release();
return NULL;
}