2016-07-28 39 views
0

在平臺文件I只有一個主機:主機上正在運行的進程數是否有限制?

 <host id="Worker1" speed="100Mf" core="101"/> 

然後在worker.c我創建101(或> 100)處理期望,每個在每個核上一個進程將被啓動。但我注意到,只有第一進程能夠執行任務或XBT_INFO寫:

int worker(int argc, char *argv[]) 
{ 
    for (int i = 0; i < 101; ++i) { 
     MSG_process_create("x", slave, NULL, MSG_host_self()); 
    } 
    return 0; 
} 

int slave(){ 
    MSG_task_execute(MSG_task_create("kotok", 1e6, 0, NULL)); 
    MSG_process_kill(MSG_process_self()); 
    return 0; 
} 

其他進程超過100首的人都無法管理和殺:

[ 1.000000] (0:[email protected]) Oops ! Deadlock or code not perfectly clean. 
[ 1.000000] (0:[email protected]) 1 processes are still running, waiting for something. 
[ 1.000000] (0:[email protected]) Legend of the following listing: "Process <pid> (<name>@<host>): <status>" 
[ 1.000000] (0:[email protected]) Process 102 ([email protected]): waiting for execution synchro 0x26484d0 (kotok) in state 2 to finish 

UPDATE 這裏的一些代碼功能是:

main

int main(int argc, char *argv[]) 
{ 
    MSG_init(&argc, argv); 

    MSG_create_environment(argv[1]);   /** - Load the platform description */ 
    MSG_function_register("worker", worker); 
    MSG_launch_application(argv[2]);   /** - Deploy the application */ 

    msg_error_t res = MSG_main();    /** - Run the simulation */ 

    XBT_INFO("Simulation time %g", MSG_get_clock()); 

    return res != MSG_OK; 
} 

deployment.xml中

<?xml version='1.0'?> 
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd"> 
<platform version="4"> 

    <process host="Worker1" function="worker"> 
     <argument value="0"/> 
    </process> 

</platform> 

回答

1

實際上maxmin系統的大小(SimGrid的核心)的內部限制是100,在這種情況下可能會被觸發。我只是添加了一個標誌來使此限制可配置。你可以拉最後的版本,並嘗試將maxmin/concurrency_limit設置爲1000,看看它是否解決了你的問題?

1

,可以在主機上啓動了無關的內核數量進程的數量。正如在真機上一樣,由於分時機制,您可以同時運行多個進程。這裏也一樣。當正在運行的進程數大於核心數(1個或更多)時,他們必須共享資源。

問題的原因在其他地方,但是您沒有提供完整的最小工作示例(main?部署文件?),並且很難提供幫助。

相關問題